nix-mineral Options

nix-mineral.enable Link copied!

Type: boolean

Whether to enable the nix-mineral module.

Default: false
Example: true

nix-mineral.extras Link copied!

Type: submodule

Extra options that are not part of the main configuration.

Default: { }

nix-mineral.extras.entropy Link copied!

Type: submodule

Modify entropy settings for improved security

Default: { }

nix-mineral.extras.entropy.extra-latent-entropy Link copied!

Type: boolean

Gather more entropy on boot.

Note

Only works with the linux_hardened patchset, which is currently ill advised due to inconsistent updates in nixpkgs. This does nothing if using another kernel. Also slows down boot time by a bit.

Default: false
Example: true

nix-mineral.extras.kernel Link copied!

Type: submodule

Extra settings to harden the linux kernel.

Default: { }

nix-mineral.extras.kernel.intelme-kmodules Link copied!

Type: boolean

Intel ME related kernel modules.

Disable this to avoid putting trust in the highly privilege ME system, but there are potentially other consequences.

Tip

If you use an AMD system, you can disable this without negative consequence and reduce attack surface.

Default: true
Example: false

nix-mineral.extras.kernel.load-kernel-modules Link copied!

Type: boolean

Allow loading of kernel modules not only at boot via kernel commandline.

Warning

If false, very likely to cause breakage unless you can compile a list of every module you need and add that to your boot parameters manually.

Default: true
Example: false

nix-mineral.extras.kernel.warn-panic Link copied!

Type: boolean

Be extra paranoid of potential kernel exploitation by inducing kernel panics on kernel warns and above.

Warning

This will cause massive instability in the event of any bugs in the kernel.

Default: false
Example: true

nix-mineral.extras.misc Link copied!

Type: submodule

Extra misc settings.

Most of those are relatively opinionated additional software.

Default: { }

nix-mineral.extras.misc.apparmor Link copied!

Type: boolean

Use an opinionated AppArmor configuration.

Note

This is currently absolutely useless except for compliance, because there are no currently functioning AppArmor profiles! This option exists only for reference sake, once AppArmor is properly fixed to work on NixOS.

Default: false
Example: true

nix-mineral.extras.misc.doas-sudo-wrapper Link copied!

Type: boolean

Creates a wrapper for doas to simulate sudo, with nano to utilize rnano as editor for editing as root.

Default: false
Example: true

nix-mineral.extras.misc.replace-sudo-with-doas Link copied!

Type: boolean

Replace sudo with doas.

doas has a lower attack surface, but is less audited.

Default: false
Example: true

nix-mineral.extras.misc.ssh-hardening Link copied!

Type: boolean

Use an opinionated SSH hardening config. Complies with ssh-audit.

Read what everything does first, or else you might get locked out.

This, for example, prevents root login AND password based login.

Default: false
Example: true

nix-mineral.extras.misc.usbguard.enable Link copied!

Type: boolean

Enable USBGuard, a tool to restrict USB devices.

disable to avoid hassle with handling USB devices at all.

Default: false
Example: true

nix-mineral.extras.misc.usbguard.gnome-integration Link copied!

Type: boolean

Enable USBGuard dbus daemon and add polkit rules to integrate USBGuard with GNOME Shell.

If you use GNOME, this means that USBGuard automatically allows all newly connected devices while unlocked, and blacklists all newly connected devices while locked. This is obviously very convenient, and is similar behavior to handling USB as ChromeOS and GrapheneOS.

Default: false
Example: true

nix-mineral.extras.misc.usbguard.whitelist-at-boot Link copied!

Type: boolean

Automatically allow all connected devices at boot in USBGuard.

If false, USB devices will be blocked until USBGuard is configured.

Note

For laptop users, inbuilt speakers and bluetooth cards may be disabled by USBGuard by default, so whitelisting them manually or enabling this may solve that.

Default: false
Example: true

nix-mineral.extras.network Link copied!

Type: submodule

Extra settings for the network.

Default: { }

nix-mineral.extras.network.bluetooth-kmodules Link copied!

Type: boolean

Enable bluetooth related kernel modules.

Default: true
Example: false

nix-mineral.extras.network.tcp-window-scaling Link copied!

Type: boolean

Disable TCP window scaling.

Warning

If false, may help mitigate TCP reset DoS attacks, but may also harm network performance when at high latencies.

Default: true
Example: false

nix-mineral.extras.system Link copied!

Type: submodule

Extra settings for the system.

Default: { }

nix-mineral.extras.system.hardened-malloc Link copied!

Type: boolean

Use hardened-malloc as default memory allocator for all processes.

Warning

DO NOT USE THIS OPTION ON ANY PRODUCTION SYSTEM! FOR TESTING PURPOSES ONLY!

