• Updated input 'darwin': 'github:lnl7/nix-darwin/29b3096a6e283d7e6779187244cb2a3942239fdf' (2024-06-17) → 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/cc634b69c8312c4e88469d3c7e8fb5ecc72e7dc6' (2024-06-21) → 'github:NixOS/nixos-hardware/c3e48cbd88414f583ff08804eb57b0da4c194f9e' (2024-06-23) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/dd457de7e08c6d06789b1f5b88fc9327f4d96309' (2024-06-19) → 'github:NixOS/nixpkgs/e4509b3a560c87a8d4cb6f9992b8915abf9e36d8' (2024-06-23) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/9b10b8f00cb5494795e5f51b39210fed4d2b0748' (2024-06-20) → 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681' (2024-06-22) • Updated input 'nixvim': 'github:nix-community/nixvim/1cd17226d5c75d20df2ebb754c3fc60ccc735a25' (2024-06-21) → 'github:nix-community/nixvim/066485bf4c4cd83f01a75d46556ba2037e716604' (2024-06-23) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/29b3096a6e283d7e6779187244cb2a3942239fdf' (2024-06-17) → 'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23)
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.