wip: modularizing?

This commit is contained in:
2025-10-30 17:34:55 -04:00
parent a73194fed9
commit 8fd3ca8c9a
6 changed files with 89 additions and 62 deletions

View File

@@ -61,7 +61,8 @@
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = extraSpecialArgs; home-manager.extraSpecialArgs = extraSpecialArgs // { isNixOS = false; };
# home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.backupFileExtension = "bak"; home-manager.backupFileExtension = "bak";
home-manager.users.${userName} = import ./home; home-manager.users.${userName} = import ./home;
} }
@@ -150,5 +151,23 @@
# } # }
# ]; # ];
}; };
# generic non-NixOS Linux machine
homeConfigurations."generic" = let
hostname = builtins.getEnv "HOSTNAME";
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# system = "x86_64-linux";
extraSpecialArgs = extraSpecialArgs // {
isNixOS = false;
hostname = hostname;
};
modules = [
myOverlays
./modules/common/core
./home
];
};
}; };
} }

View File

@@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
isNixOS,
... ...
}: { }: {
programs.firefox = { programs.firefox = {
@@ -9,7 +10,7 @@
}; };
programs.chromium = { programs.chromium = {
enable = pkgs.stdenv.isLinux; enable = pkgs.stdenv.isLinux && isNixOS;
package = pkgs.ungoogled-chromium.override { package = pkgs.ungoogled-chromium.override {
enableWideVine = true; enableWideVine = true;
commandLineArgs = [ commandLineArgs = [

View File

@@ -1,19 +1,20 @@
{ { lib
lib, , pkgs
pkgs, , userName
userName, , userEmail
userEmail, , ghostty
ghostty, , isNixOS ? true
... , ...
}: let }:
# Have a file sturcture that holds all the configuration files that can't be configured by Nix let
# or maybe I'm too lazy to do anything about it? I dunno # Have a file structure that holds all the configuration files that can't be configured by Nix
dirs = { dirs = {
defaults = ../defaults; defaults = ../defaults;
}; };
in { in
{
# Import sub modules # Import sub modules
imports = map (module: import module {inherit lib pkgs dirs userName userEmail ghostty;}) [ imports = map (module: import module { inherit lib pkgs dirs userName userEmail ghostty isNixOS; }) [
./atuin.nix ./atuin.nix
./shell.nix ./shell.nix
./packages ./packages
@@ -22,43 +23,49 @@ in {
./eza.nix ./eza.nix
./neovim.nix ./neovim.nix
./direnv.nix ./direnv.nix
./sway.nix # ./sway.nix
./terminal.nix ./terminal.nix
./browser.nix ./browser.nix
./zellij.nix ./zellij.nix
./bat.nix ./bat.nix
./lazygit.nix ./lazygit.nix
] ++ lib.optionalattrs isNixOS [
./sway.nix
]; ];
# Home Manager needs a bit of information about you and the home = lib.mkMerge [
# paths it should manage. {
home = { username = userName;
username = userName; homeDirectory =
homeDirectory = if pkgs.stdenv.isDarwin
if pkgs.stdenv.isDarwin then "/Users/${userName}"
then "/Users/${userName}" else "/home/${userName}";
else "/home/${userName}";
sessionVariables = { stateVersion = "24.11";
XDG_CURRENT_DESKTOP = "sway"; }
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP="sway";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
NIXOS_OZONE_WL = "1";
};
pointerCursor = lib.mkIf pkgs.stdenv.isLinux { (lib.mkIf isNixOS {
gtk.enable = true; sessionVariables = {
package = pkgs.catppuccin-cursors.mochaDark; XDG_CURRENT_DESKTOP = "sway";
name = "catppuccin-mocha-dark-cursors"; XDG_SESSION_TYPE = "wayland";
size = 22; XDG_SESSION_DESKTOP = "sway";
}; XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
NIXOS_OZONE_WL = "1";
};
})
stateVersion = "24.11"; (lib.mkIf pkgs.stdenv.isLinux {
}; pointerCursor = {
gtk.enable = true;
package = pkgs.catppuccin-cursors.mochaDark;
name = "catppuccin-mocha-dark-cursors";
size = 22;
};
})
];
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;

View File

@@ -3,8 +3,6 @@
... ...
}: { }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
yazi # terminal file manager
# archives # archives
zip zip
xz xz
@@ -12,39 +10,22 @@
p7zip p7zip
# utils # utils
yazi
tmux tmux
bottom bottom
ripgrep ripgrep
jq jq
yq-go yq-go
fzf fzf
fh
aria2 aria2
yt-dlp gnupg
obsidian
vscode
weechat
inetutils inetutils
# misc # misc
cowsay
file file
which which
tree tree
gnutar gnutar
gnupg
zoxide
babelfish babelfish
# language-specific package managers
nodejs
cargo
python3
# nix specific stuff
nixd
deadnix
alejandra
statix
]; ];
} }

View File

@@ -0,0 +1,19 @@
{
pkgs,
...
}: {
home.packages = with pkgs; [
fh
obsidian
vscode
yt-dlp
weechat
nodejs
cargo
python3
nixd
deadnix
alejandra
statix
];
}

0
lib/checkSystem.nix Normal file
View File