Default: false
Example: true

nix-mineral.extras.system.lock-root Link copied!

Type: boolean

Lock the root account.

Note

Requires another method of privilege escalation, i.e sudo or doas, and declarative accounts to work properly.

Default: false
Example: true

nix-mineral.extras.system.minimize-swapping Link copied!

Type: boolean

Reduce swappiness to bare minimum.

May reduce risk of writing sensitive information to disk, but hampers zram performance. Also useless if you do not even use a swap file/partition, i.e zram only setup.

Default: false
Example: true

nix-mineral.extras.system.secure-chrony Link copied!

Type: boolean

Replace systemd-timesyncd with chrony for NTP, and configure chrony for NTS and to use the seccomp filter for security.

Default: false
Example: true

nix-mineral.extras.system.unprivileged-userns Link copied!

Type: boolean

Enable or disable unprivileged user namespaces.

It has been the cause of many privilege escalation vulnerabilities, but can cause breakage. If false, this may break some applications that rely on user namespaces.

Note

It is left enabled by default now because the benefits of rootless sandboxing in Chromium, unprivileged containers, and bubblewrap among many other applications, combined with the increased maturity of unprivileged namespaces as of Oct 2025.

Default: true
Example: false

nix-mineral.extras.system.zram Link copied!

Type: boolean

Enable zram so that memory is more likely to be compressed instead of written to disk, which may include sensitive information.

Improves storage lifespan and overall performance when swapping as a side effect.

Note

Not enabled by default due to interfering with zswap. Additionally, the task of limiting swapping of sensitive data depends highly on the user's individual swapping setup which can't be reliably inferred.

Default: true
Example: false

nix-mineral.extras.tmpfiles Link copied!

Type: submodule

Use systemd-tmpfiles to restrict file permissions in various folders.

Default: { }

nix-mineral.extras.tmpfiles.etc-nixos Link copied!

Type: boolean

Set to true to recursively make all files in /etc/nixos owned and readable only by root.

/etc/nixos is not owned by root by default, which can be hazardous as files that are included in the rebuild may be editable by unprivileged users.

Note

This may have unintended side effects if user state is intentionally stored in /etc/nixos, and is therefore no longer enabled by default.

Default: false
Example: true

nix-mineral.extras.tmpfiles.home Link copied!

Type: boolean

Set to true to recursively restrict permissions of /home/$USER so that only the owner of the directory can access it (the user).

Note

This is not retroactively applied. The "~" option means this only applies to newly created files, not existing files. Consider setting manually if this is a priority, but this may have side effects like obliterating existing executable access mask bits.

Warning

This may also have unintended side effects, e.g, root owned files being unreadable if somehow created in a user home directory.

Warning

This may cause recursion/boot speed problems. See:

Default: false
Example: true

nix-mineral.filesystems Link copied!

Type: submodule

Utility for hardening filesystems and special filesystems.

Default: { }

nix-mineral.filesystems.enable Link copied!

Type: boolean

Enable the filesystem hardening utility from nix-mineral.

Default: true
Example: false

nix-mineral.filesystems.normal Link copied!

Type: attribute set of (submodule)

Filesystem hardening.

Sets the device option as <name>, and the options: "bind", "nosuid", "noexec", "nodev" by default.

Warning

The default filesystem hardening settings make necessary assumptions about partition layout. That is, that / is one partition, and /boot or /boot/EFI is another partition.

If using a more exotic partition layout, you may need to account for this and adjust nix-mineral.filesystems.normal.$/foo/bar/.options."bind" accordingly, or face potential evaluation issues.

Bind mounts are necessary when a directory is on a shared partition.

Bind mounts must be EXPLICITLY DISABLED when a directory gets its own, dedicated partition.

See: https://github.com/cynicsketch/nix-mineral/issues/11

Default: { }

nix-mineral.filesystems.normal.<name>.device Link copied!

Type: null or string

Location of the device.

Default: "‹name›"
Example: "/dev/sda"

nix-mineral.filesystems.normal.<name>.enable Link copied!

Type: boolean

Whether to enable the filesystem mount.

Default: false
Example: true

nix-mineral.filesystems.normal.<name>.options Link copied!

Type: attribute set of (boolean or signed integer or string)

Options used to mount the file system.

If the value is false, the option is disabled.

If the value is an integer or a string, it is passed as "name=value".

Default: { bind = true; nodev = true; noexec = true; nosuid = true; }
Example:
{
  bind = false;
  nodev = false;
  noexec = false;
  nosuid = false;
}

nix-mineral.filesystems.special Link copied!

Type: attribute set of (submodule)

Special Filesystem hardening.

Sets the option "noexec" by default.

Default: { }

