diff options
| author | Mel <einebeere@gmail.com> | 2024-12-03 02:53:23 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-12-03 02:53:23 +0100 |
| commit | 7515684decbd51911b399adee6bd1030115fb3cc (patch) | |
| tree | 1bb658ea20298fe357893276ddc8c54153dc7af0 /modules/nix.nix | |
| parent | 98d7b21b641dad1dedc3b9c848db8d8c379de536 (diff) | |
| download | minerals-7515684decbd51911b399adee6bd1030115fb3cc.tar.zst minerals-7515684decbd51911b399adee6bd1030115fb3cc.zip | |
Use remote builders instead of bismuth cache
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'modules/nix.nix')
| -rw-r--r-- | modules/nix.nix | 77 |
1 files changed, 55 insertions, 22 deletions
diff --git a/modules/nix.nix b/modules/nix.nix index a98ec18..13572c5 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,24 +1,10 @@ -{ me, lib, self, ... }: - -let - # NOTE: disable te bismuth cache for now, - # when bismuth is offline it still hangs, - # maybe use corsac and let bismuth write to it? - #useBismuthCache = (me != "bismuth"); - useBismuthCache = false; - - # nixos by default likes to place the default cache - # at the end, but bismuth is often offline, and the - # default cache should be preferred if it has the - # necessary derivation - mkPostfix = x: lib.mkOrder 2000 x; - - bismuthCacheSettings = { - substituters = mkPostfix [ "http://bismuth.serval-moth.ts.net:5000" ]; - trusted-public-keys = [ "bismuth-1:XW9nsNsccipbmdfchyb3YIIWNT058iSpHLwlj1xgB7A=" ]; - }; +{ + me, + lib, + self, + ... +}: -in { nix = { # add compat scripts to the environment, @@ -29,7 +15,54 @@ in ]; settings = { - experimental-features = [ "flakes" "nix-command" ]; - } // lib.optionalAttrs useBismuthCache bismuthCacheSettings; # use bismuth cache + experimental-features = [ + "flakes" + "nix-command" + ]; + trusted-users = [ + "root" + "mel" + ]; + }; + + distributedBuilds = true; + buildMachines = + let + tailnet = n: "${n}.serval-moth.ts.net"; + + defaults = { + sshUser = "mel"; + system = "x86_64-linux"; + supportedFeatures = [ + "kvm" + "big-parallel" + "nixos-test" + "benchmark" + ]; + }; + in + lib.filter (m: m.hostName != me) [ + { + hostName = tailnet "bismuth"; + maxJobs = 16; + speedFactor = 5; + publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUVQMVE4LzA3UEQ1QVhnaE03Y2Q5VWY1NFlZOHJrdUJIZmxscjFLenhoMTAgcm9vdEBiaXNtdXRoCg=="; + inherit (defaults) sshUser system supportedFeatures; + } + { + hostName = tailnet "corsac"; + maxJobs = 4; + speedFactor = 2; + publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUh4Z2hWWDBPcStlSGtsZy9lN3MvcWhDOENLOFBMVWd2cExrMkc1M3hFaksgcm9vdEBjb3JzYWMK"; + inherit (defaults) sshUser system supportedFeatures; + } + { + hostName = tailnet "renard"; + maxJobs = 6; + speedFactor = 3; + publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUovcURMNys4NiswSDZOa1BzL3c0R1lpV1F3VC80WUF4OU8ySjdzTGtLbWYgcm9vdEByZW5hcmQK"; + inherit (defaults) sshUser system supportedFeatures; + } + ]; }; } |
