• Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/107bb46eef1f05e86fc485ee8af9b637e5157988' (2024-08-08) → 'github:NixOS/nixos-hardware/c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf' (2024-08-10) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/21cc704b5e918c5fbf4f9fff22b4ac2681706d90' (2024-08-06) → 'github:NixOS/nixpkgs/4a92571f9207810b559c9eac203d1f4d79830073' (2024-08-13) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/154bcb95ad51bc257c2ce4043a725de6ca700ef6' (2024-08-09) → 'github:NixOS/nixpkgs/daf7bb95821b789db24fc1ac21f613db0c1bf2cb' (2024-08-14) • Updated input 'nixvim': 'github:nix-community/nixvim/170df9814c3e41d5a4d6e3339e611801b1f02ce2' (2024-08-06) → 'github:nix-community/nixvim/0b6aa80acbcb8387f2a4affb3dd22960ac2899aa' (2024-08-13) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/06939f6b7ec4d4f465bf3132a05367cccbbf64da' (2024-08-05) → 'github:cachix/git-hooks.nix/c7012d0c18567c889b948781bc74a501e92275d1' (2024-08-09) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30) → 'github:numtide/treefmt-nix/349de7bc435bdff37785c2466f054ed1766173be' (2024-08-12)
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.