diff --git a/flake.nix b/flake.nix index 362176d..8702b67 100644 --- a/flake.nix +++ b/flake.nix @@ -29,26 +29,32 @@ let primaryUser = "phil"; system = "aarch64-linux"; + + mkNixosConfig = + hostName: + nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./nixos/default.nix + ./nixos/hardware.nix + ./hosts/${hostName}/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.${primaryUser} = import ./home/default.nix; + extraSpecialArgs = { inherit inputs primaryUser; }; + backupFileExtension = "backup"; + }; + } + ]; + specialArgs = { inherit inputs self primaryUser; }; + }; in { - nixosConfigurations."cyper-pi-1" = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ - ./nixos/default.nix - ./nixos/hardware.nix - ./hosts/cyper-pi-1/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.${primaryUser} = import ./home/default.nix; - extraSpecialArgs = { inherit inputs primaryUser; }; - backupFileExtension = "backup"; - }; - } - ]; - specialArgs = { inherit inputs self primaryUser; }; - }; + nixosConfigurations."cyper-pi-1" = mkNixosConfig "cyper-pi-1"; + nixosConfigurations."cyper-pi-2" = mkNixosConfig "cyper-pi-2"; }; + } diff --git a/hosts/cyper-pi-2/configuration.nix b/hosts/cyper-pi-2/configuration.nix new file mode 100644 index 0000000..3d41f41 --- /dev/null +++ b/hosts/cyper-pi-2/configuration.nix @@ -0,0 +1,25 @@ +{ + lib, + ... +}: + +{ + imports = [ + ./postgres.nix + ]; + + # Any RPi 4 specific customizations go here + networking = { + hostName = lib.mkForce "cyper-pi-2"; + # interfaces.end0.ipv4.addresses = [ + # { + # address = "192.168.2.41"; + # prefixLength = 24; + # } + # ]; + + # firewall = { + # enable = false; + # }; + }; +}