• Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/eab049fe178c11395d65a858ba1b56461ba9652d' (2024-07-29) → 'github:NixOS/nixos-hardware/14c333162ba53c02853add87a0000cbd7aa230c2' (2024-07-30) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) → 'github:NixOS/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29) • Updated input 'nixvim': 'github:nix-community/nixvim/59cc229e6f6143563c01d367c36f8cff91831680' (2024-07-27) → 'github:nix-community/nixvim/d69fb1bd7114a56532e666dc450c46cb42d382e0' (2024-07-30) • Updated input 'nixvim/devshell': 'github:numtide/devshell/cc8700135fb0740199ac248063f20c6b1a3c7e42' (2024-07-26) → 'github:numtide/devshell/67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae' (2024-07-27) • Removed input 'nixvim/devshell/flake-utils' • Removed input 'nixvim/devshell/flake-utils/systems' • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/8db8970be1fb8be9c845af7ebec53b699fe7e009' (2024-07-23) → 'github:numtide/treefmt-nix/768acdb06968e53aa1ee8de207fd955335c754b7' (2024-07-30)
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.