• Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/083823b7904e43a4fc1c7229781417e875359a42' (2024-06-20) → 'github:NixOS/nixos-hardware/cc634b69c8312c4e88469d3c7e8fb5ecc72e7dc6' (2024-06-21) • Updated input 'nixvim': 'github:nix-community/nixvim/5593f1c8a0e24f1f1261de1af4cd3275ee43fdc6' (2024-06-18) → 'github:nix-community/nixvim/1cd17226d5c75d20df2ebb754c3fc60ccc735a25' (2024-06-21) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/cc4d466cb1254af050ff7bdf47f6d404a7c646d1' (2024-06-06) → 'github:cachix/git-hooks.nix/8cd35b9496d21a6c55164d8547d9d5280162b07a' (2024-06-20) • Updated input 'nixvim/home-manager': 'github:nix-community/home-manager/8d5e27b4807d25308dfe369d5a923d87e7dbfda3' (2024-06-13) → 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/58b905ea87674592aa84c37873e6c07bc3807aba' (2024-06-15) → 'github:lnl7/nix-darwin/29b3096a6e283d7e6779187244cb2a3942239fdf' (2024-06-17) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/e75ba0a6bb562d2ce275db28f6a36a2e4fd81391' (2024-06-13) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81' (2024-06-16)
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.