• Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c0b1da36f7c34a7146501f684e9ebdf15d2bebf8' (2024-10-14) → 'github:NixOS/nixpkgs/dc2e0028d274394f73653c7c90cc63edbb696be1' (2024-10-16) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/fb2d89780975e0b715aee33eac47ea6cbc33d65d' (2024-10-15) → 'github:NixOS/nixpkgs/eefb40aa692b5daeb24b213a1f7cc136f0790d3e' (2024-10-18) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221' (2024-10-10) → 'github:NixOS/nixpkgs/7881fbfd2e3ed1dfa315fca889b2cfd94be39337' (2024-10-15) • Updated input 'nixvim': 'github:nix-community/nixvim/b041963c607d766c4b102b8b56244ad38731f549' (2024-10-07) → 'github:nix-community/nixvim/341dbb1b5867adb95d75e6dabef6627eb0eae38e' (2024-10-16) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/1211305a5b237771e13fcca0c51e60ad47326a9a' (2024-10-05) → 'github:cachix/git-hooks.nix/43983c5976fef25e774e3f1c9bd04f658e9481c3' (2024-10-16) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/8c8388ade72e58efdeae71b4cbb79e872c23a56b' (2024-10-03) → 'github:lnl7/nix-darwin/a60ac02f9466f85f092e576fd8364dfc4406b5a6' (2024-10-14) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/4446c7a6fc0775df028c5a3f6727945ba8400e64' (2024-10-03) → 'github:numtide/treefmt-nix/5307ba60125bb024d7e52d71d582eafd511f3fee' (2024-10-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.