• Updated input 'darwin': 'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10) → 'github:lnl7/nix-darwin/5ce8503cf402cf76b203eba4b7e402bea8e44abc' (2024-07-13) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/a111ce6b537df12a39874aa9672caa87f8677eda' (2024-07-09) → 'github:NixOS/nixos-hardware/c5013aa7ce2c7ec90acee5d965d950c8348db751' (2024-07-11) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/249fbde2a178a2ea2638b65b9ecebd531b338cf9' (2024-07-09) → 'github:NixOS/nixpkgs/f12ee5f64c6a09995e71c9626d88c4efa983b488' (2024-07-12) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/212defe037698e18fc9521dfe451779a8979844c' (2024-07-11) → 'github:NixOS/nixpkgs/d55afb5fc2e24e0852c9da179fbe2a74a2687697' (2024-07-13) • Updated input 'nixvim': 'github:nix-community/nixvim/2c52164a4f1b863f5eda842b4b9423b7f2677ddc' (2024-07-08) → 'github:nix-community/nixvim/75e7bb13f5a3183f4993f4a9e44c1ede2076f6eb' (2024-07-14)
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.