diff options
| author | Fuwn <[email protected]> | 2024-10-03 02:14:14 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-03 02:14:14 -0700 |
| commit | 6b51e66a04243bc24b0dba5030a8de121bcebca4 (patch) | |
| tree | 00ab61f775abf501ffb27eba8c73fef6216443e3 /hosts | |
| parent | akashi: configure home manager packages (diff) | |
| download | nixos-config-6b51e66a04243bc24b0dba5030a8de121bcebca4.tar.xz nixos-config-6b51e66a04243bc24b0dba5030a8de121bcebca4.zip | |
hosts: move hosts to unique modules
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/akashi/configuration.nix | 20 | ||||
| -rw-r--r-- | hosts/akashi/default.nix | 54 | ||||
| -rw-r--r-- | hosts/default.nix | 127 | ||||
| -rw-r--r-- | hosts/himeji/configuration.nix | 28 | ||||
| -rw-r--r-- | hosts/himeji/default.nix | 52 | ||||
| -rw-r--r-- | hosts/kansai/configuration.nix | 13 | ||||
| -rw-r--r-- | hosts/kansai/default.nix | 49 |
7 files changed, 199 insertions, 144 deletions
diff --git a/hosts/akashi/configuration.nix b/hosts/akashi/configuration.nix new file mode 100644 index 0000000..caa1543 --- /dev/null +++ b/hosts/akashi/configuration.nix @@ -0,0 +1,20 @@ +{ + self, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + "${self}/modules/core" + "${self}/modules/laptop" + "${self}/modules/options" + "${self}/modules/pc" + ]; + + config = { + modules.nix.extend = false; + system.stateVersion = "24.05"; + networking.hostName = "akashi"; + services.openssh.settings.PermitRootLogin = "yes"; + }; +} diff --git a/hosts/akashi/default.nix b/hosts/akashi/default.nix index caa1543..f3cd12a 100644 --- a/hosts/akashi/default.nix +++ b/hosts/akashi/default.nix @@ -1,20 +1,48 @@ { + lib, + inputs, + kansaiPkgs, + pcModules, self, + outputs, + secrets, ... }: { - imports = [ - ./hardware-configuration.nix - "${self}/modules/core" - "${self}/modules/laptop" - "${self}/modules/options" - "${self}/modules/pc" - ]; + flake.nixosConfigurations.akashi = + let + pkgs = + (kansaiPkgs { + nixpkgsAllowUnfree = true; + })."x86_64-linux"; + in + lib.nixosSystem { + inherit pkgs; - config = { - modules.nix.extend = false; - system.stateVersion = "24.05"; - networking.hostName = "akashi"; - services.openssh.settings.PermitRootLogin = "yes"; - }; + modules = [ + ./configuration.nix + ./hardware-configuration.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.ebisu = import "${self}/home/ebisu/core"; + + extraSpecialArgs = { + inherit inputs; + }; + }; + } + ] ++ pcModules pkgs.system; + + specialArgs = { + inherit + inputs + outputs + secrets + self + ; + }; + }; } diff --git a/hosts/default.nix b/hosts/default.nix index 6e79bad..da3667b 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -7,110 +7,41 @@ secrets, ... }: -let - defaultModules = with inputs; [ - nix-index-database.nixosModules.nix-index - sops-nix.nixosModules.sops - ]; - - pcModules = - system: - with inputs; - [ - nix-gaming.nixosModules.pipewireLowLatency - pia.nixosModules.${system}.default - ] - ++ defaultModules; -in { - flake.nixosConfigurations = with lib; { - kansai = - let - pkgs = - (kansaiPkgs { - nixpkgsAllowUnfree = true; - nixpkgsCudaSupport = true; - })."x86_64-linux"; - in - nixosSystem { - inherit pkgs; - - specialArgs = { - inherit - inputs - outputs - secrets - self - ; - }; - - modules = - with inputs; - [ - home-manager.nixosModule - nur.nixosModules.nur - chaotic.nixosModules.default - ./kansai - ] - ++ pcModules pkgs.system; - }; - - himeji = nixosSystem { - pkgs = - (kansaiPkgs - { - } - )."x86_64-linux"; - - specialArgs = { + imports = + let + defaultModules = with inputs; [ + nix-index-database.nixosModules.nix-index + sops-nix.nixosModules.sops + ]; + + pcModules = + system: + with inputs; + [ + nix-gaming.nixosModules.pipewireLowLatency + pia.nixosModules.${system}.default + ] + ++ defaultModules; + + commonInherits = { inherit + lib inputs + kansaiPkgs + self outputs secrets - self ; }; - modules = [ - ./himeji - inputs.disko.nixosModules.disko - ] ++ defaultModules; - }; - - akashi = - let - pkgs = - (kansaiPkgs { - nixpkgsAllowUnfree = true; - })."x86_64-linux"; - in - nixosSystem { - inherit pkgs; - - modules = [ - ./akashi - inputs.home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.ebisu = import "${self}/home/ebisu/core"; - - extraSpecialArgs = { - inherit inputs; - }; - }; - } - ] ++ pcModules pkgs.system; - - specialArgs = { - inherit - inputs - outputs - secrets - self - ; - }; - }; - }; + pcInherits = { + inherit pcModules; + } // commonInherits; + in + [ + (import ./akashi pcInherits) + (import ./himeji (commonInherits // { inherit defaultModules; })) + (import ./kansai pcInherits) + ]; } diff --git a/hosts/himeji/configuration.nix b/hosts/himeji/configuration.nix new file mode 100644 index 0000000..0d5fc9e --- /dev/null +++ b/hosts/himeji/configuration.nix @@ -0,0 +1,28 @@ +{ self, ... }: +{ + imports = [ + ./hardware-configuration.nix + "${self}/disks/himeji.nix" + "${self}/modules/core" + "${self}/modules/options" + "${self}/modules/server" + ]; + + config = { + networking.hostName = "himeji"; + system.stateVersion = "24.05"; + + modules = { + nix.extend = false; + + containers = { + engine = "podman"; + + extraOptions = [ + "--restart=on-failure" + "--pull=newer" + ]; + }; + }; + }; +} diff --git a/hosts/himeji/default.nix b/hosts/himeji/default.nix index 0d5fc9e..dfdf9f0 100644 --- a/hosts/himeji/default.nix +++ b/hosts/himeji/default.nix @@ -1,28 +1,34 @@ -{ self, ... }: { - imports = [ - ./hardware-configuration.nix - "${self}/disks/himeji.nix" - "${self}/modules/core" - "${self}/modules/options" - "${self}/modules/server" - ]; - - config = { - networking.hostName = "himeji"; - system.stateVersion = "24.05"; - - modules = { - nix.extend = false; - - containers = { - engine = "podman"; + lib, + inputs, + kansaiPkgs, + defaultModules, + self, + outputs, + secrets, + ... +}: +{ + flake.nixosConfigurations.himeji = lib.nixosSystem { + pkgs = + (kansaiPkgs + { + } + )."x86_64-linux"; - extraOptions = [ - "--restart=on-failure" - "--pull=newer" - ]; - }; + specialArgs = { + inherit + inputs + outputs + secrets + self + ; }; + + modules = [ + ./configuration.nix + ./hardware-configuration.nix + inputs.disko.nixosModules.disko + ] ++ defaultModules; }; } diff --git a/hosts/kansai/configuration.nix b/hosts/kansai/configuration.nix new file mode 100644 index 0000000..d4a3ff1 --- /dev/null +++ b/hosts/kansai/configuration.nix @@ -0,0 +1,13 @@ +{ self, ... }: +{ + imports = [ + ./hardware-configuration.nix + "${self}/modules/core" + "${self}/modules/desktop" + "${self}/modules/options" + "${self}/modules/pc" + ]; + + networking.hostName = "kansai"; + system.stateVersion = "24.05"; +} diff --git a/hosts/kansai/default.nix b/hosts/kansai/default.nix index d4a3ff1..c1be877 100644 --- a/hosts/kansai/default.nix +++ b/hosts/kansai/default.nix @@ -1,13 +1,42 @@ -{ self, ... }: { - imports = [ - ./hardware-configuration.nix - "${self}/modules/core" - "${self}/modules/desktop" - "${self}/modules/options" - "${self}/modules/pc" - ]; + inputs, + outputs, + secrets, + self, + kansaiPkgs, + lib, + pcModules, +}: +{ + flake.nixosConfigurations.kansai = + let + pkgs = + (kansaiPkgs { + nixpkgsAllowUnfree = true; + nixpkgsCudaSupport = true; + })."x86_64-linux"; + in + lib.nixosSystem { + inherit pkgs; + + specialArgs = { + inherit + inputs + outputs + secrets + self + ; + }; - networking.hostName = "kansai"; - system.stateVersion = "24.05"; + modules = + with inputs; + [ + home-manager.nixosModule + nur.nixosModules.nur + chaotic.nixosModules.default + ./configuration.nix + ./hardware-configuration.nix + ] + ++ pcModules pkgs.system; + }; } |