KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
  • Nix 90.6%
  • Python 5.6%
  • Just 3.8%
Find a file
2026-11-16 17:54:53 -05:00
configurations odu lane adds ci@naiveintent; inputs: olai 07579ae 2026-11-16 17:54:53 -05:00
docs doc 2026-08-22 12:00:44 -04:00
k8s olai: user service on gossamer; drop k3s on naiveintent 2026-11-11 13:28:28 -05:00
modules odu lane adds ci@naiveintent; inputs: olai 07579ae 2026-11-16 17:54:53 -05:00
secrets k8s: split into per-host clusters; move odu to pureintent 2026-10-31 11:12:20 -04:00
.gitattributes chore: Redundant entry 2024-06-21 19:46:58 -04:00
.gitignore Ignore .codex 2026-04-23 12:32:31 -04:00
AGENTS.md No 2026-09-29 12:32:40 -04:00
config.nix Remove unused 2024-09-28 22:51:12 -04:00
flake.lock odu lane adds ci@naiveintent; inputs: olai 07579ae 2026-11-16 17:54:53 -05:00
flake.nix inputs: kolu PR 2397, olai master; odu lane gains ci@pureintent 2026-11-16 14:20:54 -05:00
justfile activate: forward NIX_CONFIG over ssh and sudo; kolu PR 2380 2026-11-15 16:07:19 -05:00
README.md Remove local packages and their overlay wiring 2026-09-23 15:07:27 -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
./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. ↩︎