nix-mineral.filesystems.special.<name>.device Link copied!

Type: null or string

Location of the device.

Default: null
Example: "/dev/sda"

nix-mineral.filesystems.special.<name>.enable Link copied!

Type: boolean

Whether to enable the filesystem mount.

Default: false
Example: true

nix-mineral.filesystems.special.<name>.options Link copied!

Type: attribute set of (boolean or signed integer or string)

Options used to mount the file system.

If the value is false, the option is disabled.

If the value is an integer or a string, it is passed as "name=value".

Default: { noexec = true; }
Example:
{
  hidepid = 4;
  noexec = false;
}

nix-mineral.preset Link copied!

Type: one of "default", "compatibility", "maximum", "performance" or list of (one of "default", "compatibility", "maximum", "performance")

The preset (or presets) to use for the nix-mineral module. (all presets are applied on top of the default preset)

To select multiple presets, provide a list of preset names. The order of presets matters, the top ones will have more priority.

  • default: only default settings.
  • compatibility: disables or enables settings to aim at compatibility.
  • maximum: enables every optional security setting to have maximum protection.
  • performance: disables or enables settings to aim at performance.
Default: "default"
Example:
[
  "performance"
  "compatibility"
]

nix-mineral.settings Link copied!

Type: submodule

nix-mineral settings.

Default: { }

nix-mineral.settings.debug Link copied!

Type: submodule

Limit various debugging information to reduce info available to potential attackers.

Default: { }

nix-mineral.settings.debug.coredump Link copied!

Type: boolean

Enable core dumps everywhere.

Core dumps contain a programs memory, usually after a crash, which could include sensitive information including encryption keys being written to the disk without any protection.

If false, this disables core dumps using a combination of sysctl, PAM, and systemd. These are grouped together, because the disablement of any individual one of these might otherwise make available a bypass.

Note

You might need core dumps when debugging crashing programs.

Default: false
Example: true

nix-mineral.settings.debug.debugfs Link copied!

Type: boolean

Enable/disable the Linux debugfs, which exposes a lot of possibly sensitive information.

Default: false
Example: true

nix-mineral.settings.debug.dmesg-restrict Link copied!

Type: boolean

Only allow users with root privileges or CAP_SYSLOG to use dmesg.

Default: true
Example: false

nix-mineral.settings.debug.efipstore Link copied!

Type: boolean

If set to false, Disable both the EFI persistent storage feature and Error Record Serialization Table (ERST) support as a form of defense-in-depth.

This prevents the kernel from writing crash logs and other persistent data to the storage backend.

Default: false
Example: true

nix-mineral.settings.debug.kptr-restrict Link copied!

Type: boolean

Display all kernel pointers as 0s regardless of user privileges when printed.

This may interfere with specific diagnostic and performance profiling tools.

Default: true
Example: false

nix-mineral.settings.debug.panic-reboot Link copied!

Type: boolean

Force the system to automatically reboot upon kernel panic instead of freezing.

This helps to mitigate denial of service attacks by automatically recovering and preventing the capture of information presented by a kernel panic screen.

This may inhibit debugging kernel panics, since the immediate reboot prevents immediate analysis of error messages which may be displayed.

Default: true
Example: false

nix-mineral.settings.debug.quiet-boot Link copied!

Type: boolean

If set to true, minimize information displayed during boot to reduce information available to an attacker.

Default: true
Example: false

nix-mineral.settings.debug.restrict-printk Link copied!

Type: boolean

Supress kernel messages via printk to only display log level 3 (error) messages or higher, e.g, more severe warnings.

This limits access to debugging information which can be used by an attacker.

Default: true
Example: false

nix-mineral.settings.entropy Link copied!

Type: submodule

Settings for entropy sources.

Default: { }

nix-mineral.settings.entropy.aslr Link copied!

Type: boolean

Turn on protection and randomize stack, vdso page and mmap + randomize brk base address.

Default: true
Example: false

nix-mineral.settings.entropy.aslr-max-bits Link copied!

Type: boolean

Use the maximum number of bits of entropy to address space layout randomization, a widely used mitigation against memory exploits.

Note

The values used here are currently only valid for x86_64.

Other CPU architectures may require different numbers here, consult upstream documentation as necessary.

Default: true
Example: false

nix-mineral.settings.entropy.hwrng Link copied!

Type: boolean

Disable trusting both the CPU's hardware random number generator and any entropy seed passed to the bootloader. We assume the hardware random number generation could be flawed.

Default: false
Example: true

nix-mineral.settings.entropy.jitterentropy Link copied!

Type: boolean

Enable jitterentropy with both the daemon and the kernel module to provide additional entropy and compensate for disabled hardware entropy sources.

Default: true
Example: false

nix-mineral.settings.etc Link copied!

Type: submodule

Modify files in /etc to limit attack surface.

Default: { }

nix-mineral.settings.etc.generic-machine-id Link copied!

Type: boolean

Set machine-id to the Kicksecure machine-id, for privacy reasons.

Warning

This may have unintended consequences if machine-id needs to be unique, e.g for log collection or VM management.

Default: true
Example: false

nix-mineral.settings.etc.kicksecure-bluetooth Link copied!

Type: boolean

Borrow Kicksecure bluetooth configuration for better bluetooth privacy and security.

Disables bluetooth automatically when not connected to any device.

Default: true
Example: false

nix-mineral.settings.etc.kicksecure-gitconfig Link copied!

Type: boolean

Borrow Kicksecure gitconfig, disabling git symlinks and enabling fsck by default for better git security.

Default: true
Example: false

nix-mineral.settings.etc.kicksecure-issue Link copied!

Type: boolean

Borrow Kicksecure banner/issue.

Provides NO exploit resistance whatsoever, only serves as a deterrent to unauthorized access and to comply with Lynis.

There are no assurances that anything stated here is legally valid.

Default: true
Example: false

nix-mineral.settings.etc.kicksecure-module-blacklist Link copied!

Type: boolean

Borrow Kicksecure module blacklist.

"install "foobar" /bin/false" prevents the module from being loaded at all. "blacklist "foobar"" prevents the module from being loaded automatically at boot, but it can still be loaded afterwards.

Because the "install /bin/false" method does not register as a regular blacklist, this might cause issues with kernel module auditing e.g using Lynis. If so, you'll need to generate a whitelist.

Warning

This may have unintended consequences if you require specific drivers, and may cause breakage.

Default: true
Example: false

nix-mineral.settings.etc.no-root-securetty Link copied!

Type: boolean

Use an empty /etc/securetty to prevent root login on tty.

Warning

If set to true, logging in as the root user will fail and throw an error: "Login incorrect"

Default: true
Example: false

nix-mineral.settings.kernel Link copied!

Type: submodule

Settings meant to harden the linux kernel.

Default: { }

nix-mineral.settings.kernel.amd-iommu-force-isolation Link copied!

Type: boolean

Set amd_iommu=force_isolation kernel parameter.

If you're not using an AMD CPU, this does nothing and can be safely ignored.

Warning

You may need to set this to false as a workaround for a boot hanging issue on Linux kernel 6.13.

Default: true
Example: false

nix-mineral.settings.kernel.bdev-write-mount Link copied!

Type: boolean

If set to false, prevent runaway privileged processes from writing to block devices to protect against runaway privileged processes causing filesystem corruption and kernel crashes.

Default: false
Example: true

nix-mineral.settings.kernel.binfmt-misc Link copied!

Type: boolean

Enable binfmt_misc.

Warning

If false, breaks Roseta, among other applications.

Default: false
Example: true

nix-mineral.settings.kernel.busmaster-bit Link copied!

Type: boolean

Enable busmaster bit at boot, which may prevent some DMA attacks.

Warning

If false, this may prevent systems with low resource OR specific firmware configurations from booting.

May worsen performance as a side effect. https://en.wikipedia.org/wiki/Bus_mastering

Default: false
Example: true

nix-mineral.settings.kernel.core-pid Link copied!

Type: boolean

Including PID in core dumps if those are reenabled, otherwise, this does nothing.

If hideproc is enabled, this prevents some substitution attacks designed obtain sensitive information by predicting PIDs and inducing core dumps.

Otherwise, this is still nice to have for forensic purposes/log analysis, so that sources of core dumps are more obvious.

Default: true
Example: false

nix-mineral.settings.kernel.cpu-mitigations Link copied!

Type: one of "smt-off", "smt-on", "off"

Apply relevant CPU exploit mitigations, May harm performance.

  • smt-off: Enable CPU mitigations and disables symmetric multithreading.
  • smt-on: Enable symmetric multithreading and just use default CPU mitigations, to potentially improve performance.
  • off: Disables all CPU mitigations. May improve performance further, but is even more dangerous!

Warning

Turning all CPU mitigations off completely is a TERRIBLE idea. Even the most robustly sandboxed and restricted code in the world can instantly rootkit your computer. One web page is all it takes for all your keys to be someone else's: https://leaky.page/

Default: "smt-off"

nix-mineral.settings.kernel.harden-bpf Link copied!

Type: boolean

Harden eBPF against JIT spraying attacks, to reduce the risk of abuse because eBPF allows executing potentially dangerous code in the kernel.

Default: true
Example: false

nix-mineral.settings.kernel.intel-iommu Link copied!

Type: boolean

Explicitly enable intel IOMMU to reduce risk of DMA attacks and other memory abuse.

Note

Does nothing if you don't use an intel processor.

Default: true
Example: false

nix-mineral.settings.kernel.io-uring Link copied!

Type: boolean

Enable io_uring, is the cause of many vulnerabilities, and is disabled on Android + ChromeOS.

This may be desired for specific environments concerning Proxmox.

Default: false
Example: true

nix-mineral.settings.kernel.iommu-passthrough Link copied!

Type: boolean

Enable or disable bypassing the IOMMU for direct memory access.

Could increase I/O performance on ARM64 systems, with risk.

If false, forces DMA to go through IOMMU to mitigate some DMA attacks.

Default: false
Example: true

nix-mineral.settings.kernel.kcfi Link copied!

Type: boolean

If set to true, switch (back) to using kCFI as the default Control Flow Integrity (CFI) implementation as kCFI mandates hash validation at the source making it more difficult to bypass.

This is in contrast to FineIBT which was made the default in kernel 6.2 due to its performance benefits as it only performs hash checks at the destinations.

Default: true
Example: false

nix-mineral.settings.kernel.kexec Link copied!

Type: boolean

Prevent replacing the running kernel with kexec for security reasons.

On other distributions, kexec is most notably used for updating the Linux kernel without rebooting, however, NixOS does not support this.

A comprehensive list of usecases is not feasible, but consider consulting the following references as well as upstream documentation where necessary:

Default: false
Example: true

nix-mineral.settings.kernel.kfence Link copied!

Type: boolean

If set to true, enable the kernel "Electric-Fence" sampling-based memory safety error to detect heap out-of-bounds access, use-after-free, and invalid-free errors.

Default: true
Example: false

nix-mineral.settings.kernel.lockdown Link copied!

Type: boolean

Enable linux kernel lockdown, this blocks loading of unsigned kernel modules and breaks hibernation.

Note

If false, you probably want to disable nix-mineral.settings.kernel.only-signed-modules.

Default: true
Example: false

nix-mineral.settings.kernel.only-signed-modules Link copied!

Type: boolean

Requires all kernel modules to be signed. This prevents out-of-tree kernel modules from working unless signed.

Note

If false, nix-mineral.settings.kernel.lockdown must also be false.

Default: true
Example: false

nix-mineral.settings.kernel.oops-panic Link copied!

Type: boolean

Intentionally induce kernel panics on "oops" errors and above, to limit the extent of certain exploits which trigger kernel oopses.

Warning

This might cause stability issues with certain poorly written drivers that aren't malicious. If you experience random kernel panics, consider disabling this.

Default: true
Example: false

nix-mineral.settings.kernel.page-alloc-shuffle Link copied!

Type: boolean

Make page allocations less predicatable by randomizing freelists.

Tip

This is one of the few things which IMPROVES performance as a side effect, and there's usually no reason to disable this.

Default: true
Example: false

nix-mineral.settings.kernel.perf-subsystem.restrict-access Link copied!

Type: boolean

Restrict perf subsystem access to reduce attack surface.

Default: true
Example: false

nix-mineral.settings.kernel.perf-subsystem.restrict-usage Link copied!

Type: boolean

Restrict perf subsystem usage (activity) to reduce attack surface.

Default: true
Example: false

nix-mineral.settings.kernel.pti Link copied!

Type: boolean

Enable Page Table Isolation (PTI) to mitigate some KASLR bypasses and the Meltdown CPU vulnerability. It may also tax performance.

Default: true
Example: false

nix-mineral.settings.kernel.randomize-kstack-offset Link copied!

Type: boolean

Randomize the kernel's stack offset on every syscall, to make attacks relying on predicting the location of the kernel's stack more difficult.

Default: true
Example: false

nix-mineral.settings.kernel.restrict-bpf Link copied!

Type: boolean

Restrict eBPF to CAP_BPF in order to prevent abuse by unprivileged users.

Default: true
Example: false

nix-mineral.settings.kernel.restrict-line-disciplines Link copied!

Type: boolean

Restrict TTY line discipline loading to CAP_SYS_MODULE to prevent unprivileged users from loading insecure line disciplines.

Default: true
Example: false

nix-mineral.settings.kernel.slab-debug Link copied!

Type: boolean

Set to true to modify the "slab_debug" boot parameter to enable red zoning and sanity checks to detect memory corruption.

Adds significant overhead to memory allocation.

Warning

Because this is a debugging option, it will disable kernel pointer hashing and leak kernel memory addresses to root unless the "hash_pointers=always" parameter is used, which is only supported on kernel version 6.17 and above. Otherwise, "hash_pointers" is silently ignored.

Default: true
Example: false

nix-mineral.settings.kernel.slab-merging Link copied!

Type: boolean

Set to false to disable slab merging to make it harder to influence the slab cache layout and compartmentalize the damage of certain memory attacks by limiting influence to individual caches.

Default: false
Example: true

nix-mineral.settings.kernel.strict-iommu Link copied!

Type: boolean

Enable and force the IOMMU to be used to reduce the risk of DMA attacks, and strictly invalidate TLBs to prevent abuse of stale data.

Default: true
Example: false

nix-mineral.settings.kernel.sysrq Link copied!

Type: one of "none", "off", "sak"

Control the magic SysRq key functionality of the Linux kernel.

It is a 'magical' key combo you can hit which the kernel will respond to regardless of whatever else it is doing, unless it is completely locked up.

  • none: Keep the default configuration of your kernel.
  • off: Disables sysrq completely.
  • sak: Enable SAK (Secure Attention Key).
Default: "off"

nix-mineral.settings.kernel.tiocsti Link copied!

Type: boolean

If false, disable TIOCSTI because it's used to inject arbitrary characters and potentially lead to privilege escalation.

Already disabled by default on modern (>=6.2) Linux kernel versions, but included for future reference.

May break outdated screen readers relying on legacy functionality, but because of the above reasoning, this will never be considered for the compatibility preset.

Default: false
Example: true

nix-mineral.settings.kernel.unprivileged-userfaultfd Link copied!

Type: boolean

If set to false, limit access to userfaultfd() syscall to the CAP_SYS_PTRACE capability.

userfaultfd has been used for use-after-free exploits in the past.

Default: false
Example: true

nix-mineral.settings.kernel.vdso32 Link copied!

Type: boolean

If set to false, disable 32-bit Virtual Dynamic Shared Object (vDSO) mappings as these are a legacy compatibility feature for superseded glibc versions.

Default: false
Example: true

nix-mineral.settings.kernel.vsyscall Link copied!

Type: boolean

If set to false, Disable vsyscalls, which are obsolete and create static memory locations that are easy to exploit.

Default: false
Example: true

nix-mineral.settings.kernel.zero-alloc Link copied!

Type: boolean
Default: true
Example: false

nix-mineral.settings.misc Link copied!

Type: submodule

Configure miscellaneous settings, usually additional software.

Default: { }

nix-mineral.settings.misc.bootloader-editor Link copied!

Type: boolean

Set to false to disable bootloader editors, to prevent access to the root shell or otherwise weakening security by tampering with boot parameters.

Note

This currently does nothing if you don't use systemd-boot.

Consider filing a PR if/when similar configuration for other bootloaders can be added unobtrusively.

Default: false
Example: true

nix-mineral.settings.misc.dnssec Link copied!

Type: boolean

Make DNS connections fail if not using a DNS server supporting DNSSEC.

Note

Currently does nothing if you don't use systemd-resolved.

Consider filing a PR if/when similar configuration for other DNS resolving software can be added unobtrusively.

Default: true
Example: false

nix-mineral.settings.misc.nix-wheel Link copied!

Type: boolean

Limit access to nix commands to users with the "wheel" group ("sudoers").

If false, may be useful for allowing a non-wheel user to, for example, use devshell.

Default: true
Example: false

nix-mineral.settings.network Link copied!

Type: submodule

Settings for the network.

Default: { }

nix-mineral.settings.network.arp.announce Link copied!

Type: boolean

Always use the best local address for announcing local IP via ARP.

Seems to be most restrictive option.

Default: true
Example: false

nix-mineral.settings.network.arp.drop-gratuitous Link copied!

Type: boolean

Drop Gratuitous ARP frames to prevent ARP poisoning.

This can cause issues when ARP proxies are used in the network.

Default: true
Example: false

nix-mineral.settings.network.arp.filter Link copied!

Type: boolean

Enable ARP filtering in the kernel to prevent the Linux kernel from handling the ARP table globally and mitigate some ARP spoofing and ARP cache poisoning attacks.

Default: true
Example: false

nix-mineral.settings.network.arp.ignore Link copied!

Type: one of "none", "local", "link"

Ignore/don't reply to specific ARP requests to limit scope of ARP spoofing.

This may break certain VM networking configurations if set to 'link,' which can be fixed by setting to 'local' or 'none.'

However, such a regression has been intentionally excluded from the compatibility preset unless new information or usecases are made apparent, given that this issue appears to be isolated to niche setups which NixOS is not known or advisable to be used for.

  • none: Keep the default configuration of your kernel.
  • local: Reply only if the target IP address is within the local address range configured on the incoming interface
  • link: Reply only if the target IP is on the same link.
Default: "link"

nix-mineral.settings.network.icmp.cast Link copied!

Type: boolean

