diff --git a/disko/zfs-impermanence-backup.nix b/disko/zfs-impermanence-backup.nix index 1d28f79..65fa4c6 100644 --- a/disko/zfs-impermanence-backup.nix +++ b/disko/zfs-impermanence-backup.nix @@ -19,7 +19,7 @@ }; }; swap = { - size = "2G"; + size = "4G"; content = { type = "swap"; discardPolicy = "both"; diff --git a/disko/zfs-impermanence.nix b/disko/zfs-impermanence.nix index 60a0eff..1ee6223 100644 --- a/disko/zfs-impermanence.nix +++ b/disko/zfs-impermanence.nix @@ -19,7 +19,7 @@ }; }; swap = { - size = "2G"; + size = "4G"; content = { type = "swap"; discardPolicy = "both"; diff --git a/hosts/x86_64-linux/cert-store.nix b/hosts/x86_64-linux/cert-store.nix index c87b741..12ec61c 100644 --- a/hosts/x86_64-linux/cert-store.nix +++ b/hosts/x86_64-linux/cert-store.nix @@ -11,7 +11,7 @@ certStoreServer.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/forgejo.nix b/hosts/x86_64-linux/forgejo.nix index 8c9ae10..9256023 100644 --- a/hosts/x86_64-linux/forgejo.nix +++ b/hosts/x86_64-linux/forgejo.nix @@ -11,7 +11,7 @@ forgejo.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/gaming.nix b/hosts/x86_64-linux/gaming.nix index 0b1aff9..9976df2 100644 --- a/hosts/x86_64-linux/gaming.nix +++ b/hosts/x86_64-linux/gaming.nix @@ -14,7 +14,7 @@ gamingServer.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/helium.nix b/hosts/x86_64-linux/helium.nix index 7d464e4..17a41be 100644 --- a/hosts/x86_64-linux/helium.nix +++ b/hosts/x86_64-linux/helium.nix @@ -22,7 +22,10 @@ platform.hibernate.enable = true; services = { syncthing.enable = true; - nixCacheClient.enable = true; + nixCacheClient = { + enable = true; + remoteBuilds.additional = true; + }; }; }; system.stateVersion = "23.11"; diff --git a/hosts/x86_64-linux/idacloud.nix b/hosts/x86_64-linux/idacloud.nix index 7126e43..cc7ce33 100644 --- a/hosts/x86_64-linux/idacloud.nix +++ b/hosts/x86_64-linux/idacloud.nix @@ -18,7 +18,7 @@ }; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; networking.idacloudWg.enable = true; diff --git a/hosts/x86_64-linux/lithium.nix b/hosts/x86_64-linux/lithium.nix index eb14944..2d9c293 100644 --- a/hosts/x86_64-linux/lithium.nix +++ b/hosts/x86_64-linux/lithium.nix @@ -22,7 +22,10 @@ platform.hibernate.enable = true; services = { syncthing.enable = true; - nixCacheClient.enable = true; + nixCacheClient = { + enable = true; + remoteBuilds.additional = true; + }; }; }; system.stateVersion = "24.05"; diff --git a/hosts/x86_64-linux/nextcloud.nix b/hosts/x86_64-linux/nextcloud.nix index 21ea5ec..84916a4 100644 --- a/hosts/x86_64-linux/nextcloud.nix +++ b/hosts/x86_64-linux/nextcloud.nix @@ -14,7 +14,7 @@ }; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/siit-dc.nix b/hosts/x86_64-linux/siit-dc.nix index c94fcb0..50e8a15 100644 --- a/hosts/x86_64-linux/siit-dc.nix +++ b/hosts/x86_64-linux/siit-dc.nix @@ -16,7 +16,7 @@ siit.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/syncthing.nix b/hosts/x86_64-linux/syncthing.nix index a339e0c..add05b2 100644 --- a/hosts/x86_64-linux/syncthing.nix +++ b/hosts/x86_64-linux/syncthing.nix @@ -7,7 +7,7 @@ syncthing.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/vaultwarden.nix b/hosts/x86_64-linux/vaultwarden.nix index b8f559e..0d7b9f0 100644 --- a/hosts/x86_64-linux/vaultwarden.nix +++ b/hosts/x86_64-linux/vaultwarden.nix @@ -11,7 +11,7 @@ vaultwarden.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/hosts/x86_64-linux/zfs-backup.nix b/hosts/x86_64-linux/zfs-backup.nix index 6b56ad9..8f3e7d1 100644 --- a/hosts/x86_64-linux/zfs-backup.nix +++ b/hosts/x86_64-linux/zfs-backup.nix @@ -11,7 +11,7 @@ zfsBackupServer.enable = true; nixCacheClient = { enable = true; - disableLocalBuilds = true; + remoteBuilds.exclusive = true; }; }; }; diff --git a/modules/services/nix-cache-client.nix b/modules/services/nix-cache-client.nix index 83504e8..7b2633f 100644 --- a/modules/services/nix-cache-client.nix +++ b/modules/services/nix-cache-client.nix @@ -4,13 +4,16 @@ let in { options.custom.services.nixCacheClient = { - enable = lib.mkEnableOption "Nix SSH cache client"; - disableLocalBuilds = lib.mkEnableOption "remote builds only"; + enable = lib.mkEnableOption "Nix HTTPS cache client"; + remoteBuilds = { + additional = lib.mkEnableOption "remote builds over SSH in addition to local"; + exclusive = lib.mkEnableOption "remote builds over SSH instead of local"; + }; }; config = lib.mkIf cfg.enable { nix = { - buildMachines = [ + buildMachines = lib.mkIf (cfg.remoteBuilds.additional || cfg.remoteBuilds.exclusive) [ { hostName = "cache.sinerva.eu"; maxJobs = 6; @@ -33,8 +36,10 @@ in settings = { substituters = [ "https://cache.sinerva.eu" ]; trusted-public-keys = [ "cache.sinerva.eu:TaIhyAKozO/r88EBWMSdbp+TB0YlcXT/EADunYoYLVc=" ]; - builders-use-substitutes = true; - max-jobs = lib.mkIf cfg.disableLocalBuilds 0; + builders-use-substitutes = lib.mkIf ( + cfg.remoteBuilds.additional || cfg.remoteBuilds.exclusive + ) true; + max-jobs = lib.mkIf cfg.remoteBuilds.exclusive 0; }; }; services.openssh.knownHosts."cache.sinerva.eu".publicKey =