• Updated input 'darwin': 'github:lnl7/nix-darwin/64d9d1ae25215c274c37e3e4016977a6779cf0d3' (2024-10-22) → 'github:lnl7/nix-darwin/5f05c2c3d296c358dbdee8591528959d5360c247' (2024-10-23) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/22e8de2729f40d29a445c8baeaf22740b8b25daf' (2024-10-22) → 'github:NixOS/nixos-hardware/64d900abe40057393148bc0283d35c2254dd4f57' (2024-10-23) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/1c9fee8711a88d5b09e2072caf331efaec6501d3' (2024-10-23) → 'github:NixOS/nixpkgs/37ac2e71f555dc8ad41744d4c16f9d2e1c541a7b' (2024-10-24) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/ca30f584e18024baf39c395001262ed936f27ebd' (2024-10-20) → 'github:NixOS/nixpkgs/dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a' (2024-10-23)
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.