• Updated input 'darwin': 'github:lnl7/nix-darwin/884f3fe6d9bf056ba0017c132c39c1f0d07d4fec' (2024-07-23) → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/d3c993c851ad40bbab7e08d566138ff72cd8744f' (2024-07-25) → 'github:NixOS/nixos-hardware/e67b60fb1b2c3aad2202d95b91d4c218cf2a4fdd' (2024-07-27) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d0907b75146a0ccc1ec0d6c3db287ec287588ef6' (2024-07-24) → 'github:NixOS/nixpkgs/8c50662509100d53229d4be607f1a3a31157fa12' (2024-07-27) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/2122a9b35b35719ad9a395fe783eabb092df01b1' (2024-07-25) → 'github:NixOS/nixpkgs/038fb464fcfa79b4f08131b07f2d8c9a6bcc4160' (2024-07-28) • Updated input 'nixvim': 'github:nix-community/nixvim/551fc42d2aab63bcf3709aa20ebfd7269128642d' (2024-07-25) → 'github:nix-community/nixvim/59cc229e6f6143563c01d367c36f8cff91831680' (2024-07-27) • Updated input 'nixvim/devshell': 'github:numtide/devshell/cf8c7405479cfde7ea4dc815e195391d2328df10' (2024-07-25) → 'github:numtide/devshell/cc8700135fb0740199ac248063f20c6b1a3c7e42' (2024-07-26) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/884f3fe6d9bf056ba0017c132c39c1f0d07d4fec' (2024-07-23) → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
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.