File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ Options:
28
28
disable passing --substitute-on-destination to nix-copy
29
29
* --debug
30
30
enable debug output
31
+ * --option KEY VALUE
32
+ nix option to pass to every nix related command
31
33
USAGE
32
34
}
33
35
@@ -41,6 +43,10 @@ kexec_url="$default_kexec_url"
41
43
enable_debug=" "
42
44
maybereboot=" sleep 6 && reboot"
43
45
substitute_on_destination=" --substitute-on-destination"
46
+ nix_options=(
47
+ --extra-experimental-features ' nix-command flakes'
48
+ " --no-write-lock-file"
49
+ )
44
50
45
51
declare -A disk_encryption_keys
46
52
@@ -90,6 +96,13 @@ while [[ $# -gt 0 ]]; do
90
96
--no-reboot)
91
97
maybereboot=" "
92
98
;;
99
+ --option)
100
+ key=$2
101
+ shift
102
+ value=$2
103
+ shift
104
+ nix_options+=(" --option" " $key " " $value " )
105
+ ;;
93
106
--no-substitute-on-destination)
94
107
substitute_on_destination=" "
95
108
;;
@@ -114,25 +127,20 @@ ssh_() {
114
127
ssh -T -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no " $ssh_connection " " $@ "
115
128
}
116
129
117
- nix_options=(
118
- --extra-experimental-features ' nix-command flakes'
119
- " --no-write-lock-file"
120
- )
121
-
122
130
if [[ ${print_build_logs-n} == " y" ]]; then
123
131
nix_options+=(" -L" )
124
132
fi
125
133
126
134
nix_copy () {
127
135
NIX_SSHOPTS=' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix copy \
128
- " ${nix_options[@] } " " ${substitute_on_destination } " \
136
+ " ${substitute_on_destination } " " ${nix_options[@] } " \
129
137
" $@ "
130
138
}
131
139
nix_build () {
132
140
nix build \
133
- " ${nix_options[@]} " \
134
141
--print-out-paths \
135
142
--no-link \
143
+ " ${nix_options[@]} " \
136
144
" $@ "
137
145
}
138
146
You can’t perform that action at this time.
0 commit comments