• Updated input 'darwin': 'github:lnl7/nix-darwin/61cee20168a3ebb71a9efd70a55adebaadfbe4d4' (2024-11-19) → 'github:lnl7/nix-darwin/edabc790a834326dcb5810e2698fa743483510d0' (2024-11-21) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/c1b9d0ce79b10708808e543c81ca6dbd6532e031' (2024-11-21) → 'github:NixOS/nixpkgs/df7cef32c3494ca95363e119160be6960022b0fd' (2024-11-22)
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.