• Updated input 'darwin': 'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29) → 'github:lnl7/nix-darwin/315aa649ba307704db0b16c92f097a08a65ec955' (2024-06-09) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/057a7996d012f342a38a26261ee529cebb1755ef' (2024-06-08) → 'github:NixOS/nixos-hardware/58b52b0dd191af70f538c707c66c682331cfdffc' (2024-06-10) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9b5328b7f761a7bbdc0e332ac4cf076a3eedb89b' (2024-06-06) → 'github:NixOS/nixpkgs/2819fffa7fa42156680f0d282c60d81e8fb185b7' (2024-06-09) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9' (2024-06-08) → 'github:NixOS/nixpkgs/3bcedce9f4de37570242faf16e1e143583407eab' (2024-06-09) • Updated input 'stylix': 'github:danth/stylix/ca3247ed8cfbf369f3fe1b7a421579812a95c101' (2024-06-08) → 'github:danth/stylix/7682713f6af1d32a33f8c4e3d3d141af5ad1761a' (2024-06-10)
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.