• Updated input 'darwin': 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22) → 'github:lnl7/nix-darwin/ac5694a0b855a981e81b4d9f14052e3ff46ca39e' (2024-08-25) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/b09c46430ffcf18d575acf5c339b38ac4e1db5d2' (2024-08-19) → 'github:NixOS/nixos-hardware/9fc19be21f0807d6be092d70bf0b1de0c00ac895' (2024-08-25) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/5de1564aed415bf9d0f281461babc2d101dd49ff' (2024-08-22) → 'github:NixOS/nixpkgs/ae815cee91b417be55d43781eb4b73ae1ecc396c' (2024-08-23) • Updated input 'nixvim': 'github:nix-community/nixvim/9b5bb1a7695fa1ab041982347b2444d87bb53c32' (2024-08-22) → 'github:nix-community/nixvim/764b89aa14543da7266719757cfcf0cce8c1679f' (2024-08-24) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/6cedaa7c1b4f82a266e5d30f212273e60d62cb0d' (2024-08-21) → 'github:cachix/git-hooks.nix/c8a54057aae480c56e28ef3e14e4960628ac495b' (2024-08-23) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22) → 'github:lnl7/nix-darwin/ea319a737939094b48fda9063fa3201ef2479aac' (2024-08-24) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/1d07739554fdc4f8481068f1b11d6ab4c1a4167a' (2024-08-16) → 'github:numtide/treefmt-nix/070f834771efa715f3e74cd8ab93ecc96fabc951' (2024-08-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.