• Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/9a415c28ae33047988090cf0af2dac3311f3e2a2' (2024-10-26) → 'github:NixOS/nixpkgs/86e78d3d2084ff87688da662cf78c2af085d8e73' (2024-10-26) • Updated input 'nixvim': 'github:nix-community/nixvim/341dbb1b5867adb95d75e6dabef6627eb0eae38e' (2024-10-16) → 'github:nix-community/nixvim/c05ac01070425ed0797b1ff678dc690c333cea74' (2024-10-26) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/43983c5976fef25e774e3f1c9bd04f658e9481c3' (2024-10-16) → 'github:cachix/git-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6' (2024-10-16) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/a60ac02f9466f85f092e576fd8364dfc4406b5a6' (2024-10-14) → 'github:lnl7/nix-darwin/7840909b00fbd5a183008a6eb251ea307fe4a76e' (2024-10-25) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/5307ba60125bb024d7e52d71d582eafd511f3fee' (2024-10-16) → 'github:numtide/treefmt-nix/aac86347fb5063960eccb19493e0cadcdb4205ca' (2024-10-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.