• Updated input 'darwin': 'github:lnl7/nix-darwin/98e7dba87238e4fa4eac609dc44f07dab40661c4' (2024-11-06) → 'github:lnl7/nix-darwin/fa7b46fa7716d0ff1abaa59ee2472ab25ad07188' (2024-11-07) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d063c1dd113c91ab27959ba540c0d9753409edf3' (2024-11-04) → 'github:NixOS/nixpkgs/dba414932936fde69f0606b4f1d87c5bc0003ede' (2024-11-06) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/e23775a6a90d411835308b6f3f290d2ef724221c' (2024-11-07) → 'github:NixOS/nixpkgs/10ff7c5e10cbef2c21433c560abcea04e805c1fe' (2024-11-07)
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.