• Updated input 'darwin': 'github:lnl7/nix-darwin/5f05c2c3d296c358dbdee8591528959d5360c247' (2024-10-23) → 'github:lnl7/nix-darwin/04193f188e4144d7047f83ad1de81d6034d175cd' (2024-10-24) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/64d900abe40057393148bc0283d35c2254dd4f57' (2024-10-23) → 'github:NixOS/nixos-hardware/e8a2f6d5513fe7b7d15701b2d05404ffdc3b6dda' (2024-10-24) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/89172919243df199fe237ba0f776c3e3e3d72367' (2024-10-20) → 'github:NixOS/nixpkgs/32e940c7c420600ef0d1ef396dc63b04ee9cad37' (2024-10-23) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/37ac2e71f555dc8ad41744d4c16f9d2e1c541a7b' (2024-10-24) → 'github:NixOS/nixpkgs/a378c720993acbe2dc771f96a6ca271d82eb2a04' (2024-10-24) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a' (2024-10-23) → 'github:NixOS/nixpkgs/cabaf14d3e69c9921d7acedf5d7d60bb2b90be02' (2024-10-24)
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.