diff options
-rw-r--r-- | krebs/5pkgs/simple/populate/default.nix | 4 | ||||
-rw-r--r-- | shell.nix | 19 |
2 files changed, 16 insertions, 7 deletions
diff --git a/krebs/5pkgs/simple/populate/default.nix b/krebs/5pkgs/simple/populate/default.nix index 3ec432229..c2ca00590 100644 --- a/krebs/5pkgs/simple/populate/default.nix +++ b/krebs/5pkgs/simple/populate/default.nix @@ -13,12 +13,12 @@ in stdenv.mkDerivation rec { name = "populate"; - version = "1.2.0"; + version = "1.2.1"; src = fetchgit { url = http://cgit.ni.krebsco.de/populate; rev = "refs/tags/v${version}"; - sha256 = "0q3110hkkxn9bc3a63xbx1hyd1fpzz4wrck4lng3j5a9i1y1jm07"; + sha256 = "13viizpmjkqxc3d9mk2bzspgnal07bma5m9lc90mcdlk36na3pkq"; }; phases = [ @@ -6,7 +6,8 @@ let # high level commands # - # usage: deploy [--user=USER] --system=SYSTEM [--target=TARGET] + # usage: deploy [--force-populate] [--user=USER] + # --system=SYSTEM [--target=TARGET] cmds.deploy = pkgs.writeDash "cmds.deploy" '' set -efu @@ -20,7 +21,8 @@ let exec ${utils.deploy} ''; - # usage: install [--user=USER] --system=SYSTEM --target=TARGET + # usage: install [--force-populate] [--user=USER] + # --system=SYSTEM --target=TARGET cmds.install = pkgs.writeBash "cmds.install" '' set -efu @@ -61,7 +63,8 @@ let exec nixos-install ''; - # usage: test [--user=USER] --system=SYSTEM --target=TARGET + # usage: test [--force-populate] [--user=USER] + # --system=SYSTEM --target=TARGET cmds.test = pkgs.writeDash "cmds.test" /* sh */ '' set -efu @@ -142,11 +145,13 @@ let init.args = pkgs.writeText "init.args" /* sh */ '' args=$(${pkgs.utillinux}/bin/getopt -n "$command" -s sh \ -o s:t:u: \ - -l system:,target:,user: \ + -l force-populate,system:,target:,user: \ -- "$@") if \test $? != 0; then exit 1; fi eval set -- "$args" + force_populate=false; while :; do case $1 in + --force-populate) force_populate=true; shift;; -s|--system) system=$2; shift 2;; -t|--target) target=$2; shift 2;; -u|--user) user=$2; shift 2;; @@ -177,7 +182,11 @@ let source_file=$user/1systems/$system/source.nix source=$(get-source "$source_file") qualified_target=$target_user@$target_host:$target_port$target_path - echo "$source" | populate "$qualified_target" + if test "$force_populate" = true; then + echo "$source" | populate --force "$qualified_target" + else + echo "$source" | populate "$qualified_target" + fi if \test "$target_local" != true; then exec ${pkgs.openssh}/bin/ssh \ |