Skip to content

Commit 4d04a9d

Browse files
committed
nixos-remote.sh: add -L/--print-build-logs flag
1 parent 4850438 commit 4d04a9d

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/nixos-remote.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Options:
66
77
* -f, --flake flake
88
set the flake to install the system from
9+
* -L, --print-build-logs
10+
print full build logs
911
* -s, --store-paths
1012
set the store paths to the disko-script and nixos-system directly
1113
if this is give, flake is not needed
@@ -44,6 +46,9 @@ while [[ $# -gt 0 ]]; do
4446
flake=$2
4547
shift
4648
;;
49+
-L | --print-build-logs)
50+
print_build_logs=y
51+
;;
4752
-s | --store-paths)
4853
disko_script=$(readlink -f "$2")
4954
nixos_system=$(readlink -f "$3")
@@ -63,6 +68,7 @@ while [[ $# -gt 0 ]]; do
6368
;;
6469
--debug)
6570
enable_debug="-x"
71+
print_build_logs=y
6672
set -x
6773
;;
6874
--extra-files)
@@ -100,15 +106,24 @@ timeout_ssh_() {
100106
ssh_() {
101107
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
102108
}
109+
110+
nix_options=(
111+
--extra-experimental-features 'nix-command flakes'
112+
"--no-write-lock-file"
113+
)
114+
115+
if [[ ${print_build_logs-n} == "y" ]]; then
116+
nix_options+=("-L")
117+
fi
118+
103119
nix_copy() {
104120
NIX_SSHOPTS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix copy \
105-
--extra-experimental-features 'nix-command flakes' \
121+
"${nix_options[@]}" \
106122
"$@"
107123
}
108124
nix_build() {
109125
nix build \
110-
--extra-experimental-features 'nix-command flakes' \
111-
--no-write-lock-file \
126+
"${nix_options[@]}" \
112127
--print-out-paths \
113128
--no-link \
114129
"$@"

0 commit comments

Comments
 (0)