nixos/security/misc: use mkMerge for easier extension
This commit is contained in:
parent
2534dddaa9
commit
9db84f6fcd
|
@ -24,16 +24,18 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (!config.security.allowUserNamespaces) {
|
config = mkMerge [
|
||||||
# Setting the number of allowed user namespaces to 0 effectively disables
|
(mkIf (!config.security.allowUserNamespaces) {
|
||||||
# the feature at runtime. Note that root may raise the limit again
|
# Setting the number of allowed user namespaces to 0 effectively disables
|
||||||
# at any time.
|
# the feature at runtime. Note that root may raise the limit again
|
||||||
boot.kernel.sysctl."user.max_user_namespaces" = 0;
|
# at any time.
|
||||||
|
boot.kernel.sysctl."user.max_user_namespaces" = 0;
|
||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
{ assertion = config.nix.useSandbox -> config.security.allowUserNamespaces;
|
{ assertion = config.nix.useSandbox -> config.security.allowUserNamespaces;
|
||||||
message = "`nix.useSandbox = true` conflicts with `!security.allowUserNamespaces`.";
|
message = "`nix.useSandbox = true` conflicts with `!security.allowUserNamespaces`.";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue