- 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
-
Install NixOS-WSL
-
Once in, run
sudo nix-channel --update
andsudo nixos-rebuild switch
(not sure this is necessary but I do it anyway) -
Switch to flake:
sudo nixos-rebuild switch --flake github:fng97/nix-config#wsl
-
Use
wsl -s NixOS
to make it the default -
To update with local changes to the flake run
sudo nixos-rebuild switch --flake .#wsl
- Update everything with
winget upgrade --all
and make surewin32yank.exe
, WezTerm, and PowerToys are installed - PowerToys: enable Keyboard Manager (swap CAPS for CTRL), disable the rest
- Copy
wezterm.lua
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