Set to false to ignore all ICMPv6 and ICMPv4 echo and timestamp requests sent to broadcast/multicast/anycast.

Makes system slightly harder to enumerate on a network.

::: .{note} Redundant with nix-mineral.settings.network.icmp.ignore-all enabled. :::

Default: false
Example: true

nix-mineral.settings.network.icmp.ignore-all Link copied!

Type: boolean

Set to true to ignore all ICMPv6 and ICMPv4 echo and timestamp requests.

Makes system slightly harder to enumerate on a network.

You will not be able to ping this computer with ICMP packets if this is enabled.

Default: true
Example: false

nix-mineral.settings.network.icmp.ignore-bogus Link copied!

Type: boolean

Ignore bogus ICMP error responses to reduce potential system impact caused by spammed error responses.

Default: true
Example: false

nix-mineral.settings.network.icmp.redirect Link copied!

Type: boolean

Set to false to disable ICMP redirects to prevent some MITM attacks.

::: .{note} See:

Default: false
Example: true

nix-mineral.settings.network.icmp.secure-redirect Link copied!

Type: boolean

Use secure ICMP redirects by default.

Note

Helpful only if nix-mineral.settings.network.icmp.redirect is enabled, otherwise this does nothing. Not harmful to leave enabled even if unnecessary.

Default: true
Example: false

nix-mineral.settings.network.ip-forwarding Link copied!

Type: boolean

Enable or disable IP forwarding.

::: .{warning} If false, this may cause issues with certain VM networking, and must be true if the system is meant to function as a router. :::

Default: false
Example: true

nix-mineral.settings.network.ipv6-tempaddr Link copied!

Type: boolean

Enable IPv6 Privacy Extensions (RFC3041) and prefer the temporary address.

Inclusive a "kitchen sink" config to enable privacy extensions in relevant daemons. If you do not use these, nothing will happen.

If you use alternative daemons or replacements, considering looking at upstream documentation or filing a PR to add their configurations here.

::: .{note} GrapheneOS devs seem to believe it is relevant to use IPV6 privacy extensions alongside MAC randomization, so consider doing both where applicable. https://grapheneos.org/features#wifi-privacy :::

Default: true
Example: false

nix-mineral.settings.network.log-martians Link copied!

Type: boolean

Log packets with impossible addresses to kernel log.

No active security benefit, just makes it easier to spot a DDOS/DOS by giving extra logs.

This may worsen performance due to the additional logging.

Default: true
Example: false

nix-mineral.settings.network.max-addresses Link copied!

Type: boolean or signed integer

Number of global unicast IPv6 addresses can be assigned to each interface.

Set this to false to disable this option entirely.

Default: 1
Example: false

nix-mineral.settings.network.neighbor-solicitations Link copied!

Type: boolean or signed integer

Number of IPv6 duplicate address detection neighbor solicitations to send out per address.

See RFC4681 for details.

Set this to false to disable this option entirely.

Default: 0
Example: false

nix-mineral.settings.network.random-mac Link copied!

Type: boolean

If set to true, randomize mac addressees to improve privacy.

Note

This currently only works if you use networkmanager. If you don't, this does nothing and you should consult upstream documentation or file a PR to add relevant configuration.

Default: true
Example: false

nix-mineral.settings.network.rfc1337 Link copied!

Type: boolean

RFC1337 protects from TIME-WAIT assassination attacks by dropping TCP RST packets when in the TIME-WAIT state.

This protects against some potention DoS attacks which could cause TCP connections to drop given specific circumstances or crafted packets.

Default: true
Example: false

nix-mineral.settings.network.router-advertisements Link copied!

Type: one of "off", "restrict", "on"

IPv6 router advertisements which are accepted.

Malicious router advertisements have the potential to create a MITM attack by modifying the default gateway, cause a DoS/DDoS attack when flooded, or initiate unauthorized IPv6 access.

  • off: Disable all IPv6 router advertisements.
  • restrict: Restrict the parameters of IPv6 router advertisements which are accepted.
  • on: Enable all IPv6 router advertisements (effectively, do nothing).

Router advertisements are never authenticated, and can be sent and received by any device on the local network.

Warning

Setting to off or restrict may cause issues with IPv6 address autoconfiguration or host discovery.

Default: "restrict"

nix-mineral.settings.network.router-solicitations Link copied!

Type: boolean or signed integer

Number of IPv6 Router Solicitations to send until assuming no routers are present.

Setting to 0 limits outgoing traffic on the network, and reduces the frequecy of IPv6 router advertisements received.

See RFC4681 for details.

Set this to false to disable this option entirely.

Note

There is no point to setting this number above 0 if nix-mineral.settings.network.router-advertisements is set to off.

Default: 0
Example: false

