KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
2023-01-03 21:08:28 +05:30
.vscode vscode: not using makefile anymore 2022-12-18 10:03:57 -05:00
home don't install ghcid globally 2022-12-31 17:15:03 +05:30
nix-darwin Isolate common nix into lib.nix 2022-12-03 21:57:30 -05:00
nixos Make it a list; add my new key 2022-12-27 14:48:21 -05:00
secrets users/config.nix 2022-12-27 15:23:16 -05:00
systems hci cli 2022-12-24 21:24:05 -05:00
users users/config.nix 2022-12-27 15:23:16 -05:00
.envrc flake'ify shell.nix 2022-05-08 10:25:46 -04:00
.gitattributes git: make flake.lock as auto-generated 2022-05-08 10:17:29 -04:00
.gitignore add direnv 2022-04-28 14:47:41 -04:00
flake.lock Advance nix-darwin back to master 2023-01-03 21:08:28 +05:30
flake.nix Advance nix-darwin back to master 2023-01-03 21:08:28 +05:30
lib.nix add ', fmt' 2023-01-03 10:50:00 +05:30
README.md add ', fmt' 2023-01-03 10:50:00 +05:30

This repository contains the Nix / NixOS configuration for all of my systems. Start from flakes.nix (see Flakes).

To build,

# First, edit nixosConfigurations in flake.nix to add your system's hostname.
# And then change `userName` to your username.
nix develop -c , activate

Install notes

Directory layout

  • home: home-manager config (shared between Linux and macOS)
  • nixos: nixos modules for Linux
  • nix-darwin: nix-darwin modules for macOS
  • users: user information
  • secrets: agenix secrets (encrypted using ssh keys)
  • systems: top-level configuration.nix('ish) for various systems

Tips

  • Run , in nix develop shell (tip: direnv better) to see available scripts.
  • 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
      # Also, in the dev shell: , update-primary
      
  • 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.

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