nixos/hosts/modules/base.nix
Alexander Wainwright 265a299f24 fix: remove trusted-users escalation, restore comments, move man-db to core
- Remove alex from nix.settings.trusted-users in core.nix (was not in
  the original base.nix and widens attack surface by allowing arbitrary
  binary cache configuration without sudo)
- Restore useful comments in base.nix (zram explanation, earlyoom
  purpose, avahi/systemd-resolved notes)
- Move documentation.man.man-db.enable = false into core.nix so all
  hosts get it, remove redundant setting from wintermute and nightcity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 11:21:56 +10:00

92 lines
1.6 KiB
Nix

{ config, pkgs, inputs, ... }:
{
imports = [ ./core.nix ];
# zram creates a compressed swap device backed by RAM, so swap pages are
# compressed in memory rather than written to disk.
zramSwap.enable = true;
boot.kernel.sysctl = {
"vm.swappiness" = 10;
};
# stop the system becoming unresponsive when out of ram
services.earlyoom = {
enable = true;
freeMemThreshold = 10;
freeSwapThreshold = 90;
};
networking.firewall.allowedTCPPorts = [ 8000 8080 ];
programs.direnv = {
enable = true;
package = pkgs.direnv;
silent = false;
loadInNixShell = true;
direnvrcExtra = "";
nix-direnv = {
enable = true;
package = pkgs.nix-direnv;
};
};
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [];
programs.mosh.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true; # enable mDNS NSS lookups (.local resolution)
nssmdns6 = true;
publish = {
enable = true;
addresses = true;
workstation = true;
};
openFirewall = true;
# if using systemd-resolved alongside avahi, also enable:
# services.resolved.enable = true;
# services.resolved.extraConfig = "MulticastDNS=yes";
};
environment.systemPackages = with pkgs; [
avahi
bat
borgbackup
cifs-utils
duf
dust
entr
fd
gocryptfs
mosh
python314
ripgrep
rsync
silver-searcher
tldr
unzip
uv
wireguard-tools
zip
# maths
bc
libqalculate
# build tools
binutils
cmake
gcc
clang
gnumake
libtool
nodejs_24
# rust
cargo
rustc
];
}