Files
nixos-config/hosts/common/global/nix.nix
T
Miguel Palhas 817c2f4f5e
CI / lint (push) Failing after 1m52s
CI / eval (push) Failing after 2m38s
System tweaks, gitea CI, boot limit
- nix: keep-outputs + keep-derivations (preserve devshells across GC)
- zramSwap + fstrim
- systemd-boot configurationLimit = 20
- expand .gitignore (editor/AI/stray dotfiles); track statix.toml
- gitea Actions CI: blocking flake-check eval + informational statix/deadnix/nixfmt

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 18:52:20 +01:00

42 lines
1.1 KiB
Nix

{
lib,
...
}:
{
nix = {
settings = {
trusted-users = [
"root"
"@wheel"
];
auto-optimise-store = lib.mkDefault true;
experimental-features = [
"nix-command"
"flakes"
];
warn-dirty = false;
# Keep devshell build inputs alive across GC/`nh clean` so direnv/devenv
# projects don't re-download/rebuild their shells after a cleanup.
keep-outputs = true;
keep-derivations = true;
};
# GC is handled by `nh clean` below (keep-N / keep-since semantics).
# The two are mutually exclusive — nh asserts if nix.gc.automatic is on.
gc.automatic = false;
};
# nh: ergonomic nixos-rebuild wrapper. Auto-detects the target from the
# machine hostname (configs are named to match), so `nh os switch` needs
# no host arg. Runs as root, so its `clean` prunes system + user profiles.
programs.nh = {
enable = true;
flake = "/home/naps62/projects/nixos-config";
clean = {
enable = true;
extraArgs = "--keep 10 --keep-since 7d";
};
};
nixpkgs.config.allowUnfree = true;
}