• Updated input 'darwin': 'github:lnl7/nix-darwin/ac5694a0b855a981e81b4d9f14052e3ff46ca39e' (2024-08-25) → 'github:lnl7/nix-darwin/7c4b53a7d9f3a3df902b3fddf2ae245ef20ebcda' (2024-09-01) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/36bae45077667aff5720e5b3f1a5458f51cf0776' (2024-08-27) → 'github:NixOS/nixpkgs/6e99f2a27d600612004fbd2c3282d614bfee6421' (2024-08-30) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/a6292e34000dc93d43bccf78338770c1c5ec8a99' (2024-08-27) → 'github:NixOS/nixpkgs/5629520edecb69630a3f4d17d3d33fc96c13f6fe' (2024-08-31) • Updated input 'nixvim': 'github:nix-community/nixvim/764b89aa14543da7266719757cfcf0cce8c1679f' (2024-08-24) → 'github:nix-community/nixvim/7cae6d0202140ec322e18b65b63d03b423d595f7' (2024-08-31) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01) → 'github:hercules-ci/flake-parts/af510d4a62d071ea13925ce41c95e3dec816c01d' (2024-08-30) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/c8a54057aae480c56e28ef3e14e4960628ac495b' (2024-08-23) → 'github:cachix/git-hooks.nix/4509ca64f1084e73bc7a721b20c669a8d4c5ebe6' (2024-08-28) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/ea319a737939094b48fda9063fa3201ef2479aac' (2024-08-24) → 'github:lnl7/nix-darwin/c8d3157d1f768e382de5526bb38e74d2245cad04' (2024-08-30) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/070f834771efa715f3e74cd8ab93ecc96fabc951' (2024-08-22) → 'github:numtide/treefmt-nix/3ffd842a5f50f435d3e603312eefa4790db46af5' (2024-08-28)
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.