My computing environment, in code form. Nix & Ansible for my personal computer and my server.
Go to file
Tudor Roman 8ebcbf7913
update site
2023-12-21 15:40:11 +02:00
ansible Add a couple more flatpaks 2023-12-07 17:26:53 +01:00
hosts set global useDHCP to true 2023-12-17 16:33:13 +01:00
modules don't use esoteric tmux options 2023-12-07 17:29:16 +01:00
secrets update password 2023-12-17 16:33:15 +01:00
users wsl2-specific user config 2023-11-20 10:42:50 +01:00
.envrc Use direnv 2023-10-11 13:41:43 +02:00
.gitignore Use direnv 2023-10-11 13:41:43 +02:00
.gitmodules remove startpage 2017-07-08 14:42:37 +03:00 ansible: readme 2023-11-26 23:29:10 +01:00
default.nix working on a rewrite 2023-01-14 20:37:45 +01:00
flake.lock update site 2023-12-21 15:40:11 +02:00
flake.nix Update state version, use right url for home-manager 2023-12-17 16:05:28 +01:00 git: commit signing with ssh key 2023-06-04 20:21:03 +02:00 encrypt secrets with a new key to be able to edit them 2023-06-04 22:52:49 +02:00

Tudor's Dotfiles / Nix configuration

This is my Nix configuration, which works both for NixOS and for Nix

Acknowledgements to for heavily inspiring the layout of this config.

Warning The configuration codified here was made to be used by me and only me. While I am publishing them to help others to learn Nix and dotfile management, copying them verbatim will likely produce an unusable system.



First, provision a machine with NixOS.



  1. Clone this repo somewhere on the machine.
  2. nix run .#nixos-rebuild -- boot --flake .#<hostname> --use-remote-sudo

Remote server:

  1. nix run .#deploy-rs -- .#<hostname>

Any other Linux distro for sane people

  1. Provision a machine with a "normal" Linux distro (my personal choice is Fedora). For this, I prepared Ansible roles and playbooks.
  2. Install Nix (my installer of choice is nix-installer).
  3. Clone this repo somewhere on the machine
  4. nix run .#home-manager -- switch --flake .#tudor

Considerations for WSL


The WSL setup assumes that you have 1Password and npiperelay npiperelay installed.

You can install npiperelay with winget:

winget install npiperelay

Installing the thing

Assuming you have Nix set up on some other machine, clone this repo and run:

nix build

This will build the distro tarball in ./result/tarball/. You can then import it in WSL:

# Create the directory that will store the distro's disk image
New-Item -ItemType Directory c:\WSL\NixOS
# Import the tarball as a distro in WSL
wsl --import NixOS c:\WSL\NixOS .\result\tarball\<whatever>.tar.gz
# Boot it!
wsl -d NixOS

Considerations for encrypting secrets

Secrets are encrypted and used through agenix. When provisioning a new machine, make sure to take its host public key and rekey secrets accordingly.