From 81077feb6fd09fefb8bd6ddef2d0d9f18efa5cb3 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 8 Apr 2024 20:11:45 +0200 Subject: [PATCH] Make the test-build script easier to work with --- scripts/test-build | 6 ++---- shell.nix | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/test-build b/scripts/test-build index a050d35..d816cba 100755 --- a/scripts/test-build +++ b/scripts/test-build @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -e -cd /home/andreas/.nixos - -hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs)) +hosts=($(echo $(nix eval "$DEVENV_ROOT"#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs)) skip=( "desktop-vm" "gwyn" @@ -18,7 +16,7 @@ for host in "${hosts[@]}"; do continue fi echo $host - nixos-rebuild dry-build --flake .#${host} + nixos-rebuild dry-build --flake $DEVENV_ROOT#${host} echo echo done diff --git a/shell.nix b/shell.nix index 5c0e663..2d55736 100644 --- a/shell.nix +++ b/shell.nix @@ -19,5 +19,6 @@ pkgs.mkShell { PATH=${pkgs.writeShellScriptBin "nix" '' ${pkgs.nixFlakes}/bin/nix --experimental-features "nix-command flakes" "$@" ''}/bin:$PATH + export DEVENV_ROOT=$(pwd) ''; }