KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
Sridhar Ratnakumar e95363bcc5 darwin: fix
2024-12-20 11:51:06 -05:00
.github/workflows ci: simplify 2024-12-08 00:19:23 -05:00
.vscode Add ci to remotely build on two CI machines 2024-07-15 17:15:24 -04:00
configurations home-manager: add Zed editor 2024-12-16 11:35:02 -05:00
doom.d doom: disable 2024-11-18 12:04:59 -05:00
modules darwin: fix 2024-12-20 11:51:06 -05:00
overlays Remove git-squash 2024-11-28 17:17:35 -05:00
packages Remove git-squash 2024-11-28 17:17:35 -05:00
secrets home-media 2024-12-07 16:57:41 -05:00
webapps webapps: start using special ports 2024-11-19 18:47:24 -05:00
.envrc Convention-over-configuration layout (#62) 2024-09-28 18:01:53 -04:00
.gitattributes chore: Redundant entry 2024-06-21 19:46:58 -04:00
.gitignore treefmt: gg 2024-11-19 15:49:55 -05:00
config.nix Remove unused 2024-09-28 22:51:12 -04:00
flake.lock WIP 2024-12-20 10:44:58 -05:00
flake.nix WIP 2024-12-20 10:44:58 -05:00
justfile just: boot cleaning 2024-12-16 14:19:34 -05:00
README.md ragenix is unstable 2024-12-06 23:25:13 -05:00

AGPL project chat Harmeless Code of Conduct

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)

Tips

  • To update NixOS (and other inputs) run nix flake update
    • You may also update a subset of inputs, e.g.
      nix flake lock --update-input nixpkgs --update-input darwin --update-input home-manager
      # Or, `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 nix fmt.
  • To build all flake outputs (locally or in CI), run nix --accept-flake-config run github:juspay/omnix ci build
  • For secrets management, I use agenix.

Discussion

If you wish to discuss about this config, join the Zulip.


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