diff --git a/flake.nix b/flake.nix index 8b5b207..b4a19b9 100644 --- a/flake.nix +++ b/flake.nix @@ -54,107 +54,58 @@ }; in { - nixosConfigurations = { + nixosConfigurations = let + normalSys = name: config: nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; + }; + modules = [ + ({ config, pkgs, ... }: { + # Make "pkgs.unstable" etc. available + nixpkgs.overlays = [ pkgs-overlay ] ++ config.overlays or [ ]; + }) + + ./hosts/${name}/configuration.nix + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."felixalb" = import ./hosts/${name}/home.nix; + } + ] ++ config.modules or [ ]; + }; + in { + # Networking / VPN Gateway - burnham = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; + burnham = normalSys "burnham" { modules = [ - # Overlays-module makes "pkgs.unstable" available in configuration.nix - ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) - - ./hosts/burnham/configuration.nix ./common/domeneshop-dyndns.nix - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users."felixalb" = import ./hosts/burnham/home.nix; - } ]; }; + # Media / storage server - challenger = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; + challenger = normalSys "challenger" { modules = [ - # Overlays-module makes "pkgs.unstable" available in configuration.nix - ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) - - ./hosts/challenger/configuration.nix extra-config.nixosModules.default - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users."felixalb" = import ./hosts/challenger/home.nix; - } ]; }; + # General application server - defiant = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; + defiant = normalSys "defiant" { modules = [ - # Overlays-module makes "pkgs.unstable" available in configuration.nix - ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) - - ./hosts/defiant/configuration.nix ./common/domeneshop-dyndns.nix - sops-nix.nixosModules.sops matrix-synapse-next.nixosModules.default - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users."felixalb" = import ./hosts/defiant/home.nix; - } ]; }; + # Work desktop - felixalbpc = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; - modules = [ - # Overlays-module makes "pkgs.unstable" available in configuration.nix - ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) + felixalbpc = normalSys "felixalbpc" { }; - ./hosts/felixalbpc/configuration.nix - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users."felixalb" = import ./hosts/felixalbpc/home.nix; - } - ]; - }; # Web host - malcolm = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; - modules = [ - # Overlays-module makes "pkgs.unstable" available in configuration.nix - ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) - - ./hosts/malcolm/configuration.nix - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users."felixalb" = import ./hosts/malcolm/home.nix; - } - ]; - }; + malcolm = normalSys "malcolm" { }; }; + # Daily driver macbook darwinConfigurations.worf = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; @@ -162,14 +113,14 @@ inherit inputs; }; modules = [ - ./hosts/worf/configuration.nix ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) + + ./hosts/worf/configuration.nix home-manager.darwinModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users."felixalb" = import ./hosts/worf/home.nix; } - # sops-nix.nixosModules.sops ]; }; diff --git a/hosts/defiant/configuration.nix b/hosts/defiant/configuration.nix index 246146f..5d3cb5f 100644 --- a/hosts/defiant/configuration.nix +++ b/hosts/defiant/configuration.nix @@ -11,13 +11,13 @@ # Infrastructure ./backup.nix ./libvirt.nix + ./services/dyndns.nix ./services/nginx.nix ./services/pihole.nix ./services/postgresql.nix ./services/wireguard.nix # Services - ./services/dyndns.nix ./services/flame.nix ./services/gitea.nix ./services/hedgedoc.nix