mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
nixos/containers: add extraFlags option
to pass extra flags to systemd-nspawn
This commit is contained in:
parent
65e6a5081d
commit
a82aae3084
@ -575,6 +575,16 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = [ "--drop-capability=CAP_SYS_CHROOT" ];
|
||||
description = ''
|
||||
Extra flags passed to the systemd-nspawn command.
|
||||
See systemd-nspawn(1) for details.
|
||||
'';
|
||||
};
|
||||
|
||||
} // networkOptions;
|
||||
|
||||
config = mkMerge
|
||||
@ -714,7 +724,9 @@ in
|
||||
${optionalString cfg.autoStart ''
|
||||
AUTO_START=1
|
||||
''}
|
||||
EXTRA_NSPAWN_FLAGS="${mkBindFlags cfg.bindMounts}"
|
||||
EXTRA_NSPAWN_FLAGS="${mkBindFlags cfg.bindMounts +
|
||||
optionalString (cfg.extraFlags != [])
|
||||
(" " + concatStringsSep " " cfg.extraFlags)}"
|
||||
'';
|
||||
}) config.containers;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user