NOTE: Incomplete readme, please refer to the flake.nix for now to understand how this all works.
just disko sudo nixos-install --flake .#
sudo nixos-rebuild switch --flake ".#" -v
nix shell nixpkgs#nixos-rebuild --command nixos-rebuild switch
--flake .#kiwi
--build-host @
--target-host @
--use-remote-sudo
--fast
sudo nixos-rebuild switch --flake ".?submodules=1#target-hostname" -v
- Install Nix (Determinate Installer)
- Git clone this repo
- cd into repo
- Build new systsem:
- run
nix run home-manager/master -- switch --flake .#pi - Subsequent runs:
home-manager switch --flake .#pi
- run
Requirement: configure iCloud for clipboard sharing.
- Xcode CLI tools + Rosetta
xcode-select --install
softwareupdate --install-rosetta --agree-to-license- Symlinks
ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/obsidian/notes ~/Notes
ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/ ~/iCloud-
Install Nix (Determinate Installer)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm
💡 Say
noif prompted to install Determinate Nix. We want upstream Nix.💡 If you get an error about
Nix build user group, run the following:curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/1448 | sh -s -- repair sequoia --move-existing-users
Probably best to reboot after this.
-
Install 1Password
- Download GUI
- Download op CLI with nix:
NIXPKGS_ALLOW_UNFREE=1 nix shell nixpkgs#_1password-cli --impure - Configure op CLI:
op signin - Configure SSH agent
-
Find state versions
For nix-darwin
system.StateVersionnix flake init -t nix-darwin/master grep "system.stateVersion" flake.nix rm flake.nixFor home-manager
home.stateVersionnix run home-manager/master -- init . grep "home.stateVersion" home.nix rm flake.nix home.nix
Update flake.nix with values
-
Set up sops-nix for secrets management:
# [On new machine] # Create host ssh keypair (/etc/ssh/) nix shell nixpkgs#ssh-to-age sudo ssh-keygen -A cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age # [On old machine] # Add the public key to .sops.yaml! # Re-encerypt secrets.yaml with new public key sops updatekeys secrets/secrets.yaml # commit and push
-
Git clone this repo
git clone git@github.com:UncleGravity/dotfiles.git ~/nix cd ~/nix
-
Build your new system:
- First run. It collects all binary caches in the config to avoid unecessary builds.
nix run .#bootstrap <hostname>- Subsequent runs:
just sync # or directly: nh darwin switch . -H <hostname>