My computing environment, in code form. Nix & Ansible for my personal computer and my server.
 
 
Go to file
Tudor Roman 4e946501ae
Flake Check / flake-check (pull_request) Successful in 57s Details
Flake Check / flake-check (push) Successful in 43s Details
Move .gitea to .forgejo
2024-03-15 11:14:55 +01:00
.forgejo/workflows Move .gitea to .forgejo 2024-03-15 11:14:55 +01:00
hosts Change zfs dataset for podman 2024-03-15 10:55:53 +01:00
lib Base my home-manager config on nixpkgs-unstable 2024-03-11 09:21:57 +01:00
modules Fix fonts 2024-03-11 10:15:16 +01:00
secrets forgejo: no need for a token 2024-03-04 18:24:59 +01:00
users Fix fonts 2024-03-11 10:15:16 +01:00
.envrc Use direnv 2023-10-11 13:41:43 +02:00
.git-blame-ignore-revs ignore grand reformat in git blame 2024-01-28 16:15:10 +01:00
.gitignore precommit hooks 2024-01-28 15:28:07 +01:00
.gitmodules remove startpage 2017-07-08 14:42:37 +03:00
README.md Bye Ansible! 2024-03-15 11:05:11 +01:00
default.nix reformat everything with alejandra 2024-01-28 15:51:55 +01:00
flake.lock Base my home-manager config on nixpkgs-unstable 2024-03-11 09:21:57 +01:00
flake.nix Bye Ansible! 2024-03-15 11:05:11 +01:00
id_ed25519.pub git: commit signing with ssh key 2023-06-04 20:21:03 +02:00
id_ed25519_agenix.pub encrypt secrets with a new key to be able to edit them 2023-06-04 22:52:49 +02:00
statix.toml applied static 2024-01-28 15:49:42 +01:00

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

The companion distro for this config is My Build of Fedora Silverblue. It is made with BlueBuild. The desktop-oriented configs in this repo are meant to be used with this Fedora build only.

  1. Provision a system with the ISO.
  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.