Change default swap amount and update remote builder options
This commit is contained in:
parent
1bbe66d61e
commit
bb76509e9b
14 changed files with 29 additions and 18 deletions
|
@ -19,7 +19,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
swap = {
|
swap = {
|
||||||
size = "2G";
|
size = "4G";
|
||||||
content = {
|
content = {
|
||||||
type = "swap";
|
type = "swap";
|
||||||
discardPolicy = "both";
|
discardPolicy = "both";
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
swap = {
|
swap = {
|
||||||
size = "2G";
|
size = "4G";
|
||||||
content = {
|
content = {
|
||||||
type = "swap";
|
type = "swap";
|
||||||
discardPolicy = "both";
|
discardPolicy = "both";
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
certStoreServer.enable = true;
|
certStoreServer.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
forgejo.enable = true;
|
forgejo.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
gamingServer.enable = true;
|
gamingServer.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
platform.hibernate.enable = true;
|
platform.hibernate.enable = true;
|
||||||
services = {
|
services = {
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
nixCacheClient.enable = true;
|
nixCacheClient = {
|
||||||
|
enable = true;
|
||||||
|
remoteBuilds.additional = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
};
|
};
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
networking.idacloudWg.enable = true;
|
networking.idacloudWg.enable = true;
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
platform.hibernate.enable = true;
|
platform.hibernate.enable = true;
|
||||||
services = {
|
services = {
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
nixCacheClient.enable = true;
|
nixCacheClient = {
|
||||||
|
enable = true;
|
||||||
|
remoteBuilds.additional = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
};
|
};
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
siit.enable = true;
|
siit.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
vaultwarden.enable = true;
|
vaultwarden.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
zfsBackupServer.enable = true;
|
zfsBackupServer.enable = true;
|
||||||
nixCacheClient = {
|
nixCacheClient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
disableLocalBuilds = true;
|
remoteBuilds.exclusive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,13 +4,16 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.services.nixCacheClient = {
|
options.custom.services.nixCacheClient = {
|
||||||
enable = lib.mkEnableOption "Nix SSH cache client";
|
enable = lib.mkEnableOption "Nix HTTPS cache client";
|
||||||
disableLocalBuilds = lib.mkEnableOption "remote builds only";
|
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 {
|
config = lib.mkIf cfg.enable {
|
||||||
nix = {
|
nix = {
|
||||||
buildMachines = [
|
buildMachines = lib.mkIf (cfg.remoteBuilds.additional || cfg.remoteBuilds.exclusive) [
|
||||||
{
|
{
|
||||||
hostName = "cache.sinerva.eu";
|
hostName = "cache.sinerva.eu";
|
||||||
maxJobs = 6;
|
maxJobs = 6;
|
||||||
|
@ -33,8 +36,10 @@ in
|
||||||
settings = {
|
settings = {
|
||||||
substituters = [ "https://cache.sinerva.eu" ];
|
substituters = [ "https://cache.sinerva.eu" ];
|
||||||
trusted-public-keys = [ "cache.sinerva.eu:TaIhyAKozO/r88EBWMSdbp+TB0YlcXT/EADunYoYLVc=" ];
|
trusted-public-keys = [ "cache.sinerva.eu:TaIhyAKozO/r88EBWMSdbp+TB0YlcXT/EADunYoYLVc=" ];
|
||||||
builders-use-substitutes = true;
|
builders-use-substitutes = lib.mkIf (
|
||||||
max-jobs = lib.mkIf cfg.disableLocalBuilds 0;
|
cfg.remoteBuilds.additional || cfg.remoteBuilds.exclusive
|
||||||
|
) true;
|
||||||
|
max-jobs = lib.mkIf cfg.remoteBuilds.exclusive 0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.openssh.knownHosts."cache.sinerva.eu".publicKey =
|
services.openssh.knownHosts."cache.sinerva.eu".publicKey =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue