• Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/9fc19be21f0807d6be092d70bf0b1de0c00ac895' (2024-08-25) → 'github:NixOS/nixos-hardware/95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef' (2024-08-28) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22) → 'github:NixOS/nixpkgs/36bae45077667aff5720e5b3f1a5458f51cf0776' (2024-08-27) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/ae815cee91b417be55d43781eb4b73ae1ecc396c' (2024-08-23) → 'github:NixOS/nixpkgs/a6292e34000dc93d43bccf78338770c1c5ec8a99' (2024-08-27)
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.