lix configuration for macOS+NixOS
  • Nix 61.3%
  • Shell 34.6%
  • Just 4.1%
Find a file
2026-05-30 22:59:36 +01:00
modules brew: tailscale + whatsapp 2026-05-30 22:59:36 +01:00
profiles trivial: nixpkgs-fmt 2024-03-25 22:52:39 +00:00
.gitignore add .hostname to .gitignore for local overrides 2025-05-24 19:17:15 +01:00
flake.lock chore: nixpkgs/release-26.05 2026-05-30 22:44:23 +01:00
flake.nix chore: nixpkgs/release-26.05 2026-05-30 22:44:23 +01:00
Justfile Justfile: flake-update 2026-05-26 14:14:05 +01:00
README.md brew: catch up packages 2026-05-30 22:44:26 +01:00

system

get started (on macOS) 🏃

first, authorise SSH keys in GitLab (user profile / deploy keys).

second, install Lix using the one-liner:

$ curl -sSf -L https://install.lix.systems/lix | sh -s -- install

third, ensure Lix is installed correctly:

$ nix run nixpkgs#hello

fourth, check flake.nix: make sure there's a darwinConfigurations section for the current hostname

last, but not least, once you're ready to commit:

$ nix run nix-darwin -- switch --flake .

rebuilding 🔧

after initial setup, we can use a shorter command to rebuild the system:

$ darwin-rebuild switch --flake .

or, the even shorter:

$ just switch

Homebrew

Formulae are managed by nix-darwin's homebrew module, mostly through modules/darwin/brew.nix.

homebrew.global.brewfile is enabled, permitting use of brew bundle to preview missing packages against the current state.

List dependencies that haven't been installed:

$ brew bundle check -v

List unexpected installed dependencies:

# Needs --force to actually cleanup, see --help
$ brew bundle cleanup

get started (on NixOS) 🏃

first, download and install NixOS.

second, authorise SSH keys in GitLab (user profile / deploy keys).

third, move /etc/nixos to our home directory:

$ sudo mv /etc/nixos ~/system && sudo chown -R $USER ~/system

fourth, gently initialise the git repository while preserving nixos-generate-config output:

# this could probably be less convoluted?
$ mv {hardware-configuration.nix,configuration.nix} ..
$ git init && git remote add origin git@gitlab.canidae.systems:htw/system.git && git fetch origin
$ git reset --hard origin/main
$ mv ../hardware-configuration.nix ./modules/hardware/$(hostname).nix

fifth, check flake.nix: make sure there's a nixosConfigurations section for the current hostname (use ../configuration.nix as a reference)

last, but not least, once you're ready to commit:

$ sudo nixos-rebuild switch --flake .

notes

influences

further reading