mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
[Backport release-24.11] nixos-containers: fix enableTun option (#358484)
This commit is contained in:
commit
b3e5402d7e
@ -705,7 +705,7 @@ in
|
|||||||
allowedDevices = mkOption {
|
allowedDevices = mkOption {
|
||||||
type = with types; listOf (submodule allowedDeviceOpts);
|
type = with types; listOf (submodule allowedDeviceOpts);
|
||||||
default = [];
|
default = [];
|
||||||
example = [ { node = "/dev/net/tun"; modifier = "rw"; } ];
|
example = [ { node = "/dev/net/tun"; modifier = "rwm"; } ];
|
||||||
description = ''
|
description = ''
|
||||||
A list of device nodes to which the containers has access to.
|
A list of device nodes to which the containers has access to.
|
||||||
'';
|
'';
|
||||||
@ -835,7 +835,7 @@ in
|
|||||||
optionalAttrs cfg.enableTun
|
optionalAttrs cfg.enableTun
|
||||||
{
|
{
|
||||||
allowedDevices = cfg.allowedDevices
|
allowedDevices = cfg.allowedDevices
|
||||||
++ [ { node = "/dev/net/tun"; modifier = "rw"; } ];
|
++ [ { node = "/dev/net/tun"; modifier = "rwm"; } ];
|
||||||
additionalCapabilities = cfg.additionalCapabilities
|
additionalCapabilities = cfg.additionalCapabilities
|
||||||
++ [ "CAP_NET_ADMIN" ];
|
++ [ "CAP_NET_ADMIN" ];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user