Skip to content

Commit c2d4e8f

Browse files
committed
nixos/nixos-containers: user options take precedence over module ones
I think this is the norm in NixOS modules. This allows to start a container with '--volatile=overlay --link-journal=host' in order to persist logs across runs of a container running with a temporary root. While '--ephemeral' omits '--link-journal=try-guest', it's not possible to run an ephemeral container when linking the journal: systemd/systemd#1666
1 parent e3e32b6 commit c2d4e8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nixos/modules/virtualisation/nixos-containers.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ let
178178
exec ${config.systemd.package}/bin/systemd-nspawn \
179179
--keep-unit \
180180
-M "$INSTANCE" -D "$root" "''${extraFlags[@]}" \
181-
$EXTRA_NSPAWN_FLAGS \
182181
--notify-ready=yes \
183182
--kill-signal=SIGRTMIN+3 \
184183
--bind-ro=/nix/store:/nix/store$NIX_BIND_OPT \
@@ -203,6 +202,7 @@ let
203202
${optionalString (cfg.tmpfs != null && cfg.tmpfs != [])
204203
''--tmpfs=${concatStringsSep " --tmpfs=" cfg.tmpfs}''
205204
} \
205+
$EXTRA_NSPAWN_FLAGS \
206206
${containerInit cfg} "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/init"
207207
'';
208208

0 commit comments

Comments
 (0)