
I recently took my old workstation out of storage, booted it and found it running Fedora 40 - so of course it was time to put NixOS on the machine and bring it into the fleet. I’ve probably been sleeping on the machine as a build/rendering server for my projects, and figured let’s do it.
While the setup was farily painless (after a `nix flake update`), I have written a quick guide for setting up a brand new machine (workstation - including secrets and files needed for getting a machine up and running) - as the secrets do need to manually be transferred over, as well as some directories.
Note: the machine’s name (logos) and my username (joshua) should be changed for your usecase
Boot your machine from a NixOS .iso#
Add git, nvim to nixos configuration as well as allow ssh into device, then nixos-rebuild switch and ssh into the machine from an already running nixOS instance#
Clone over nix configuration#
git clone https://github.com/joshuablais/nixos-config
cd nixos-config
# Copy over hardware config to nixos configuration repo:cp /etc/nixos/hardware-configuration.nix hosts/logos/Copy over ssh and gpg keys as well as age key#
# Move over age keyscp .config/age/keys.txt joshua@192.168.0.60:/home/joshua/.config/age
# Passwordsscp -r ~/.password-store/* joshua@192.168.0.60:/home/joshua/.password-store/
# Authinfo for emacsscp .authinfo.gpg joshua@192.168.0.60:/home/joshua
# get ssh setup for access:scp -r ~/.ssh/* joshua@192.168.0.60:/home/joshua/cat id_ed25519.pub > authorized_keys
# GPG keyscp gpg-pub.asc gpg-secret.asc joshua@192.168.0.60:/home/joshua/
# Import gpg keys:gpg --import ~/gpg-pub.ascgpg --import ~/gpg-secret.ascgpg --list-secret-keysgpg --edit-key josh@joshblais.comtrust5yq
# Copy over dictionaryscp -r +STORE joshua@192.168.0.60:/home/joshuaFirst build:#
Get radicale dirs:#
sudo touch /var/lib/radicale/userssudo chown radicale:radicale /var/lib/radicale/userssudo chmod 0640 /var/lib/radicale/usersCreate directories needed:#
mkdir -p ~/Pictures/Wallpapersgit clone https://github.com/joshuablais/wallpapers Wallpaperssudo nixos-rebuild switch --flake .#logosmkdir -p ~/.config/kmonadSetup doom emacs:#
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs~/.config/emacs/bin/doom install
rm .emacs.d
doomsyncNotes:#
- You don’t need to do much of this setup unless you want a physical desktop to work at.
- I will be setting up my machines with disko/colemna in the future for a more automated build
- My servers are generally even easier to setup than this: check my nixos-config server directory for more
If you have a better, more reproducible way of setting up a brand new NixOS workstation, I am all ears - while this is about 20x less painful than setting up any legacy distro, I still want to automate the full thing!
As always, God bless, and until next time.
If you enjoyed this post, consider Supporting my work, Checking out my book, Working with me, or sending me an Email to tell me what you think.