flake.nix: only allow deploy scripts depending on c3d2.deployment.server

This commit is contained in:
Astro 2022-07-11 23:00:50 +02:00
parent 4d54ec26b1
commit f6ffbb4163
1 changed files with 2 additions and 2 deletions

View File

@ -272,7 +272,7 @@
#!${pkgs.runtimeShell} -ex
ssh ${target} "time nix-collect-garbage -d && time nix-store --optimise"
'';
} // lib.optionalAttrs (hostConfig ? c3d2.deployment.server) {
} // lib.optionalAttrs (builtins.elem (hostConfig.c3d2.deployment.server or null) [ "server9" "server10" ]) {
"microvm-update-${name}" = pkgs.writeScriptBin "microvm-update-${name}" ''
#!${pkgs.runtimeShell} -e
${hostConfig.system.build.copyToServer} ${self} ${secrets}
@ -296,7 +296,7 @@
systemctl restart microvm@${name}.service
END
'';
} // lib.optionalAttrs (hostConfig.c3d2.deployment.server or null == "nomad") {
"microvm-update-${name}-local" = pkgs.writeScriptBin "microvm-update-${name}" ''
#!${pkgs.runtimeShell} -e
${hostConfig.system.build.copyToServer} ${hostConfig.microvm.declaredRunner}