Skip to content

octocat/minimal-nixos

Back Nightly upgrades, store maintenance and a swap file so the server can rebuild itself

Commit details

Nightly upgrades, store maintenance and a swap file so the server can rebuild itself

Description

Measured on the box: evaluation peaks at 230 MB resident + ~550 MB swap. A 2 GB /swapfile (created by NixOS at boot, below zram in priority) makes `rebuild` work in ~40 s warm, ~2.5 min cold. - nixos-upgrade timer (04:40 UTC daily): nix flake update nixpkgs in /etc/nixos, rebuild boot, reboot if kernel/initrd changed, else live switch; gc afterwards. Hand-written instead of system.autoUpgrade, which would pull nixos-rebuild (127 MB of Python) back in. - nix.gc weekly --delete-older-than 7d, nix.optimise weekly. - rebuild: coreutils on PATH and /run/wrappers/bin/sudo, so it runs from a systemd unit. - build.sh deploy: refresh /etc/nixos with a tar copy of the file set; the nix-built copy was found stale (placeholder headscale module). Claude-Session: https://claude.ai/code/session_01By5tCnzX3xs2FVQwtK1ifN

Metadata

Author
Real Ouellet real@realo.ca
Committed
Commit

Contributors

  • Real Ouellet real@realo.ca Author
  • Claude Fable 5.1 noreply@anthropic.com Co-author