nix-mineral.settings.network.rp-filter Link copied!

Type: boolean

Validate source IPs of packets received on the machine, protecting from IP spoofing.

Default: true
Example: false

nix-mineral.settings.network.shared-media Link copied!

Type: boolean

Enable sending and receiving of shared media redirects.

This setting overwrites net.ipv4.conf.all.secure_redirects.

Refer to RFC1620

Default: false
Example: true

nix-mineral.settings.network.source-route Link copied!

Type: boolean

Disable source routing if set to false, since it allows for redirecting network traffic and potentially creating a man in the middle attack.

Default: false
Example: true

nix-mineral.settings.network.syncookies Link copied!

Type: boolean

Use syncookies to help protect against SYN flooding, a type DoS attack.

Default: true
Example: false

nix-mineral.settings.network.tcp-sack Link copied!

Type: boolean

Set to false to disable TCP SACK, which has been used for DoS attacks and been exploited in the past.

Rarely used, but can reduce networking performance if disabled in certain applications.

Default: false
Example: true

nix-mineral.settings.network.tcp-timestamps Link copied!

Type: boolean

Enables TCP timestamps.

Disabling prevents leaking system time, enabling protects against wrapped sequence numbers and improves performance.

Disabling implicitly disables reuse of TIME_WAIT sockets, as they depend on TCP timestamps which may lead to corruption and an inability to detect duplicate packets. It may also result in port exhaustion as ports may not be immediately reused.

There are possible information leaks when timestamps are enabled. Offset randomization used by default prevents uptime prediction, but the rate of incrementing timestamps can be used in some advanced attacks to predict the current clock speed of a running system.

Because nix-mineral has different priorities to Whonix, which influences Kicksecure's development, we choose not to disable timestamps by default since clock speed fingerprinting is not a useful threat to most people; if it is important, it is probably smarter to use another Linux distribution entirely.

Default: true
Example: false

nix-mineral.settings.pam Link copied!

Type: submodule

Modify pluggable authentication module (PAM) settings.

Default: { }

nix-mineral.settings.pam.login-faildelay Link copied!

Type: boolean or signed integer

Add/increase the delay to failed logins into the system.

The default for nix-mineral is 4 seconds, or 4000000 microseconds.

Default: 4000000
Example: false

nix-mineral.settings.pam.shadow-hashing Link copied!

Type: boolean or signed integer

Modify hashing rounds for /etc/shadow; this doesn't automatically rehash your passwords, you'll need to set passwords for your accounts again for this to work.

If you declaratively set passwords with a secret manager, consider using a good number (65536) of hashing rounds or more for resilience to password cracking.

Set this to false to disable this option entirely.

Default: 65536
Example: false

nix-mineral.settings.pam.su-wheel-only Link copied!

Type: boolean

Set to true to require wheel to use su and su-l, to reduce the risk of privilege escalation e.g from service accounts which have been maliciously hijacked and used for a shell.

Default: true
Example: false

nix-mineral.settings.system Link copied!

Type: submodule

Settings for the system.

Default: { }

nix-mineral.settings.system.file-protection Link copied!

Type: boolean

Prevent creation of files in world writable directories under certain circumstances to limit spoofing attacks.

Default: true
Example: false

nix-mineral.settings.system.lower-address-mmap Link copied!

Type: boolean

Allow or disallow mmap in lower addresses.

Disallowing mmap in lower addresses reduces the risk that incorrect memory allocations could tamper with the kernel, but may also cause compatibility issues with certain legacy software.

Default: false
Example: true

nix-mineral.settings.system.multilib Link copied!

Type: boolean

Enable multilib support, allowing 32-bit libraries and applications to run.

Warning

if false, this may cause issues with certain games that still require 32-bit libraries.

Default: false
Example: true

nix-mineral.settings.system.proc-mem-force Link copied!

Type: one of "none", "ptrace", "never"

Configure whether processes can modify their own memory mappings or not, which could be used for some exploits.

See: https://github.com/Kicksecure/security-misc/pull/332

none - Keep the default configuration of your kernel. ptrace - Only allow modification of memory mappings using ptrace. Affected by the "yama" option. never - Do not allow modifying memory mappings at all.

Default: "ptrace"

nix-mineral.settings.system.yama Link copied!

Type: one of "none", "relaxed", "restricted"

Yama restricts ptrace, which allows processes to read and modify the memory of other processes. This has obvious security implications.

ptrace may be required for specific debugging or certain video game anti cheats. Usually, the 'relaxed' option avoids most breakage.

  • none: Keep the default configuration of your kernel.
  • relaxed: Only allow parent processes to ptrace child processes.
  • restricted: No processes may be traced with ptrace.
Default: "restricted"