diff --git a/systems/aarch64-darwin/m4/default.nix b/systems/aarch64-darwin/m4/default.nix index c4f301b..9ae857c 100644 --- a/systems/aarch64-darwin/m4/default.nix +++ b/systems/aarch64-darwin/m4/default.nix @@ -4,45 +4,10 @@ with lib.metacfg; { system.defaults.dock.autohide = false; - nix.distributedBuilds = true; - - nix.buildMachines = [ - { - hostName = "m1.local"; - system = "aarch64-darwin"; - maxJobs = 4; - speedFactor = 2; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } - { - hostName = "rialo.local"; - system = "aarch64-darwin"; - maxJobs = 4; - speedFactor = 2; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } - { - hostName = "sgx.local"; - system = "x86_64-linux"; - maxJobs = 4; - speedFactor = 1; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } + imports = [ + ./../../nixbuild.nix ]; - nix.settings = { - substituters = [ - "https://cache.nixos.org" - "ssh-ng://harald@m4.local?ssh-key=/etc/ssh/nix-builder-key" - "ssh-ng://harald@rialo.local?ssh-key=/etc/ssh/nix-builder-key" - ]; - - builders-use-substitutes = true; - }; - homebrew = { enable = true; brews = [ diff --git a/systems/aarch64-darwin/rialo/default.nix b/systems/aarch64-darwin/rialo/default.nix index 0526224..f6ced4b 100644 --- a/systems/aarch64-darwin/rialo/default.nix +++ b/systems/aarch64-darwin/rialo/default.nix @@ -2,48 +2,10 @@ with lib.metacfg; { - - - nix.distributedBuilds = true; - - nix.buildMachines = [ - { - hostName = "m1.local"; - system = "aarch64-darwin"; - maxJobs = 4; - speedFactor = 2; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } - { - hostName = "rialo.local"; - system = "aarch64-darwin"; - maxJobs = 4; - speedFactor = 2; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } - { - hostName = "sgx.local"; - system = "x86_64-linux"; - maxJobs = 4; - speedFactor = 1; - sshUser = "harald"; - sshKey = "/etc/ssh/nix-builder-key"; - } + imports = [ + ./../../nixbuild.nix ]; - nix.settings = { - substituters = [ - "https://cache.nixos.org" - "ssh-ng://harald@m4.local?ssh-key=/etc/ssh/nix-builder-key" - "ssh-ng://harald@rialo.local?ssh-key=/etc/ssh/nix-builder-key" - ]; - - builders-use-substitutes = true; - }; - - homebrew = { enable = true; brews = [ diff --git a/systems/nixbuild.nix b/systems/nixbuild.nix new file mode 100644 index 0000000..c4b8c9b --- /dev/null +++ b/systems/nixbuild.nix @@ -0,0 +1,60 @@ +{ lib, pkgs, ... }: + +with lib.metacfg; +{ + nix.distributedBuilds = true; + + nix.buildMachines = [ + { + hostName = "m4"; + system = "aarch64-darwin"; + maxJobs = 4; + speedFactor = 3; + sshUser = "harald"; + sshKey = "/etc/ssh/nix-builder-key"; + } + { + hostName = "rialo"; + system = "aarch64-darwin"; + maxJobs = 4; + speedFactor = 3; + sshUser = "harald"; + sshKey = "/etc/ssh/nix-builder-key"; + } + { + hostName = "sgx"; + system = "x86_64-linux"; + maxJobs = 4; + speedFactor = 1; + sshUser = "harald"; + sshKey = "/etc/ssh/nix-builder-key"; + } + { + hostName = "sgx"; + system = "x86_64-linux"; + maxJobs = 4; + speedFactor = 1; + sshUser = "harald"; + sshKey = "/etc/ssh/nix-builder-key"; + } + { + hostName = "sgx"; + system = "x86_64-linux"; + maxJobs = 4; + speedFactor = 1; + sshUser = "harald"; + sshKey = "/etc/ssh/nix-builder-key"; + } + ]; + + nix.settings = { + substituters = [ + "https://cache.nixos.org" + "ssh-ng://harald@m4?ssh-key=/etc/ssh/nix-builder-key" + "ssh-ng://harald@rialo?ssh-key=/etc/ssh/nix-builder-key" + "ssh-ng://harald@sgx?ssh-key=/etc/ssh/nix-builder-key" + ]; + + builders-use-substitutes = true; + }; +}