curl --silent --show-error --fail --location https://install.lix.systems/lix | sh -s -- install
- Initialize nix-darwin.
mkdir --parents ~/github/sheeeng/nix/nix-darwin && cd $_
nix flake init --template nix-darwin
sed --in-place "s/simple/$(scutil --get LocalHostName)/" flake.nix
sed --in-place "s/x86_64-darwin/aarch64-darwin/" flake.nix
nix run nix-darwin --experimental-features "nix-command flakes" -- switch --flake ~/github/sheeeng/nix/nix-darwin
-
Extract the inlined configuration from flake.nix into a separate file named darwin.nix.
-
Create a home.nix file.
nix run nix-darwin -- switch --flake ~/github/sheeeng/nix/nix-darwin
- Rebuild configuration.
darwin-rebuild switch --flake ~/github/sheeeng/nix/nix-darwin