aboutsummaryrefslogtreecommitdiff
path: root/nixos/rebuild
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/rebuild')
-rwxr-xr-xnixos/rebuild23
1 files changed, 10 insertions, 13 deletions
diff --git a/nixos/rebuild b/nixos/rebuild
index 3dfbf71..7fa750a 100755
--- a/nixos/rebuild
+++ b/nixos/rebuild
@@ -11,20 +11,17 @@ if [ ! -f $configPath ]; then
exit 1
fi
-nix-eval() {
- nix-instantiate --eval --raw --read-write-mode "$@"
-}
-
-channel=$(nix-eval --argstr host "$HOSTNAME" --expr '{host}:
-let
- toml = builtins.readFile ./hosts/${host}/metadata.toml;
-in
- (builtins.fromTOML toml).channel
-')
nixpkgsPath=$(
- nix-eval \
- --argstr channel "$channel" \
- --expr '{channel}: (import ./npins).${channel}.outPath'
+ nix-instantiate --eval --raw \
+ --argstr host "$HOSTNAME" \
+ --expr '
+ { host }:
+ let
+ toml = builtins.readFile ./hosts/${host}/metadata.toml;
+ channel = (builtins.fromTOML toml).channel;
+ in
+ (import ./npins).${channel}.outPath
+ '
)
# nixos-rebuild always reads Nixpkgs from the NIX_PATH,