mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 13:15:30 +03:00
nixos/profiles/hardened: replace 'with' using inherit and add disable option
This commit is contained in:
parent
81f97de458
commit
958d1fb821
1 changed files with 97 additions and 85 deletions
|
@ -12,10 +12,21 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
with lib;
|
inherit (lib)
|
||||||
|
mkDefault
|
||||||
|
mkOverride
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
maintainers
|
||||||
|
;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
options.profiles.hardened = mkEnableOption "hardened" // {
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
|
config = mkIf config.profiles.hardened {
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = [
|
maintainers = [
|
||||||
maintainers.joachifm
|
maintainers.joachifm
|
||||||
|
@ -122,4 +133,5 @@ with lib;
|
||||||
# Ignore outgoing ICMP redirects (this is ipv4 only)
|
# Ignore outgoing ICMP redirects (this is ipv4 only)
|
||||||
boot.kernel.sysctl."net.ipv4.conf.all.send_redirects" = mkDefault false;
|
boot.kernel.sysctl."net.ipv4.conf.all.send_redirects" = mkDefault false;
|
||||||
boot.kernel.sysctl."net.ipv4.conf.default.send_redirects" = mkDefault false;
|
boot.kernel.sysctl."net.ipv4.conf.default.send_redirects" = mkDefault false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue