Nix flake repository for personal hosts using literate config
Find a file
Leon Schwarzäugl ad2241586e
Some checks are pending
Flake check / Check flake (push) Waiting to run
chore: flake maintenance
2025-09-23 18:43:44 +02:00
.github docs: add tips 2025-08-27 03:24:30 +02:00
files chore: flake maintenance 2025-09-23 18:43:44 +02:00
hosts chore: flake maintenance 2025-09-23 18:43:44 +02:00
install chore: update flake 2025-09-16 14:24:16 +02:00
modules chore: flake maintenance 2025-09-23 18:43:44 +02:00
nix chore: flake maintenance 2025-09-23 18:43:44 +02:00
pkgs chore: flake maintenance 2025-09-23 18:43:44 +02:00
profiles chore: flake maintenance 2025-09-23 18:43:44 +02:00
secrets chore: flake maintenance 2025-09-23 18:43:44 +02:00
.gitignore fix: adapt bootstrap script for new structure 2025-07-05 03:07:08 +02:00
.sops.yaml fix: allow moonside to build remotely 2025-08-25 22:51:59 +02:00
flake.lock chore: update flake 2025-09-16 14:24:16 +02:00
flake.nix chore: flake maintenance 2025-09-23 18:43:44 +02:00
index.html chore: flake maintenance 2025-09-23 18:43:44 +02:00
justfile chore: flake cleanup 2025-07-22 21:35:36 +02:00
LICENSE Create LICENSE 2024-05-05 02:29:22 +02:00
SwarselSystems.org chore: flake maintenance 2025-09-23 18:43:44 +02:00

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~

swarselsystems_preview1 swarselsystems_preview2

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:
  • 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
    • 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

Documentation

If you are mainly interested in how I configured this system, check out this page:

SwarselSystems literate configuration

This file will take you through my design process, in varying amounts of detail.

Otherwise, the files that are possibly of biggest interest are found here:

Getting started

Demo configuration

Click here for instructions on how to install the demo system

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 chaostheatre 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.

Deployment

Click here for deployment instructions

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.

  1. Fork this repo, and write your own host config at hosts/nixos/<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.
  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.

Infrastructure

Click here for a summary of my infrastructure topology

Programs

Topic Program
🐚 Shell zsh
🚪 DM greetd
🪟 WM SwayFX
⛩️ Bar Waybar
✒️ Editor Emacs
🖥️ Terminal Kitty
🚀 Launcher Fuzzel
🚨 Alerts Mako
🌐 Browser Firefox
🎨 Theme City-Lights (managed by stylix)

Services

Topic Program
📖 Books Kavita
📼 Videos Jellyfin
🎵 Music Navidrome + Spotifyd + MPD
🗨️ Messaging Matrix
📁 Filesharing Nectcloud
🎞️ Photos Immich
📄 Documents Paperless
🔄 File Sync Syncthing
💾 Backups Restic
👁️ Monitoring Grafana
🍴 RSS FreshRss
🌳 Git Forgejo
Anki Sync Anki Sync Server
🪪 SSO Kanidm + oauth2-proxy
💸 Finance Firefly-III
🃏 Collections Koillection
🗃️ Shell History Atuin
📅 CalDav/CardDav Radicale
↔️ P2P Filesharing Croc
✂️ Paste Tool Microbin
📸 Image Sharing Slink
🔗 Link Shortener Shlink

Hosts

Name Hardware Use
💻 pyramid Framework Laptop 16, AMD 7940HS, RX 7700S, 64GB RAM Work laptop
💻 bakery Lenovo Ideapad 720S-13IKB Personal lapto
💻 machpizza MacBook Pro 2016 MacOS sandbox
🖥️ winters ASRock J4105-ITX, 32GB RAM Main homeserver and data storgae
🖥️ milkywell Oracle Cloud: VM.Standard.E2.1.Micro Server for lightweight synchronization tasks
🖥️ moonside Oracle Cloud: VM.Standard.A1.Flex, 4 OCPUs, 24GB RAM Proxy for local services, some lightweight services
📱 magicant Samsung Galaxy Z Flip 6 Phone
💿 drugstore - ISO installer configuration
chaotheatre - Demo config for checking out my configurtion
toto - Helper configuration for bootstrapping a new system
🏠 treehouse - Reference configuration for a home-manager only host
Click here for a summary of nix tips & links

Attributions, Acknowledgements, Inspirations, etc.

These are in random order (also known as 'the order in which I discovered them'). I would like to express my gratitude to:

  • All the great people who have contributed code for the nix-community, with special mentions for (this list is unfairly incomplete):
Click here to expand...
- [guibou](https://github.com/guibou/)
- [rycee](https://github.com/rycee)
- [adisbladis](https://github.com/adisbladis)
- [Mic92](https://github.com/Mic92/sops-nix)
- [lassulus](https://github.com/lassulus)
- [danth](https://github.com/danth/)
- [LnL7](https://github.com/LnL7)
- [t184256](https://github.com/t184256)
- [bennofs](https://github.com/bennofs)
- [Pandapip1](https://github.com/Pandapip1)
- [zowoq](https://github.com/zowoq)
- [numtide](https://github.com/numtide)
- [hsjobeki](https://github.com/hsjobeki)
- [blitz](https://github.com/blitz)
- [RaitoBezarius](https://github.com/RaitoBezarius)
- [nikstur](https://github.com/nikstur)
- [talyz](https://github.com/talyz)
- [infinisil](https://github.com/infinisil)
- [zhaofengli](https://github.com/zhaofengli)
- [Artturin](https://github.com/Artturin)
- [oddlama](https://github.com/oddlama)
  • All the people who have inspired me with their configurations (sadly also highly incomplete):
Click here to expand...
- [theSuess](https://github.com/theSuess) with their [home-manager](https://code.kulupu.party/thesuess/home-manager)
- [hlissner](https://github.com/hlissner) with their [dotfiles](https://github.com/hlissner/dotfiles)
- [drduh](https://github.com/drduh/YubiKey-Guide) with their [YubiKey-Guide](https://github.com/drduh/YubiKey-Guide)
- [AntonHakansson](https://github.com/AntonHakansson) with their [nixos-config](https://github.com/AntonHakansson/nixos-config?tab=readme-ov-file)
- [Guekka](https://github.com/Guekka/) with their [blog](https://guekka.github.io/)
- [NotAShelf](https://github.com/NotAShelf) with their [nyx](https://github.com/NotAShelf/nyx)
- [Misterio77](https://github.com/Misterio77) with their [nix-config](https://github.com/Misterio77/nix-config)
- [0xdade](https://github.com/0xdade) with their [blog](https://0xda.de/blog/)
- [EmergentMind](https://github.com/EmergentMind) with their [nix-config](https://github.com/EmergentMind/nix-config)
- [librephoenix](https://github.com/librephoenix) with their [nixos-config](https://github.com/librephoenix/nixos-config)
- [Xe](https://github.com/Xe) with their [blog](https://xeiaso.net/blog/)
- [oddlama](https://github.com/oddlama) with their absolutely incredible [nix-config](https:/github.com/oddlama/nix-config)

If you feel that I forgot to pay you tribute for code that I used in this repository, please shoot me a message and I will fix it :)