KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
Sridhar Ratnakumar b4a60aaf3a
ralph(eval): reduce Nix eval time for pureintent + zest (#120)
* ralph(eval): baseline + benchmark harness

pureintent cpuTime 23.17s, zest cpuTime 14.93s (median of 5).
Methodology: NIX_SHOW_STATS cpuTime, eval-cache off, warm fetcher cache.

* ralph(eval) cycle 1: disable NixOS options manual on pureintent

documentation.nixos.enable = false. Generating the NixOS manual evaluates
every option's doc string. nrThunks 20,400,114 -> 19,201,996 (-5.9%),
nrFunctionCalls -6.2%, nrPrimOpCalls -7.5%. Package man pages unaffected.

Metric pivoted to deterministic NIX_SHOW_STATS counters: cpuTime is unusable
on this thermally-throttling machine (same eval = 11s..21s).

* ralph(eval): switch home target zest -> sincereintent (per request)

sincereintent home config baseline: nrThunks 5,323,428 / calls 3,227,404 /
primops 1,565,120 (deterministic).

* ralph(eval) cycle 2: disable home-manager options manpage

manual.manpages.enable = false in shared modules/home/default.nix. HM builds
home-configuration.nix(5) by default, evaluating every HM option's doc string.
sincereintent nrThunks 5,323,428 -> 3,551,679 (-33.3%), calls -35%, primops -39%.

* ralph(eval): record cycle-2 pureintent gain (shared HM module)

pureintent nrThunks 19,201,996 -> 17,431,437 (-9.2%); cycle-2's
manual.manpages.enable=false also feeds pureintent's embedded home-manager
via modules/nixos/default.nix. Total pureintent -14.6% from baseline.

* ralph(eval) cycle 3: profiling + dead-ends (no behaviour-preserving win)

Confirmed: nixpkgs single-instantiation (no 2x trap), unused inputs are lazy
(no counter impact), escapeShellArg hotspot is HM file-linking + /etc (not
patchable here). Remaining eval cost is feature-bound (embedded HM, vira/kolu,
google-cloud-sdk/pandoc/omnix).

* ralph(eval) cycle 4: drop heavy home.packages (yt-dlp/lima/omnix/pandoc/gcloud)

User-approved behaviour change. Removed from shared modules/home/cli/terminal.nix
(kept hledger). pureintent nrThunks 17,431,437 -> 16,989,720 (-2.5%),
sincereintent 3,551,679 -> 2,757,201 (-22.4%). Totals from baseline:
pureintent -16.7%, sincereintent -48.2%.

* ralph(eval): finalize report (final measurement, key findings, cost breakdown)
2026-05-29 07:19:48 -04:00
.vscode vscode: nushell 2025-07-22 10:27:01 -04:00
AI Upstreamed 2026-04-09 17:49:46 -04:00
configurations ralph(eval): reduce Nix eval time for pureintent + zest (#120) 2026-05-29 07:19:48 -04:00
docs ralph(eval): reduce Nix eval time for pureintent + zest (#120) 2026-05-29 07:19:48 -04:00
doom.d doom: disable 2024-11-18 12:04:59 -05:00
modules ralph(eval): reduce Nix eval time for pureintent + zest (#120) 2026-05-29 07:19:48 -04:00
overlays opencode: use upstream juspay/oc home module (#105) 2026-03-12 18:18:51 -04:00
packages stuf 2026-05-27 21:29:04 -04:00
secrets Update juspay llm key 2026-03-02 10:26:58 -05:00
.envrc envrc: Fix devshell path 2025-06-25 18:06:30 +10:00
.gitattributes chore: Redundant entry 2024-06-21 19:46:58 -04:00
.gitignore Ignore .codex 2026-04-23 12:32:31 -04:00
.gitmodules Remove submodules entirely 2026-03-14 09:22:23 -04:00
CLAUDE.md Add hackage-publish.nix, to be tested 2025-08-28 05:31:50 +05:30
config.nix Remove unused 2024-09-28 22:51:12 -04:00
flake.lock stuf 2026-05-27 21:29:04 -04:00
flake.nix stuf 2026-05-27 21:29:04 -04:00
justfile incus-pet: shared /nix/store, restart-to-deploy, drop anywhen flake input 2026-05-23 18:50:10 -04:00
README.md Remove submodules entirely 2026-03-14 09:22:23 -04:00
vira.hs ci: Add vira 2025-10-21 08:31:21 -04:00

AGPL

This is my Nix / NixOS configuration for all of my systems. See nixos-unified—specifically nixos-unified-template—if you wish to create your own configuration from scratch.

Setup

If you are using this repository as a starting template for your own configuration, perform these initial steps:

  1. Edit config.nix in the repository root to set your primary user information (username, fullname, email, sshKey).
  2. Replace the SSH keys in secrets/secrets.nix with your own, or delete the file if you do not use agenix.
  3. Delete any files in configurations/ that you do not need, and create/rename files to match your hostnames.

After preparing your template, to install on a new machine running:

NixOS Linux

Tip

For a general tutorial, see https://nixos.asia/en/nixos-install-flake

macOS

  • Install Nix
  • Clone this repo anywhere
  • Run nix run.1 That's it. Re-open your terminal.

Architecture

Start from flake.nix (see Flakes). flake-parts is used as the module system.

Directory layout

Tip

See flake-module.nix for autowiring of flake outputs based on this directory structure.

Path Corresponding flake output
./configurations/{nixos,darwin,home}/foo.nix {nixos,darwin,home}Configurations.foo
./mdules/{nixos,darwin,home,flake-parts}/foo.nix {nixos,darwin,home,flake}Modules.foo
./overlays/foo.nix overlays.foo
./packages N/A (Nix packages)
./secrets N/A (agenix data)

Tips

  • To update NixOS (and other inputs) run nix flake update
    • You may also update only primary inputs:
      # nix run .#update
      
  • To free up disk space,
    sudo nix-env -p /nix/var/nix/profiles/system --delete-generations +2
    sudo nixos-rebuild boot
    
  • To autoformat the project tree using nixpkgs-fmt, run just lint in Nix devShell.
  • To build all flake outputs (locally or in CI), run nix run nixpkgs#omnix ci
  • For secrets management, I use agenix, because it works with SSH keys, and functions well on macOS and NixOS.

Discussion

https://github.com/srid/nixos-config/discussions


  1. You might have to rm -rf /etc/nix/nix.conf, so our flake.nix can do its thing. ↩︎