shell.nix: use host pattern

This commit is contained in:
Ingolf Wagner 2020-01-04 18:00:17 +13:00
parent 2e46b74994
commit eef85f4322
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -117,8 +117,10 @@ let
}; };
hostPattern = name: "${name}.private";
serverDeployment = name: serverDeployment = name:
{ host ? "${name}.private", user ? "root" }: { host ? (hostPattern name), user ? "root" }:
with ops; with ops;
jobs "deploy-${name}" "${user}@${host}" [ jobs "deploy-${name}" "${user}@${host}" [
(populateTmpfs (source.keys name)) (populateTmpfs (source.keys name))
@ -130,7 +132,7 @@ let
]; ];
serverPushSecrets = name: serverPushSecrets = name:
{ host ? "${name}.private", user ? "root" }: { host ? (hostPattern name), user ? "root" }:
with ops; with ops;
jobs "push-${name}" "${user}@${host}" [ jobs "push-${name}" "${user}@${host}" [
(populateTmpfs (source.keys name)) (populateTmpfs (source.keys name))
@ -138,7 +140,7 @@ let
]; ];
desktopDeployment = name: desktopDeployment = name:
{ host ? "${name}.private", target ? "/var/src/", user ? "root" { host ? (hostPattern name), target ? "/var/src/", user ? "root"
, commandPrefix ? "deploy", enableSwitch ? true }: , commandPrefix ? "deploy", enableSwitch ? true }:
with ops; with ops;
jobs "${commandPrefix}-${name}" "${user}@${host}${target}" ([ jobs "${commandPrefix}-${name}" "${user}@${host}${target}" ([
@ -152,7 +154,7 @@ let
cleanupNix = name: cleanupNix = name:
let let
target = { target = {
host = "${name}.private"; host = hostPattern name;
user = "root"; user = "root";
port = "22"; port = "22";
}; };