0xda157's home-manager and nixos config

move hosts into modules, etc

0xda157 f766e392 b2515761

+99 -134
+4 -6
flake.nix
··· 5 5 inputs: 6 6 inputs.flake-parts.lib.mkFlake { inherit inputs; } { 7 7 imports = [ 8 - # keep-sorted start prefix_order=inputs,./ 8 + # keep-sorted start 9 9 inputs.git-hooks.flakeModule 10 10 inputs.home-manager.flakeModules.home-manager 11 11 inputs.pkgs-by-name-for-flake-parts.flakeModule 12 - ./hosts/home-manager/flake-module.nix 13 - ./hosts/nixos/flake-module.nix 14 - ./lib.nix 15 - ./modules/flake-module.nix 12 + # keep-sorted end 13 + ./modules 16 14 ./templates/flake-module.nix 17 - # keep-sorted end 15 + ./lib.nix 18 16 ]; 19 17 20 18 systems = import inputs.systems;
hosts/home-manager/default.nix modules/hosts/home-manager/default.nix
-40
hosts/home-manager/flake-module.nix
··· 1 - { } 2 - # { 3 - # inputs, 4 - # self, 5 - # lib, 6 - # ... 7 - # }: 8 - # { 9 - # flake.homeConfigurations = 10 - # { 11 - # "potato@archOwO" = "x86_64-linux"; 12 - # } 13 - # |> lib.mapAttrs ( 14 - # name: system: 15 - # let 16 - # username = name |> lib.strings.splitString "@" |> lib.head; 17 - # in 18 - # inputs.home-manager.lib.homeManagerConfiguration { 19 - # pkgs = inputs.nixpkgs.legacyPackages.${system}; 20 - # modules = [ 21 - # # keep-sorted start prefix_order=inputs,self,./ 22 - # inputs.potatofox.homeModules.potatofox 23 - # inputs.sops-nix.homeManagerModules.sops 24 - # inputs.stylix.homeModules.stylix 25 - # inputs.zen-browser.homeModules.beta 26 - # self.homeModules.root 27 - # ./${name} 28 - # ./. 29 - # # keep-sorted end 30 - # ]; 31 - # extraSpecialArgs = { 32 - # inherit 33 - # inputs 34 - # lib 35 - # self 36 - # ; 37 - # }; 38 - # } 39 - # ); 40 - # }
hosts/home-manager/nixGL.nix modules/hosts/home-manager/nixGL.nix
hosts/home-manager/potato@archOwO/default.nix modules/hosts/home-manager/potato@archOwO/default.nix
hosts/nixos/dione/default.nix modules/hosts/nixos/dione/default.nix
hosts/nixos/dione/disko.nix modules/hosts/nixos/dione/disko.nix
hosts/nixos/dione/hardware.nix modules/hosts/nixos/dione/hardware.nix
+1 -1
hosts/nixos/enceladus/default.nix modules/hosts/nixos/enceladus/default.nix
··· 58 58 steam.enable = true; 59 59 }; 60 60 61 - stylix.image = ../../../media/wallpapers/pink-flower-catpuccin.png; 61 + stylix.image = ../../../../media/wallpapers/pink-flower-catpuccin.png; 62 62 63 63 home-manager.users.da157 = { 64 64 l.suites = {
hosts/nixos/enceladus/disko.nix modules/hosts/nixos/enceladus/disko.nix
hosts/nixos/enceladus/fcitx5-settings.nix modules/hosts/nixos/enceladus/fcitx5-settings.nix
hosts/nixos/enceladus/hardware.nix modules/hosts/nixos/enceladus/hardware.nix
-52
hosts/nixos/flake-module.nix
··· 1 - { 2 - inputs, 3 - lib, 4 - self, 5 - ... 6 - }: 7 - { 8 - flake.nixosConfigurations = 9 - (name: { 10 - ${name} = inputs.nixpkgs.lib.nixosSystem { 11 - modules = [ 12 - # keep-sorted start block=yes prefix_order=inputs,self,./,{ 13 - inputs.disko.nixosModules.disko 14 - inputs.home-manager.nixosModules.home-manager 15 - inputs.sops-nix.nixosModules.sops 16 - inputs.stylix.nixosModules.stylix 17 - self.nixosModules.default 18 - self.nixosModules.homelab 19 - ./${name} 20 - { 21 - home-manager = { 22 - sharedModules = [ 23 - inputs.potatofox.homeModules.potatofox 24 - inputs.sops-nix.homeManagerModules.sops 25 - inputs.zen-browser.homeModules.beta 26 - self.homeModules.default 27 - ]; 28 - users.da157 = { 29 - imports = [ self.homeModules.da157 ]; 30 - l.secrets.enable = true; 31 - }; 32 - }; 33 - } 34 - # keep-sorted end 35 - ]; 36 - specialArgs = { 37 - inherit 38 - inputs 39 - lib 40 - name 41 - self 42 - ; 43 - }; 44 - }; 45 - }) 46 - |> lib.forEach ( 47 - builtins.readDir ./. 48 - |> lib.mapAttrsToList (name: kind: lib.optional (kind == "directory") name) 49 - |> builtins.concatLists 50 - ) 51 - |> lib.mergeAttrsList; 52 - }
hosts/nixos/janus/default.nix modules/hosts/nixos/janus/default.nix
hosts/nixos/janus/disko.nix modules/hosts/nixos/janus/disko.nix
hosts/nixos/janus/hardware.nix modules/hosts/nixos/janus/hardware.nix
hosts/nixos/tethys/default.nix modules/hosts/nixos/tethys/default.nix
hosts/nixos/tethys/disko.nix modules/hosts/nixos/tethys/disko.nix
hosts/nixos/tethys/hardware.nix modules/hosts/nixos/tethys/hardware.nix
+1 -1
hosts/nixos/titan/default.nix modules/hosts/nixos/titan/default.nix
··· 43 43 steam.enable = true; 44 44 }; 45 45 46 - stylix.image = ../../../media/wallpapers/mountain-range.png; 46 + stylix.image = ../../../../media/wallpapers/mountain-range.png; 47 47 48 48 home-manager.users.da157 = { 49 49 l.suites = {
hosts/nixos/titan/disko.nix modules/hosts/nixos/titan/disko.nix
hosts/nixos/titan/hardware.nix modules/hosts/nixos/titan/hardware.nix
+29
modules/default.nix
··· 1 + { lib, self, ... }: 2 + let 3 + inherit (self.lib) loadDir; 4 + in 5 + { 6 + imports = [ 7 + ./hosts 8 + ./users 9 + ]; 10 + flake = { 11 + nixosModules = { 12 + default = { 13 + imports = loadDir ./shared ++ loadDir ./root ++ loadDir ./nixos; 14 + }; 15 + homelab = { 16 + imports = loadDir ./homelab; 17 + }; 18 + }; 19 + homeModules = rec { 20 + default = { 21 + imports = loadDir ./shared ++ loadDir ./home; 22 + }; 23 + root = lib.mkMerge [ 24 + default 25 + { imports = loadDir ./root; } 26 + ]; 27 + }; 28 + }; 29 + }
-34
modules/flake-module.nix
··· 1 - { lib, self, ... }: 2 - let 3 - inherit (self.lib) loadDir; 4 - in 5 - { 6 - flake = { 7 - nixosModules = { 8 - default = { 9 - imports = loadDir ./shared ++ loadDir ./root ++ loadDir ./nixos; 10 - }; 11 - homelab = { 12 - imports = loadDir ./homelab; 13 - }; 14 - }; 15 - homeModules = lib.mkMerge [ 16 - (rec { 17 - default = { 18 - imports = loadDir ./shared ++ loadDir ./home; 19 - }; 20 - root = lib.mkMerge [ 21 - default 22 - { imports = loadDir ./root; } 23 - ]; 24 - }) 25 - ( 26 - builtins.readDir ./users 27 - |> lib.filterAttrs (n: k: k == "directory") 28 - |> lib.mapAttrs ( 29 - path: kind: { imports = [ self.homeModules.default ] ++ self.lib.loadDir (./users + "/${path}"); } 30 - ) 31 - ) 32 - ]; 33 - }; 34 - }
+55
modules/hosts/default.nix
··· 1 + { 2 + inputs, 3 + lib, 4 + self, 5 + ... 6 + }: 7 + { 8 + flake = { 9 + homeConfigurations = { }; 10 + nixosConfigurations = 11 + (name: { 12 + ${name} = inputs.nixpkgs.lib.nixosSystem { 13 + modules = [ 14 + # keep-sorted start block=yes prefix_order=inputs,self,./,{ 15 + inputs.disko.nixosModules.disko 16 + inputs.home-manager.nixosModules.home-manager 17 + inputs.sops-nix.nixosModules.sops 18 + inputs.stylix.nixosModules.stylix 19 + self.nixosModules.default 20 + self.nixosModules.homelab 21 + ./nixos/${name} 22 + { 23 + home-manager = { 24 + sharedModules = [ 25 + inputs.potatofox.homeModules.potatofox 26 + inputs.sops-nix.homeManagerModules.sops 27 + inputs.zen-browser.homeModules.beta 28 + self.homeModules.default 29 + ]; 30 + users.da157 = { 31 + imports = [ self.homeModules.da157 ]; 32 + l.secrets.enable = true; 33 + }; 34 + }; 35 + } 36 + # keep-sorted end 37 + ]; 38 + specialArgs = { 39 + inherit 40 + inputs 41 + lib 42 + name 43 + self 44 + ; 45 + }; 46 + }; 47 + }) 48 + |> lib.forEach ( 49 + builtins.readDir ./nixos 50 + |> lib.mapAttrsToList (name: kind: lib.optional (kind == "directory") name) 51 + |> builtins.concatLists 52 + ) 53 + |> lib.mergeAttrsList; 54 + }; 55 + }
+9
modules/users/default.nix
··· 1 + { lib, self, ... }: 2 + { 3 + flake.homeModules = 4 + builtins.readDir ./. 5 + |> lib.filterAttrs (n: k: k == "directory") 6 + |> lib.mapAttrs ( 7 + path: kind: { imports = [ self.homeModules.default ] ++ self.lib.loadDir (./. + "/${path}"); } 8 + ); 9 + }