From c403c10aa1ebed111ca4146e1682f675e36a23db Mon Sep 17 00:00:00 2001 From: Truxnell <9149206+truxnell@users.noreply.github.com> Date: Sun, 31 Mar 2024 09:46:10 +1100 Subject: [PATCH] fix: re-factor homemanager for garnix? --- flake.nix | 68 ++++++++----------- nixos/home/modules/shell/default.nix | 2 +- .../global.nix => truxnell/default.nix} | 5 ++ nixos/home/{profiles => truxnell}/server.nix | 0 .../{profiles => truxnell}/workstation.nix | 0 nixos/profiles/role-server.nix | 2 - nixos/profiles/role-worstation.nix | 2 - 7 files changed, 36 insertions(+), 43 deletions(-) rename nixos/home/{profiles/global.nix => truxnell/default.nix} (94%) rename nixos/home/{profiles => truxnell}/server.nix (100%) rename nixos/home/{profiles => truxnell}/workstation.nix (100%) diff --git a/flake.nix b/flake.nix index e0f186bf..874ba59c 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,16 @@ ./nixos/profiles/global.nix # all machines get a global profile ./nixos/modules/nixos # all machines get nixos modules ./nixos/hosts/${hostname} # load this host's config folder for machine-specific config + { + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { + inherit inputs hostname system; + }; + users.truxnell = ./nixos/home/truxnell; + }; + } ] , profileModules ? [ ] }: @@ -103,7 +113,7 @@ }; in - { + rec { "rickenbacker" = mkNixosConfig { # NixOS laptop (dualboot windows, dunno why i kept it) @@ -164,46 +174,28 @@ }; - homeConfigurations = { - # For servers (no gui) - server = { pkgs, lib, username, ... }: { - imports = [ - ./nixos/home/profiles/global.nix - ./nixos/home/profiles/server.nix - ./nixos/home/modules - ]; - }; - # For workstations (X11 + awesome) - desktop = { pkgs, lib, username, ... }: { - imports = [ - ./nixos/home/profiles/global.nix - ./nixos/home/profiles/workstation.nix - ./nixos/home/modules - ]; - }; + # # nix build .#images.rpi4 + # rpi4 = nixpkgs.lib.nixosSystem { + # inherit specialArgs; + + # modules = defaultModules ++ [ + # "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" + # ./nixos/hosts/images/sd-image + # ]; + # }; + # # nix build .#images.iso + # iso = nixpkgs.lib.nixosSystem { + # inherit specialArgs; + + # modules = defaultModules ++ [ + # "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" + # "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix" + # ./nixos/hosts/images/cd-dvd + # ]; + # }; - # # nix build .#images.rpi4 - # rpi4 = nixpkgs.lib.nixosSystem { - # inherit specialArgs; - - # modules = defaultModules ++ [ - # "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" - # ./nixos/hosts/images/sd-image - # ]; - # }; - # # nix build .#images.iso - # iso = nixpkgs.lib.nixosSystem { - # inherit specialArgs; - - # modules = defaultModules ++ [ - # "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" - # "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix" - # ./nixos/hosts/images/cd-dvd - # ]; - # }; - }; # simple shortcut to allow for easier referencing of correct # key for building images # > nix build .#images.rpi4 diff --git a/nixos/home/modules/shell/default.nix b/nixos/home/modules/shell/default.nix index a395ba20..32441d87 100644 --- a/nixos/home/modules/shell/default.nix +++ b/nixos/home/modules/shell/default.nix @@ -1,5 +1,5 @@ { ... }: { imports = [ - ./fish + # ./fish ]; } diff --git a/nixos/home/profiles/global.nix b/nixos/home/truxnell/default.nix similarity index 94% rename from nixos/home/profiles/global.nix rename to nixos/home/truxnell/default.nix index f83ca9f3..4c5fa089 100644 --- a/nixos/home/profiles/global.nix +++ b/nixos/home/truxnell/default.nix @@ -1,6 +1,11 @@ { lib, pkgs, self, config, ... }: with config; { + + imports = [ + ../modules + ]; + # services.gpg-agent.pinentryPackage = pkgs.pinentry-qt; systemd.user.sessionVariables = { EDITOR = "nvim"; diff --git a/nixos/home/profiles/server.nix b/nixos/home/truxnell/server.nix similarity index 100% rename from nixos/home/profiles/server.nix rename to nixos/home/truxnell/server.nix diff --git a/nixos/home/profiles/workstation.nix b/nixos/home/truxnell/workstation.nix similarity index 100% rename from nixos/home/profiles/workstation.nix rename to nixos/home/truxnell/workstation.nix diff --git a/nixos/profiles/role-server.nix b/nixos/profiles/role-server.nix index 5b3cb7d7..2faa44e1 100644 --- a/nixos/profiles/role-server.nix +++ b/nixos/profiles/role-server.nix @@ -9,8 +9,6 @@ with lib; config = { - # Link in desktop home mamanger profile - home-manager.users.truxnell = self.homeConfigurations.server; # Enable monitoring for remote scraiping mySystem.services.promMonitoring.enable = true; diff --git a/nixos/profiles/role-worstation.nix b/nixos/profiles/role-worstation.nix index a97c1f33..b1a5a086 100644 --- a/nixos/profiles/role-worstation.nix +++ b/nixos/profiles/role-worstation.nix @@ -6,8 +6,6 @@ with config; { - # Link in desktop home mamanger profile - home-manager.users.truxnell = self.homeConfigurations.desktop; mySystem = {