My NixOS/nix-darwin config.
In the project root:
sudo nixos-rebuild switch --flake ".#<hostname>"First, generate a set of SSH keys for the new host:
gen-host-ssh-keys.sh <hostname>
# output to gen/<hostname>Then, rekey secrets so the new host can decrypt them:
cd secrets
# then add a pubkey from the new host to secrets.nix
agenix -rFinally, use nixos-anywhere to build on current machine then configure the
new remote host:
nixos-anywhere --extra-files gen/<hostname> --flake .#<hostname> nixos@<host_ip> --no-substitute-on-destination- Install
nixwith the Determinate installer xcode-select --installto install the Command Line Tools and makegitavailable- Bootstrap SSH credentials
- Clone this repo and enter its devShell
darwin-rebuild switch --flake .#<hostname>chsh -s /run/current-system/sw/bin/fish- (optional)
softwareupdate --install-rosetta --agree-to-license
The Darwin workstation profile installs macFUSE and mounts
~/Dropbox/data at ~/data. Initial setup requires enabling macFUSE's
kernel extension in two places:
- Shut down the Mac, then hold the power button until startup options appear. Open Options, launch Startup Security Utility, select the startup disk, and open Security Policy. Select Reduced Security, enable Allow user management of kernel extensions from identified developers, and restart.
- After login, let the mount job trigger macFUSE. Open System Settings → Privacy & Security, allow the macFUSE system software from developer Benjamin Fleischer, and restart again.
The File System Extensions toggles do not replace these steps: gocryptfs
uses macFUSE's kernel backend rather than its FSKit backend.
Store the vault password in the login Keychain once:
set-gocryptfs-data-passwordThe mount job retries every 30 seconds and mounts automatically on future
logins, provided ~/Dropbox/data/gocryptfs.conf exists. Verify it with:
mount | grep -F " on $HOME/data "On non-NixOS, use the Determinate nix installer:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installnix repl
# in the resulting nix prompt
> :lf .Enable/disable auto-snapshot with the following command:
sudo zfs set com.sun:auto-snapshot=true <pool>/<fs>maestral auth link # follow instruction
mkdir -p ~/sync/dropbox
maestral config set path ~/sync/dropbox
# common excludes
maestral excluded add /audios
maestral excluded add /backup
maestral excluded add /git
maestral excluded add /researches/lhcb-hardware_related
maestral excluded add /videos- This project was originally based on
digga. diggais no longer actively maintained. To learnnixand make things simpler, I studiedlite-configflake, stole the bits useful to me, and remade the project into its current state.