@@ -30,6 +30,8 @@ Options:
30
30
enable debug output
31
31
* --option KEY VALUE
32
32
nix option to pass to every nix related command
33
+ * --from store-uri
34
+ URL of the source Nix store to copy the nixos and disko closure from
33
35
USAGE
34
36
}
35
37
@@ -42,11 +44,12 @@ default_kexec_url=https://github.com/nix-community/nixos-images/releases/downloa
42
44
kexec_url=" $default_kexec_url "
43
45
enable_debug=" "
44
46
maybe_reboot=" sleep 6 && reboot"
45
- substitute_on_destination=" --substitute-on-destination"
46
47
nix_options=(
47
48
--extra-experimental-features ' nix-command flakes'
48
49
" --no-write-lock-file"
49
50
)
51
+ substitute_on_destination=y
52
+ nix_copy_options=()
50
53
51
54
declare -A disk_encryption_keys
52
55
@@ -96,6 +99,10 @@ while [[ $# -gt 0 ]]; do
96
99
--no-reboot)
97
100
maybe_reboot=" "
98
101
;;
102
+ --from)
103
+ nix_copy_options+=(" --from" " $2 " )
104
+ shift
105
+ ;;
99
106
--option)
100
107
key=$2
101
108
shift
@@ -104,7 +111,7 @@ while [[ $# -gt 0 ]]; do
104
111
nix_options+=(" --option" " $key " " $value " )
105
112
;;
106
113
--no-substitute-on-destination)
107
- substitute_on_destination=" "
114
+ substitute_on_destination=n
108
115
;;
109
116
110
117
* )
@@ -131,9 +138,14 @@ if [[ ${print_build_logs-n} == "y" ]]; then
131
138
nix_options+=(" -L" )
132
139
fi
133
140
141
+ if [[ ${substitute_on_destination-n} == " y" ]]; then
142
+ nix_copy_options+=(" --substitute-on-destination" )
143
+ fi
144
+
134
145
nix_copy () {
135
146
NIX_SSHOPTS=' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix copy \
136
- " ${substitute_on_destination} " " ${nix_options[@]} " \
147
+ " ${nix_options[@]} " \
148
+ " ${nix_copy_options[@]} " \
137
149
" $@ "
138
150
}
139
151
nix_build () {
0 commit comments