- Install Nix with the
Determinate Installer.
- When prompted, make sure to use vanilla upstream Nix instead of Determinate Nix.
- Run
nix run nix-darwin/master#darwin-rebuild -- switch --flake github:fng97/nix-config#macbook
. - To update with local changes to the flake run
nix-darwin switch --flake .#macbook
.
- Update everything with
winget upgrade --all
and make surewin32yank.exe
, WezTerm, and PowerToys are installed. - PowerToys: enable Keyboard Manager (swap CAPS for CTRL), FancyZones, and disable the rest.
-
Install NixOS-WSL.
-
Clone this repo to
/tmp
and unlockgit-crypt
.nix-shell -p git git-crypt
git clone https://github.com/fng97/nix-config.git /tmp/nix-config && cd /tmp/nix-config
-
Switch to flake:
sudo nixos-rebuild switch --flake .#wsl
-
Copy repo
~/src
for future use. -
Copy
wezterm
folder to~/.config/wezterm
(Windows home directory).
Setting up a new server:
-
Provision the server and install NixOS (e.g. with NixOS-Infect).
NOTE: A
configuration.nix
andhardware-configuration.nix
will be generated for us based on the server. NixOS-Infect will additionally generate anetworking.nix
for us. -
Retrieve the generated configuration:
scp -r root@<ip>:/etc/nixos hosts/server
. -
Replace the secrets with ones stored in
secrets/secrets.json
(git-crypt
) and adjust the imports to include the tailscale module:imports = [ ./hardware-configuration.nix ./tailscale.nix (import ./networking.nix { inherit secrets; }) ];
-
Deploy the configuration:
nix run nixpkgs#nixos-rebuild -- switch --fast --flake .#server \ --target-host root@<ip> \ --build-host root@<ip>
-
Over SSH, authenticate tailscale:
tailscale up --ssh
. -
In the tailscale dashboard, make sure the new machine's token will not expire.
To deploy further changes to the configuration:
nix run nixpkgs#nixos-rebuild -- switch --fast --flake .#server \
--target-host root@server \
--build-host root@server