• Updated input 'darwin': 'github:lnl7/nix-darwin/076b9a905af8a52b866c8db068d6da475839d97b' (2024-08-17) → 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c42fcfbdfeae23e68fc520f9182dde9f38ad1890' (2024-08-17) → 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/f02fa2f654c7bcc45f0e815c29d093da7f1245b4' (2024-08-20) → 'github:NixOS/nixpkgs/5de1564aed415bf9d0f281461babc2d101dd49ff' (2024-08-22) • Updated input 'nixvim': 'github:nix-community/nixvim/3187749816b3549cf46c5ca85e6736d0ed4a5aa0' (2024-08-17) → 'github:nix-community/nixvim/9b5bb1a7695fa1ab041982347b2444d87bb53c32' (2024-08-22) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba' (2024-08-16) → 'github:cachix/git-hooks.nix/6cedaa7c1b4f82a266e5d30f212273e60d62cb0d' (2024-08-21) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/076b9a905af8a52b866c8db068d6da475839d97b' (2024-08-17) → 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22)
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.