KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
Sridhar Ratnakumar 9b24b422ad vira: unionmount
2025-12-23 17:53:35 -05:00
.vscode vscode: nushell 2025-07-22 10:27:01 -04:00
configurations pureintent: add swap 2025-12-16 16:47:43 -05:00
doom.d doom: disable 2024-11-18 12:04:59 -05:00
modules vira: unionmount 2025-12-23 17:53:35 -05:00
overlays refactor 2025-11-10 13:25:38 -05:00
packages git-changes: fuck it 2025-10-13 17:08:23 -04:00
secrets Update key 2025-12-02 11:39:22 -05:00
vendor AI: update 2025-12-02 14:39:20 -05:00
webapps Fix some warnings 2025-11-29 14:53:18 -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 Claude Code home-manager configuration (#96) 2025-08-27 14:54:38 -04:00
.gitmodules submodules: use https 2025-11-20 14:41:04 -05: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 vira: unionmount 2025-12-23 17:53:35 -05:00
flake.nix stuff 2025-12-18 21:07:32 -05:00
justfile a 2025-11-01 14:41:34 -04:00
README.md readme: mention git submodules 2025-11-20 18:44:11 -05:00
vira.hs ci: Add vira 2025-10-21 08:31:21 -04:00

AGPL

This repository contains the 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

To use this repository as base configuration for your 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
  • Rename ./configurations/darwin/??.nix to match your current system hostname
  • Edit config.nix to set your primary user information
  • 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)

Git Submodules

The vendor/ directory contains git submodules. See this blog post for details.

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. ↩︎