6
6
7
7
* -f, --flake flake
8
8
set the flake to install the system from
9
+ * -L, --print-build-logs
10
+ print full build logs
9
11
* -s, --store-paths
10
12
set the store paths to the disko-script and nixos-system directly
11
13
if this is give, flake is not needed
@@ -44,6 +46,9 @@ while [[ $# -gt 0 ]]; do
44
46
flake=$2
45
47
shift
46
48
;;
49
+ -L | --print-build-logs)
50
+ print_build_logs=y
51
+ ;;
47
52
-s | --store-paths)
48
53
disko_script=$( readlink -f " $2 " )
49
54
nixos_system=$( readlink -f " $3 " )
@@ -63,6 +68,7 @@ while [[ $# -gt 0 ]]; do
63
68
;;
64
69
--debug)
65
70
enable_debug=" -x"
71
+ print_build_logs=y
66
72
set -x
67
73
;;
68
74
--extra-files)
@@ -100,15 +106,26 @@ timeout_ssh_() {
100
106
ssh_ () {
101
107
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no " $ssh_connection " " $@ "
102
108
}
103
- nixCopy () {
104
- NIX_SSHOPTS=' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix copy --extra-experimental-features nix-command " $@ "
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
+
119
+ nix_copy () {
120
+ NIX_SSHOPTS=' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix copy \
121
+ " ${nix_options[@]} " \
122
+ " $@ "
105
123
}
106
124
nix_build () {
107
- nix \
108
- --experimental-features flakes build \
109
- --extra-experimental-features nix-command \
110
- --no-write-lock-file \
125
+ nix build \
126
+ " ${nix_options[@]} " \
111
127
--print-out-paths \
128
+ --no-link \
112
129
" $@ "
113
130
}
114
131
216
233
ssh_ " umask 077; cat > $path " < " ${disk_encryption_keys[$path]} "
217
234
done
218
235
219
- nixCopy --to " ssh://$ssh_connection " " $disko_script "
236
+ nix_copy --to " ssh://$ssh_connection " " $disko_script "
220
237
ssh_ " $disko_script "
221
238
222
239
if [[ ${stop_after_disko-n} == " y" ]]; then
223
240
exit 0
224
241
fi
225
242
226
- nixCopy --to " ssh://$ssh_connection ?remote-store=local?root=/mnt" " $nixos_system "
243
+ nix_copy --to " ssh://$ssh_connection ?remote-store=local?root=/mnt" " $nixos_system "
227
244
if [[ -n ${extra_files:- } ]]; then
228
245
if [[ -d " $extra_files " ]]; then
229
246
extra_files=" $extra_files /"
0 commit comments