Change default swap amount and update remote builder options

This commit is contained in:
Vili Sinervä 2025-07-16 12:10:38 +03:00
parent 1bbe66d61e
commit bb76509e9b
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
14 changed files with 29 additions and 18 deletions

View file

@ -19,7 +19,7 @@
};
};
swap = {
size = "2G";
size = "4G";
content = {
type = "swap";
discardPolicy = "both";

View file

@ -19,7 +19,7 @@
};
};
swap = {
size = "2G";
size = "4G";
content = {
type = "swap";
discardPolicy = "both";

View file

@ -11,7 +11,7 @@
certStoreServer.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -11,7 +11,7 @@
forgejo.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -14,7 +14,7 @@
gamingServer.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -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";

View file

@ -18,7 +18,7 @@
};
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
networking.idacloudWg.enable = true;

View file

@ -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";

View file

@ -14,7 +14,7 @@
};
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -16,7 +16,7 @@
siit.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -7,7 +7,7 @@
syncthing.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -11,7 +11,7 @@
vaultwarden.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -11,7 +11,7 @@
zfsBackupServer.enable = true;
nixCacheClient = {
enable = true;
disableLocalBuilds = true;
remoteBuilds.exclusive = true;
};
};
};

View file

@ -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 =