• Updated input 'darwin': 'github:lnl7/nix-darwin/189d2d422c773fa065cc9c72e6806f007ebb9be0' (2024-11-04) → 'github:lnl7/nix-darwin/98e7dba87238e4fa4eac609dc44f07dab40661c4' (2024-11-06) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/f6e0cd5c47d150c4718199084e5764f968f1b560' (2024-11-02) → 'github:NixOS/nixos-hardware/e1cc1f6483393634aee94514186d21a4871e78d7' (2024-11-06) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/080166c15633801df010977d9d7474b4a6c549d7' (2024-10-30) → 'github:NixOS/nixpkgs/d063c1dd113c91ab27959ba540c0d9753409edf3' (2024-11-04) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/7c7453a8ddeaf0fef6f89390ee9a2bf324ec6f92' (2024-11-04) → 'github:NixOS/nixpkgs/e23775a6a90d411835308b6f3f290d2ef724221c' (2024-11-07) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53' (2024-10-30) → 'github:NixOS/nixpkgs/8c4dc69b9732f6bbe826b5fbb32184987520ff26' (2024-11-05)
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.