diff options
author | tv <tv@krebsco.de> | 2015-06-24 20:10:41 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-06-24 20:11:02 +0200 |
commit | f0911ceed32144b8e98dfbd3b20ae3314d5f9190 (patch) | |
tree | adaaca4d329501aeafb20d6cec6afaf81d0bdfe1 | |
parent | 71c15ed7b6a3a6f6d970d1fbadb52625d2481737 (diff) |
s/nixos-fetch-git/fetchgit/
-rwxr-xr-x | bin/fetchgit (renamed from newbin/fetchgit) | 0 | ||||
-rwxr-xr-x | bin/new-nixos-query (renamed from newbin/nixos-query) | 0 | ||||
-rwxr-xr-x | bin/nixos-build | 13 | ||||
-rwxr-xr-x | bin/nixos-fetch-git | 32 | ||||
-rwxr-xr-x | infest-cac-CentOS-7-64bit.sh | 9 |
5 files changed, 18 insertions, 36 deletions
diff --git a/newbin/fetchgit b/bin/fetchgit index b9fe908..b9fe908 100755 --- a/newbin/fetchgit +++ b/bin/fetchgit diff --git a/newbin/nixos-query b/bin/new-nixos-query index 57761b5..57761b5 100755 --- a/newbin/nixos-query +++ b/bin/new-nixos-query diff --git a/bin/nixos-build b/bin/nixos-build index 79b0526..94f3dc1 100755 --- a/bin/nixos-build +++ b/bin/nixos-build @@ -14,7 +14,18 @@ nixos_config=$config_root/modules/$host secrets_nix=$secrets_root/$host/nix secrets_rsync=$secrets_root/$host/rsync -nixos-fetch-git "$host" +( + # Notice NIX_PATH used from host + # Notice secrets required to evaluate configuration + NIX_PATH=$NIX_PATH:nixos-config=$nixos_config + NIX_PATH=$NIX_PATH:secrets=$secrets_nix + export NIX_PATH + + rev=$(new-nixos-query nixpkgs.rev) + url=$(new-nixos-query nixpkgs.url) + + fetchgit "$rev" "$url" tmp/nixpkgs/$host +) nix-build \ -I "$nixpkgs" \ diff --git a/bin/nixos-fetch-git b/bin/nixos-fetch-git deleted file mode 100755 index 7002208..0000000 --- a/bin/nixos-fetch-git +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh -# -# nixos-fetch-git : nixos-config -> ... -# -set -euf - -host=$1 - -target=root@$host - -git_rev=$(nixos-query "$host" nixpkgs.rev) -git_url=$(nixos-query "$host" nixpkgs.url) - -worktree=$nixpkgs_root/$host - -if [ ! -d "$worktree" ]; then - mkdir -p "$worktree" -fi - -cd "$worktree" - -git init -q - -if ! current_url=$(git config remote.src.url); then - git remote add src "$git_url" -elif [ "$current_url" != "$git_url" ]; then - git remote set-url src "$git_url" -fi - -git fetch src - -git checkout "$git_rev" diff --git a/infest-cac-CentOS-7-64bit.sh b/infest-cac-CentOS-7-64bit.sh index 0f2efae..6cc3944 100755 --- a/infest-cac-CentOS-7-64bit.sh +++ b/infest-cac-CentOS-7-64bit.sh @@ -5,16 +5,19 @@ serverspec=$1 systemname=$2 ( + PATH=$PWD/bin:$PATH + export PATH + # Notice NIX_PATH used from host # Notice secrets required to evaluate configuration NIX_PATH=$NIX_PATH:nixos-config=$PWD/modules/$systemname NIX_PATH=$NIX_PATH:secrets=$PWD/secrets/$systemname/nix export NIX_PATH - rev=$(newbin/nixos-query nixpkgs.rev) - url=$(newbin/nixos-query nixpkgs.url) + rev=$(new-nixos-query nixpkgs.rev) + url=$(new-nixos-query nixpkgs.url) - newbin/fetchgit "$rev" "$url" tmp/nixpkgs/$systemname + fetchgit "$rev" "$url" tmp/nixpkgs/$systemname ) ./cac poll 10s 2>/dev/null & |