diff --git a/hosts/build01/default.nix b/hosts/build01/default.nix index 0d0fec86e..96969c478 100644 --- a/hosts/build01/default.nix +++ b/hosts/build01/default.nix @@ -1,7 +1,6 @@ { inputs, ... }: { imports = [ - inputs.self.nixosModules.builder inputs.self.nixosModules.community-builder inputs.self.nixosModules.disko-zfs inputs.srvos.nixosModules.hardware-hetzner-online-amd diff --git a/hosts/build02/default.nix b/hosts/build02/default.nix index 813beb773..acc652ffe 100644 --- a/hosts/build02/default.nix +++ b/hosts/build02/default.nix @@ -4,7 +4,6 @@ imports = [ ./nixpkgs-update-backup.nix ./nixpkgs-update.nix - inputs.self.nixosModules.builder inputs.self.nixosModules.disko-zfs inputs.self.nixosModules.nginx inputs.srvos.nixosModules.hardware-hetzner-online-amd diff --git a/hosts/build03/default.nix b/hosts/build03/default.nix index f160d04b3..5f92d6b7c 100644 --- a/hosts/build03/default.nix +++ b/hosts/build03/default.nix @@ -4,7 +4,6 @@ ./builders.nix ./postgresql.nix inputs.self.nixosModules.buildbot - inputs.self.nixosModules.builder inputs.self.nixosModules.cgroups inputs.self.nixosModules.ci-builder inputs.self.nixosModules.disko-zfs diff --git a/hosts/build04/default.nix b/hosts/build04/default.nix index 529aff8a5..fd3c7cea5 100644 --- a/hosts/build04/default.nix +++ b/hosts/build04/default.nix @@ -1,7 +1,6 @@ { inputs, ... }: { imports = [ - inputs.self.nixosModules.builder inputs.self.nixosModules.cgroups inputs.self.nixosModules.ci-builder inputs.self.nixosModules.disko-zfs diff --git a/hosts/darwin01/default.nix b/hosts/darwin01/default.nix index 7f3194a49..ccac718dc 100644 --- a/hosts/darwin01/default.nix +++ b/hosts/darwin01/default.nix @@ -2,7 +2,6 @@ { imports = [ - inputs.self.darwinModules.builder inputs.self.darwinModules.community-builder ]; diff --git a/hosts/darwin02/default.nix b/hosts/darwin02/default.nix index 8c36a956d..449607d94 100644 --- a/hosts/darwin02/default.nix +++ b/hosts/darwin02/default.nix @@ -2,7 +2,6 @@ { imports = [ - inputs.self.darwinModules.builder inputs.self.darwinModules.ci-builder inputs.self.darwinModules.hercules-ci inputs.self.darwinModules.remote-builder diff --git a/modules/darwin/builder.nix b/modules/darwin/common/builder.nix similarity index 100% rename from modules/darwin/builder.nix rename to modules/darwin/common/builder.nix diff --git a/modules/darwin/common/default.nix b/modules/darwin/common/default.nix index 650d1ee35..b956bbd67 100644 --- a/modules/darwin/common/default.nix +++ b/modules/darwin/common/default.nix @@ -4,6 +4,7 @@ ../../shared/known-hosts.nix ../../shared/nix-daemon.nix ./apfs-cleanup.nix + ./builder.nix ./network.nix ./packages.nix ./reboot.nix diff --git a/modules/nixos/builder.nix b/modules/nixos/builder.nix deleted file mode 100644 index d6e1061df..000000000 --- a/modules/nixos/builder.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - inputs, - pkgs, - ... -}: -{ - nix.gc.automatic = false; - - systemd.services.free-space = { - serviceConfig.Type = "oneshot"; - startAt = "hourly"; - path = [ - config.nix.package - pkgs.coreutils - ]; - script = builtins.readFile "${inputs.self}/modules/shared/free-space.bash"; - }; - - # Bump the open files limit so that non-root users can run NixOS VM tests - security.pam.loginLimits = [ - { - domain = "*"; - item = "nofile"; - type = "-"; - value = "20480"; - } - ]; -} diff --git a/modules/nixos/common/builder.nix b/modules/nixos/common/builder.nix new file mode 100644 index 000000000..56ddd5e56 --- /dev/null +++ b/modules/nixos/common/builder.nix @@ -0,0 +1,32 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: +{ + config = lib.mkIf (lib.hasPrefix "build" config.networking.hostName) { + nix.gc.automatic = false; + + systemd.services.free-space = { + serviceConfig.Type = "oneshot"; + startAt = "hourly"; + path = [ + config.nix.package + pkgs.coreutils + ]; + script = builtins.readFile "${inputs.self}/modules/shared/free-space.bash"; + }; + + # Bump the open files limit so that non-root users can run NixOS VM tests + security.pam.loginLimits = [ + { + domain = "*"; + item = "nofile"; + type = "-"; + value = "20480"; + } + ]; + }; +} diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix index 6a01d5ed5..095f7cd02 100644 --- a/modules/nixos/common/default.nix +++ b/modules/nixos/common/default.nix @@ -9,6 +9,7 @@ ../../shared/known-hosts.nix ../../shared/nix-daemon.nix ./agenix.nix + ./builder.nix ./security.nix ./sops-nix.nix ./telegraf.nix