• Updated input 'darwin': 'github:lnl7/nix-darwin/698a62c628c2ec423aa770d8ec0e1d0bcf4fca1a' (2024-11-23) → 'github:lnl7/nix-darwin/6ab87b7c84d4ee873e937108c4ff80c015a40c7a' (2024-11-26) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/672ac2ac86f7dff2f6f3406405bddecf960e0db6' (2024-11-16) → 'github:NixOS/nixos-hardware/45348ad6fb8ac0e8415f6e5e96efe47dd7f39405' (2024-11-24) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/e8c38b73aeb218e27163376a2d617e61a2ad9b59' (2024-11-16) → 'github:NixOS/nixpkgs/0c5b4ecbed5b155b705336aa96d878e55acd8685' (2024-11-27) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/41153887f033e82e9d2b3470282d6b5c1246c201' (2024-11-23) → 'github:NixOS/nixpkgs/f4a5f018f7f15ae644cb4ba4854b5a4062ae57b6' (2024-11-30) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7' (2024-11-18) → 'github:NixOS/nixpkgs/581d7e4d23b91daf2afa0005a5d3d01d6a8884fe' (2024-11-28)
nix-config
This repo stores nix to manage my machines running NixOS and macOS.
The configuration is very specific to my own machines and setup, but it may be a useful reference for anyone else learning or experimenting with nix, whether it be on a personal workstation or a server environment.
Setup
on macOS: install the latest unstable nix from https://github.com/numtide/nix-unstable-installer (for nix flakes), and nix-darwin: https://github.com/LnL7/nix-darwin
Recipes are stored in a justfile. just is required.
To run a rebuild:
just rebuild
Update
To update nixpkgs defined in flake.nix, run:
just update
If there are updates, they should be reflected in flake.lock.
Rollback
To rollback to the previous generation:
just rollback
Garbage collection
To cleanup previous files, run nix garbage collection:
just clean
Pre-commit hooks
Pre-commit hooks are automatically activated when direnv is installed.