flake: place builds strictly in build/ directory

This commit is contained in:
2024-03-04 23:47:31 +00:00
parent 3544b4b132
commit dfc768e2e6

View File

@@ -280,8 +280,8 @@
fi fi
} }
nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --out-link "./result-$host" "$@" nix build ".#nixosConfigurations.$host.config.system.build.toplevel" --out-link "./build/result-$host" "$@"
storePath="$(readlink ./result-$host)" storePath="$(readlink ./build/result-$host)"
# mimic `nixos-rebuild --target-host`, in effect: # mimic `nixos-rebuild --target-host`, in effect:
# - nix-copy-closure ... # - nix-copy-closure ...
@@ -541,7 +541,7 @@
checkHost = host: let checkHost = host: let
shellHost = pkgs.lib.replaceStrings [ "-" ] [ "_" ] host; shellHost = pkgs.lib.replaceStrings [ "-" ] [ "_" ] host;
in '' in ''
nix build -v '.#nixosConfigurations.${host}.config.system.build.toplevel' --out-link ./result-${host} -j2 "$@" nix build -v '.#nixosConfigurations.${host}.config.system.build.toplevel' --out-link ./build/result-${host} -j2 "$@"
RC_${shellHost}=$? RC_${shellHost}=$?
''; '';
in builtins.toString (pkgs.writeShellScript in builtins.toString (pkgs.writeShellScript
@@ -590,7 +590,7 @@
check.rescue = { check.rescue = {
type = "app"; type = "app";
program = builtins.toString (pkgs.writeShellScript "check-rescue" '' program = builtins.toString (pkgs.writeShellScript "check-rescue" ''
nix build -v '.#imgs.rescue' --out-link ./result-rescue-img -j2 nix build -v '.#imgs.rescue' --out-link ./build/result-rescue-img -j2
''); '');
}; };