My small loan of configuration files and scripts - based on NixOS
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Tudor Roman 53cfd3f864
made flake saner
3 days ago
ansible ansible: readme 4 days ago
hosts wsl2-specific user config 1 week ago
modules git auto setup remote 1 week ago
secrets Retire miniflux in favour of yarr 1 month ago
users wsl2-specific user config 1 week ago
.envrc Use direnv 2 months ago
.gitignore Use direnv 2 months ago
.gitmodules remove startpage 6 years ago
README.md ansible: readme 4 days ago
default.nix working on a rewrite 11 months ago
flake.lock made flake saner 3 days ago
flake.nix made flake saner 3 days ago
id_ed25519.pub git: commit signing with ssh key 6 months ago
id_ed25519_agenix.pub encrypt secrets with a new key to be able to edit them 6 months ago

README.md

Tudor's Dotfiles / Nix configuration

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

Acknowledgements to https://github.com/mrkuz/nixos 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.

Installation

NixOS

First, provision a machine with NixOS.

Then:

Desktop:

  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

Dependencies

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 .#nixosConfigurations.wsl2.config.system.build.installer

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.