nixdirfmt

This commit is contained in:
kat witch 2021-03-16 18:42:10 +00:00
parent f39ede8001
commit a7eb2e7a6f
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
8 changed files with 59 additions and 46 deletions

View file

@ -2,18 +2,21 @@
with pkgs.lib;
(mapAttrs (name: hosts:
''
#!${pkgs.runtimeShell}
export PATH=
nix build --no-link ${concatMapStringsSep " " (host: builtins.unsafeDiscardStringContext host.config.system.build.toplevel.drvPath) hosts}
${concatMapStrings (host: ''
echo "deploying ${host.config.networking.hostName}..."
${host.config.system.build.deployScript} $1 &
PID_LIST+=" $!"
'') hosts}
# FIXME: remove jobs from PIDLIST once they finish
trap "kill $PID_LIST" SIGINT
wait $PID_LIST
'') groups)
(mapAttrs (name: hosts: ''
#!${pkgs.runtimeShell}
export PATH=
nix build --no-link ${
concatMapStringsSep " " (host:
builtins.unsafeDiscardStringContext
host.config.system.build.toplevel.drvPath) hosts
}
${concatMapStrings (host: ''
echo "deploying ${host.config.networking.hostName}..."
${host.config.system.build.deployScript} $1 &
PID_LIST+=" $!"
'') hosts}
# FIXME: remove jobs from PIDLIST once they finish
trap "kill $PID_LIST" SIGINT
wait $PID_LIST
'') groups)
// (mapAttrs (name: host: host.config.system.build.deployScript) hosts)