diff options
Diffstat (limited to 'hosts/default.nix')
| -rw-r--r-- | hosts/default.nix | 127 |
1 files changed, 29 insertions, 98 deletions
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) + ]; } |