These are the dotfiles and NixOS config I use on my daily-driver machine. I keep the system itself in a Nix flake and use GNU Stow for the files in my home directory.
This setup is built around:
- NixOS unstable
- COSMIC
- the
ryvuser and host - Fish, Neovim, tmux, Zed, and the rest of the apps in
nixos/modules/ - agenix for secrets when I eventually need them
There are currently no passwords or other encrypted secrets in the repo.
The easiest route is to create the user ryv in the NixOS installer. Pick any
password you want there—the config keeps that password and does not declare or
replace it.
Once I am logged into the new installation, the whole setup is basically:
nix shell nixpkgs#git -c \
git clone https://github.com/ryvrook/dotfiles.git ~/dotfiles
cd ~/dotfiles
sudo nixos-generate-config \
--show-hardware-config > nixos/hardware-configuration.nix
./rebuild
mkdir -p ~/Projects ~/Pictures/Wallpapers
stow alacritty bash fish starship bat git gh ssh tmux nvim zed \
gtk desktop vesktop btop fastfetch mangohudThen I reboot:
sudo rebootThat is the normal happy path. ./rebuild runs nixos-rebuild switch, so the
new configuration is applied immediately and becomes the current boot
generation.
The generated nixos/hardware-configuration.nix is machine-specific and
ignored by Git. I give it a quick look before rebuilding, especially on a
machine with an unusual disk layout.
This config currently expects a UEFI system and uses Limine. If I need
machine-only overrides, I put them in nixos/local.nix; that file is also
ignored and automatically picked up by ./rebuild.
Using ryv during installation is simplest, but it is not required. If I
installed with a temporary setup user, the first ./rebuild creates ryv
without a preset password. While still logged into the setup account, I run:
sudo passwd ryvThen I log out and start using ryv. Existing local users are left alone
because mutable users are enabled.
The wrapper checks that it is running on NixOS, loads the local hardware file,
and includes nixos/local.nix when it exists.
./rebuild # switch now
./rebuild test # activate temporarily
./rebuild boot # use on the next boot
./rebuild dry-activate # show activation changes
./rebuild build # build without activatingTo update the pinned flake inputs:
nix flake update
nix flake check --no-build
./rebuild testEach app directory at the repo root mirrors a path under my home directory. Stow turns those files into symlinks, so I can edit them here without rebuilding NixOS.
To apply everything I currently use:
stow alacritty bash fish starship bat git gh ssh tmux nvim zed \
gtk desktop vesktop btop fastfetch mangohudI do not use stow */, since that would also try to treat directories like
nixos/ and secrets/ as dotfile packages.
If Stow finds a file that an app already created, I move or delete that file after checking it, then run Stow again.
The desktop package ships my COSMIC keyboard shortcuts, including the Print
binding that runs screenshot-satty (grim + slurp + satty) instead of the
built-in COSMIC screenshot. COSMIC creates these files itself, so the first
time I apply them I remove its copies and re-stow:
rm ~/.config/cosmic/com.system76.CosmicSettings.Shortcuts/v1/custom \
~/.config/cosmic/com.system76.CosmicSettings.Shortcuts/v1/system_actions
stow desktopCOSMIC only reads the shortcuts on session start, so I log out and back in for
Print to pick up the new binding. This removal step is one-time; afterwards
the files are symlinks and repo edits apply directly.
Flatpak is enabled by the NixOS config. I add Flathub once:
flatpak remote-add --if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepoThe Vesktop settings are included here. My AskFriday Vencord plugin still needs its own development install from https://github.com/ryvrook/AskFriday.
I intentionally do not keep a NixOS user password in this repo. An existing
ryv password survives a rebuild, and a newly created account gets its
password locally with passwd.
agenix is still installed and its NixOS module is enabled, so I can use it for
service tokens or other secrets later. The empty rules file lives at
secrets/secrets.nix.
When I add my first secret, I will:
- Add the machine's public SSH host key to
secrets/secrets.nix. - Add a rule for the new
.agefile. - Run
cd secrets && agenix -e <name>.age. - Add the matching
age.secrets.<name>declaration to a NixOS module.
The host public key is available at:
cat /etc/ssh/ssh_host_ed25519_key.pubI can also try the configuration in QEMU without touching my installed system:
nix run .#vmThe VM uses 8 GiB of RAM, 4 vCPUs, and a 20 GiB disk. It logs into the graphical
session as ryv automatically and has no preset password. Passwordless sudo is
enabled only inside this disposable VM.
The VM runner expects QEMU at /usr/bin/qemu-img and
/usr/bin/qemu-system-x86_64. To start over, I delete ryv-vm.qcow2.
To evaluate or build it without launching:
nix flake check --no-build
nix build .#vm