diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-12-31 13:38:01 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-12-31 21:20:20 -0500 |
| commit | 478f6b2b4bdba66f02f0d1dfa3cff17f6133beee (patch) | |
| tree | 906c18a56258f35b32ff9a4e76e15b53a1b7702f /system/hardened.nix | |
| parent | switch to sudo-rs (diff) | |
| download | dotfiles-nix-478f6b2b4bdba66f02f0d1dfa3cff17f6133beee.tar.gz dotfiles-nix-478f6b2b4bdba66f02f0d1dfa3cff17f6133beee.tar.bz2 dotfiles-nix-478f6b2b4bdba66f02f0d1dfa3cff17f6133beee.zip | |
add hardening module
Diffstat (limited to 'system/hardened.nix')
| -rw-r--r-- | system/hardened.nix | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/system/hardened.nix b/system/hardened.nix new file mode 100644 index 0000000..223b358 --- /dev/null +++ b/system/hardened.nix @@ -0,0 +1,58 @@ +{ + lib, + config, + inputs, + ... +}: let + inherit (lib) mkIf; +in { + imports = [ + inputs.nix-mineral.nixosModules.nix-mineral + ]; + + config = mkIf config.hardened { + nix-mineral = { + enable = true; + settings = { + debug = { + coredump = true; + zram = false; + }; + network = { + icmp = { + cast = true; + ignore-all = false; + }; + }; + kernel = { + cpu-mitigations = "smt-on"; + io-uring = true; + lockdown = true; + only-signed-modules = true; + pti = true; + sysrq = "none"; + }; + system = { + yama = "relaxed"; + }; + }; + extras = { + kernel = { + intelme-kmodules = false; + }; + system = { + secure-chrony = true; + unprivileged-userns = false; + }; + }; + filesystems = { + normal = { + # let me run shell scripts + # please and thank you + "/home".options.noexec = lib.mkForce false; + "/etc".options.noexec = lib.mkForce true; + }; + }; + }; + }; +} |