• Updated input 'darwin': 'github:lnl7/nix-darwin/683d0c4cd1102dcccfa3f835565378c7f3cbe05e' (2024-11-01) → 'github:lnl7/nix-darwin/4652874d014b82cb746173ffc64f6a70044daa7e' (2024-11-03) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/da14839ac5f38ee6adbdb4e6db09b5eef6d6ccdc' (2024-10-31) → 'github:NixOS/nixos-hardware/f6e0cd5c47d150c4718199084e5764f968f1b560' (2024-11-02) • Updated input 'nixpkgs-master': 'github:NixOS/nixpkgs/655c5f92a946210d36ff92a68561ff9d2abb4bf1' (2024-11-02) → 'github:NixOS/nixpkgs/c29a8c6aa5208fbafa857098a7cdbf4c4ea41a07' (2024-11-04) • Updated input 'nixvim': 'github:nix-community/nixvim/c05ac01070425ed0797b1ff678dc690c333cea74' (2024-10-26) → 'github:nix-community/nixvim/91c06026075f08a3c865fdc46cc6db8e2af35a1e' (2024-11-02) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1' (2024-10-01) → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90' (2024-11-01) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6' (2024-10-16) → 'github:cachix/git-hooks.nix/af8a16fe5c264f5e9e18bcee2859b40a656876cf' (2024-10-30) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/7840909b00fbd5a183008a6eb251ea307fe4a76e' (2024-10-25) → 'github:lnl7/nix-darwin/683d0c4cd1102dcccfa3f835565378c7f3cbe05e' (2024-11-01) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/aac86347fb5063960eccb19493e0cadcdb4205ca' (2024-10-22) → 'github:numtide/treefmt-nix/746901bb8dba96d154b66492a29f5db0693dbfcc' (2024-10-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.