summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/fetchgit (renamed from newbin/fetchgit)0
-rwxr-xr-xbin/new-nixos-query (renamed from newbin/nixos-query)0
-rwxr-xr-xbin/nixos-build13
-rwxr-xr-xbin/nixos-fetch-git32
-rwxr-xr-xinfest-cac-CentOS-7-64bit.sh9
5 files changed, 18 insertions, 36 deletions
diff --git a/newbin/fetchgit b/bin/fetchgit
index b9fe90854..b9fe90854 100755
--- a/newbin/fetchgit
+++ b/bin/fetchgit
diff --git a/newbin/nixos-query b/bin/new-nixos-query
index 57761b520..57761b520 100755
--- a/newbin/nixos-query
+++ b/bin/new-nixos-query
diff --git a/bin/nixos-build b/bin/nixos-build
index 79b052654..94f3dc1f4 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 7002208b5..000000000
--- 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 0f2efae6b..6cc39440a 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 &