Execute nix-shell -p git to enter a nix shell with git available. From there:
git clone https://github.com/lanice/nixhome.git
cd nixhome
nix-shell # Enter the provided flake-enabled nix shell to bootstrap nixos and home-manager
cp /etc/nixos/hardware-configuration.nix hosts/<hostname>/hardware-configuration.nix # Make sure you use the nixos-generated hardware config
sudo nixos-rebuild switch --flake .#<hostname>Reboot, done.
Prerequisites: GitHub SSH key loaded (the nixhome-private input is fetched over SSH).
# Upstream Nix via the NixOS community installer; nix-darwin takes over nix.conf and the daemon
curl -sSfL https://artifacts.nixos.org/nix-installer | sh -s -- install --enable-flakes
# Homebrew for casks (nix-darwin manages the Brewfile, not brew itself)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
git clone https://github.com/lanice/nixhome.git ~/nixhome
# nh builds as the user (SSH key available) and only activates via sudo
nix run nixpkgs#nh -- darwin switch ~/nixhome -H <hostname>See docs/runbooks/matcha.md for first-switch snags.
Afterwards: nh darwin switch.
longjing: Framework Laptop 13 Pro - Core Ultra X7 358H | NixOS | Cosmicsencha: Lenovo ThinkPad P1 Gen5 - 64GB RAM, i7 12700H, RTX A1000 | NixOS | Cosmicboba: ZimaCube Pro - 64GB RAM, i5 1235U | NixOS | headlessunstable: Desktop PC - 64GB RAM, i5 12400F, GTX 3060 | NixOS | headlesstaro: ZimaBoard 2 - 16GB RAM, N150 | NixOS | headlessmatcha: MacBook M1 Pro - 16GB RAM | macOS | nix-darwin
{
pkgs,
system,
...
}: let
pinnedPks =
import (builtins.fetchTarball {
# URL to the tarball of the specific nixpkgs commit
# Choose the right version for examplePkg using https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=examplePkg
url = "https://github.com/NixOS/nixpkgs/archive/336eda0d07dc5e2be1f923990ad9fdb6bc8e28e3.tar.gz";
sha256 = "sha256:0v8vnmgw7cifsp5irib1wkc0bpxzqcarlv8mdybk6dck5m7p10lr";
}) {
inherit (pkgs) system;
};
examplePkgPinned = pinnedPks.examplePkg;
in {
home.packages = with pkgs; [ examplePkgPinned ];
}