Skip to content
/ nixos-config Public template

KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)

Notifications You must be signed in to change notification settings

srid/nixos-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 23, 2025
72b2345 · Apr 23, 2025
Dec 8, 2024
Jul 15, 2024
Mar 28, 2025
Nov 18, 2024
Apr 23, 2025
Feb 9, 2025
Mar 4, 2025
Jan 18, 2025
Feb 9, 2025
Sep 28, 2024
Jun 21, 2024
Nov 19, 2024
Mar 11, 2025
Sep 29, 2024
Apr 20, 2025
Apr 20, 2025
Mar 22, 2025

Repository files navigation

AGPL project chat Naiveté Compass of Mood

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

  • Install NixOS
  • Clone this repo anywhere
  • Rename ./configurations/nixos/??.nix to match your current system hostname
  • Edit config.nix to set your primary user information
  • Run nix run. That's it. Re-open your terminal.

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, because it works with SSH keys, and functions well on macOS and NixOS.

Discussion

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

Footnotes

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