SkillAgentSearch skills...

.dotfiles

Flake-based, literate nix config for personal infrastructure

Install / Use

/learn @Swarsel/.dotfiles

README

Build Status

Disclaimer

You probably do not want to use this setup verbatim. This is made to fit my specific use cases, and I do not guarantee best practises everywhere. Changes are made on a daily basis.

That being said, there is a lot of general configuration that you probably can use without changes; if you only want to use this repository as a starting point for your own configuration, you should be fine. See below for more information. Also, if you see something that can be done more efficiently or better in general, please let me know! :)

~SwarselSystems~

<p align="center"> <img width="49%" title="Tiling" alt="swarselsystems_preview1" src="https://github.com/user-attachments/assets/f6021ab9-6289-497d-8747-28f5d526b75a" /> <img width="49%" title="Waybar" alt="swarselsystems_preview2" src="https://github.com/user-attachments/assets/1160d9f7-710c-4046-8fcf-476bb4a0be84" /> </p>

Overview

  • Literate configuration defining my entire infrastructure, including Emacs
  • Configuration based on flakes for personal hosts as well as servers on:
  • Streamlined configuration and deployment pipeline:
    • Framework for packages, overlays, modules, and library functions
    • Dynamically generated config:
      • host configurations
      • dns records
      • network setup (+ wireguard mesh on systemd-networkd)
    • Remote Builders for [x86_64,aarch64]-linux running in hydra, feeding a private nix binary cache
    • Bootstrapping:
      • Limited local installer (no secrets handling) with a supported demo build
      • Fully autonomous remote deployment using nixos-anywhere and disko (with secrets handling)
    • Improved nix tooling
  • Support for advanced features:
    • Secrets handling using sops-nix (pls no pwn ❤️)
    • Management of personally identifiable information using nix-plugins
    • Full Yubikey support
    • LUKS-encryption with support for remote disk unlock over SSH
    • Secure boot using Lanzaboote
    • BTRFS-based Impermanence
    • Configuration shared between configurations (configuration for one nixosConfiguration can be defined in another nixosConfiguration)
    • Global attributes shared between all configurations to reduce attribute redeclaration
    • Config library for defining config-based functions for generating service information
    • Reduced friction between full NixOS- and home-manager-only deployments regarding secrets handling and config sharing

Documentation

The full documentation can be found here:

SwarselSystems literate configuration

I went to great lengths in order to document the full design process of my infrastructure properly; the above document strives to serve as an introductory lecture to nix / NixOS while at the same time explaining the config in general.

If you only came here for my Emacs configuration, the relevant files are here:

Getting started

Demo configuration

<details> <summary>Click here for instructions on how to install the demo system</summary>

If you just want to see if this configuration is for you, run this command on any system that has nix installed:

nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#swarsel-rebuild -- -u <YOUR_USERNAME>

This will activate the hotel configuration on your system, which is a de-facto mirror of my main configuration with secret-based settings removed. Please keep in mind that this limited installer will make local changes to the cloned repository in order to be able to install it (otherwise the builder would fail at fetching my private secrets repository). As such, this should only be used to evaluate the system - if you want to use it longterm, you will need to create a fork and make some changes.

</details>

Deployment

<details> <summary>Click here for deployment instructions</summary>

The deployment process for this configuration is mostly automated, there are only a few steps that are needed to be done manually. You can choose between a remote deployment strategy that is also able to deploy new age keys for sops for you and a local installer that will only install the system without any secret handling.

Remote deployment (recommended if you have at least one running system)

  1. Fork this repo, and write your own host config at hosts/nixos/<YOUR_ARCHITECTURE>/<YOUR_CONFIG_NAME>/default.nix (you can use one of the other configurations as a template. Also see https://github.com/Swarsel/.dotfiles/tree/main/modules for a list of all additional options). At the very least, you should replace the secrets/ directory with your own secrets and replace the SSH public keys with your own ones (otherwise I will come visit you!🔓❤️). I personally recommend to use the literate configuration and org-babel-tangle-file in Emacs, but you can also simply edit the separate .nix files.
  2. Have a system with nix available booted (this does not need to be installed, i.e. you can use a NixOS installer image; a custom minimal installer ISO can be built by running just iso in the root of this repo)
  3. Make sure that your Yubikey is plugged in or that you have your SSH key available (and configured)
  4. Run swarsel-bootstrap -n <CONFIGURATION_NAME> -d <TARGET_IP> on your existing system. - Alternatively (if you run this on a system that is not yet running this configuration), you can also run nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles -- -n <CONFIGURATION_NAME> -d <TARGET_IP> (this runs the same program as the command above).
  5. Follow the installers instructions: - you will have to choose a disk encryption password (if you want that feature) - you will have to confirm once that the target system has rebooted - you will have to enter the root password once during the final system install
  6. That should be it! The installer will take care of setting up disks, secrets, and the rest of the hardware configuration! You will still have to sign in manually to some webservices etc.

Local deployment (recommended for setting up the first system)

  1. Boot the latest install ISO from this repository on an UEFI system.
  2. Run swarsel-install -n <CONFIGURATION_NAME>
  3. Reboot

Alternatively, to install this from any NixOS live ISO, run nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#install -- -n <CONFIGURATION_NAME> at step 2.

</details>

Infrastructure

<details> <summary>Click here for a summary of my infrastructure</summary> <img width="4250" height="9117" alt="topology" src="https://github.com/user-attachments/assets/582264cf-f239-4699-b90f-69f2cef5a7b2" />

Programs

| Topic | Program | |---------------|-----------------------------------------------------------------------------------------------------------------------------| |🐚 Shell | zsh | |🚪 DM | greetd | |🪟 WM | SwayFX or Niri | |⛩️ Bar | Waybar or Noctalia Shell | |✒️ Editor | Emacs | |🖥️ Terminal| Kitty | |🚀 Launcher| Fuzzel or Noctalia Shell | |🚨 Alerts | Mako or Noctalia Shell | |🌐 **Browse

View on GitHub
GitHub Stars66
CategoryOperations
Updated4d ago
Forks2

Languages

Nix

Security Score

100/100

Audited on Mar 26, 2026

No findings