oddlama/nix-config

❄️ My nix config and dotfiles

Nix

274

1,212 commits

updated Aug 31, 2026

See the code

README

Hosts | Overview | Structure

preview

❄️ My NixOS Configuration

This is my personal nix config which I use to maintain my whole infrastructure, including my homelab, external servers and my development machines.

Hosts

TypeNameHardwarePurpose
💻LaptopnomGigabyte AERO 15-W8 (i7-8750H)My laptop and my main portable development machine Framework when?
🖥️DesktopkromaPC (AMD Ryzen 9 5900X)Main workstation and development machine, also for some occasional gaming
🖥️ServerwardODROID H3Energy efficient SBC for my home firewall and some lightweight services using containers and microvms.
🖥️ServersireThreadripper 1950XHome media server and data storage. Runs all services as microvms.
🖥️ServersausebieneIntel N100Home automation and IoT network isolation
🥔ServerzackbieneODROID N2+Decomissioned. Old home assistant board
☁️VPSsentinelHetzner Cloud serverProxies and protects my local services
☁️VPSenvoyHetzner Cloud serverMailserver

Overview

An overview over what you will find in this repository. I usually put a lot of effort into all my configurations and try to go over every option in detail. I've included the major components in the lists below.

Dotfiles

~~~~~~~~~~~~ProgramSourceDescription
🐚 ShellZSH & StarshipLinkZSH configuration with FZF, starship prompt, sqlite history and histdb-skim for fancy CtrlR
🖥️ TerminalKittyLinkTerminal configuration with nerdfonts and history CtrlShiftH to view scrollback buffer in neovim
🪟 WMniriLinkDynamic tiling window manager
🔋 BarnoctaliaLinkStatusbar, wallpaper and notifications
🌐 BrowserFirefoxLinkFirefox with many privacy settings and betterfox
🖊️ EditorNeovimLinkExtensive neovim configuration, made with nixvim
📜 ManpagerNeovimLinkIsolated neovim as manpager via nixvim
📷 ScreenshotsCustom based on grimblastLinkCustom scripts utilizing grimblast for QR code detection and OCR / satty editing
🎮 GamingSteam & BottlesLinkSetup for gaming
📫 MailThunderbirdLinkYour regular thunderbird setup

Services

~~~~~~~~~~~~ServiceSourceDescription
🛡️ AdblockAdGuard HomeLinkDNS level adblocker
🔒 SSOKanidmLinkIdentity provider for Single-Sign-On on my hosted services, with provisioning.
🐙 GitForgejoLinkForgejo with SSO
🔑 PasswordsVaultwardenLinkSelf-hosted password manager
📷 PhotosImmichLinkSelf-hosted photo and video management solution
📄 DocumentsPaperlessLinkDocument management system. With per-user Samba share integration (consume & archive)
📔 NotesAFFiNELinkNext-gen knowledge base similar to Notion or Obsidian
🗓️ CalDAV/CardDAVRadicaleLinkContacts, Calender and Tasks synchronization
📁 NASSambaLinkNetwork attached storage. Cross-integration with paperless
🥗 RecipesMealieLinkRecipe manager and meal planner
🏠 Home AutomationHome AssistantLinkAutomation with Home Assistant and many related services
📧 MailserverStalwartLinkModern mail server setup with custom self-service alias management including Bitwarden integration
🧱 MinecraftPaperMCLinkMinecraft game server. Autostart on connect, systemd service with background console, automatic backups
🐒 Local LLMllama-cpp & open-webuiLinkLocal LLM and AI Chat
📊 DashboardGrafanaLinkLogs and metrics dashboard and alerting
📔 Logs DBLokiLinkCentral log aggregation service
📔 Logs AgentPromtailLinkLog shipping agent
📚 TSDBInfluxdb2LinkTime series database for storing host metrics
⏱️ MetricsTelegrafLinkPer-host collection of metrics

General & Miscellaneous

(WIP)

~~~~~~~~~~~~SourceDescription
🗑️ ImpermanenceLinkOnly persist what is necessary. ZFS rollback on boot. Most configuration is will be next to the respective service / program configuration.
  • reverse proxy with wireguard tunnel
  • restic
  • static wireguard mesh
  • unified guests interface for microvms and containers with ZFS integration
  • zoned nftables
  • Secret rekeying, generation and bootstrapping using agenix-rekey
  • Remote-unlockable full disk encryption using ZFS on LUKS
  • Automatic disk partitioning via disko
  • Support for repository-wide secrets at evaluation time (hides PII like MACs)

Structure

If you are interested in parts of my configuration, you probably want to examine the contents of users/, config/, modules/ and hosts/. Also, a lot of interesting modules have been moved to nixos-extra-modules, a separate repository specifically for reusable stuff. The full structure of this flake is described in STRUCTURE.md, but here's a quick breakdown of the what you will find where.

config/global configuration for all hosts
config/optional/optional configuration included by hosts
hosts/<hostname>top-level configuration for <hostname>
modules/classical reusable configuration modules
nix/library functions and flake plumbing
pkgs/Custom packages and scripts
secrets/Global secrets and age identities
users/User configuration and dotfiles

How-To

Add new machine

... incomplete.

  • Add to hosts in flake.nix
  • Create hosts/
  • Fill net.nix
  • Fill fs.nix (you need to know the device /dev/by-id paths in advance for partitioning to work!)
  • Run agenix generate and agenix rekey (create's dummy secrets for initial deploy)

Initial deploy

  • Create a bootable iso disk image with nix build --print-out-paths --no-link .#images.<target-system>.live-iso, dd it to a stick and boot
  • (Alternative) Use an official NixOS live-iso and setup ssh manually
  • Copy the installer from a local machine to the live system with nix copy --to <target> .#nixosConfigurationsMinimal.config.system.build.installFromLive

Afterwards:

  • Run install-system in the live environment, export your zfs pools and reboot
  • Retrieve the new host identity by using ssh-keyscan <host/ip> | grep -o 'ssh-ed25519.*' > hosts/<host>/secrets/host.pub
  • (If the host has guests, also retrieve their identities!)
  • Rekey the secrets for the new identity nix run .#rekey
  • Deploy again

New secret

...

Stuff

  • Generate, edit and rekey secrets with agenix <generate|edit|rekey>

To be able to decrypt the repository-wide secrets (files that contain my PII and are thus hidden from public view), you will need to (be me and) add nix-plugins and point it to ./nix/extra-builtins.nix. The devshell will do this for you automatically. If this doesn't work for any reason, this can also be done manually:

  1. Get nix-plugins: NIX_PLUGINS=$(nix build --print-out-paths --no-link nixpkgs#nix-plugins)
  2. Run all commands with --option plugin-files "$NIX_PLUGINS"/lib/nix/plugins --option extra-builtins-file ./nix/extra-builtins.nix

Misc

Generate self-signed cert, e.g. for kanidm internal communication to proxy:

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
  -keyout selfcert.key -out selfcert.crt -subj \
  "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:sub1.example.com,DNS:sub2.example.com,IP:10.0.0.1"

Access backups

restic -o rclone.program="ssh -p 23 u000000@u000000.your-storagebox.de rclone" -o rclone.args="serve restic --stdio /home/restic/<subuser>/repo" -r rclone: stats
dotfiles
flake
nix
nix-dotfiles
nix-flake
nixos
nixos-configuration
nixos-dotfiles

Contributors

oddlama

1,210 commits

PatrickDaG

1 commits

oddlama/nix-config

❄️ My nix config and dotfiles

Nix

274

1,212 commits

updated Aug 31, 2026

See the code

README

Hosts | Overview | Structure

preview

❄️ My NixOS Configuration

This is my personal nix config which I use to maintain my whole infrastructure, including my homelab, external servers and my development machines.

Hosts

TypeNameHardwarePurpose
💻LaptopnomGigabyte AERO 15-W8 (i7-8750H)My laptop and my main portable development machine Framework when?
🖥️DesktopkromaPC (AMD Ryzen 9 5900X)Main workstation and development machine, also for some occasional gaming
🖥️ServerwardODROID H3Energy efficient SBC for my home firewall and some lightweight services using containers and microvms.
🖥️ServersireThreadripper 1950XHome media server and data storage. Runs all services as microvms.
🖥️ServersausebieneIntel N100Home automation and IoT network isolation
🥔ServerzackbieneODROID N2+Decomissioned. Old home assistant board
☁️VPSsentinelHetzner Cloud serverProxies and protects my local services
☁️VPSenvoyHetzner Cloud serverMailserver

Overview

An overview over what you will find in this repository. I usually put a lot of effort into all my configurations and try to go over every option in detail. I've included the major components in the lists below.

Dotfiles

~~~~~~~~~~~~ProgramSourceDescription
🐚 ShellZSH & StarshipLinkZSH configuration with FZF, starship prompt, sqlite history and histdb-skim for fancy CtrlR
🖥️ TerminalKittyLinkTerminal configuration with nerdfonts and history CtrlShiftH to view scrollback buffer in neovim
🪟 WMniriLinkDynamic tiling window manager
🔋 BarnoctaliaLinkStatusbar, wallpaper and notifications
🌐 BrowserFirefoxLinkFirefox with many privacy settings and betterfox
🖊️ EditorNeovimLinkExtensive neovim configuration, made with nixvim
📜 ManpagerNeovimLinkIsolated neovim as manpager via nixvim
📷 ScreenshotsCustom based on grimblastLinkCustom scripts utilizing grimblast for QR code detection and OCR / satty editing
🎮 GamingSteam & BottlesLinkSetup for gaming
📫 MailThunderbirdLinkYour regular thunderbird setup

Services

~~~~~~~~~~~~ServiceSourceDescription
🛡️ AdblockAdGuard HomeLinkDNS level adblocker
🔒 SSOKanidmLinkIdentity provider for Single-Sign-On on my hosted services, with provisioning.
🐙 GitForgejoLinkForgejo with SSO
🔑 PasswordsVaultwardenLinkSelf-hosted password manager
📷 PhotosImmichLinkSelf-hosted photo and video management solution
📄 DocumentsPaperlessLinkDocument management system. With per-user Samba share integration (consume & archive)
📔 NotesAFFiNELinkNext-gen knowledge base similar to Notion or Obsidian
🗓️ CalDAV/CardDAVRadicaleLinkContacts, Calender and Tasks synchronization
📁 NASSambaLinkNetwork attached storage. Cross-integration with paperless
🥗 RecipesMealieLinkRecipe manager and meal planner
🏠 Home AutomationHome AssistantLinkAutomation with Home Assistant and many related services
📧 MailserverStalwartLinkModern mail server setup with custom self-service alias management including Bitwarden integration
🧱 MinecraftPaperMCLinkMinecraft game server. Autostart on connect, systemd service with background console, automatic backups
🐒 Local LLMllama-cpp & open-webuiLinkLocal LLM and AI Chat
📊 DashboardGrafanaLinkLogs and metrics dashboard and alerting
📔 Logs DBLokiLinkCentral log aggregation service
📔 Logs AgentPromtailLinkLog shipping agent
📚 TSDBInfluxdb2LinkTime series database for storing host metrics
⏱️ MetricsTelegrafLinkPer-host collection of metrics

General & Miscellaneous

(WIP)

~~~~~~~~~~~~SourceDescription
🗑️ ImpermanenceLinkOnly persist what is necessary. ZFS rollback on boot. Most configuration is will be next to the respective service / program configuration.
  • reverse proxy with wireguard tunnel
  • restic
  • static wireguard mesh
  • unified guests interface for microvms and containers with ZFS integration
  • zoned nftables
  • Secret rekeying, generation and bootstrapping using agenix-rekey
  • Remote-unlockable full disk encryption using ZFS on LUKS
  • Automatic disk partitioning via disko
  • Support for repository-wide secrets at evaluation time (hides PII like MACs)

Structure

If you are interested in parts of my configuration, you probably want to examine the contents of users/, config/, modules/ and hosts/. Also, a lot of interesting modules have been moved to nixos-extra-modules, a separate repository specifically for reusable stuff. The full structure of this flake is described in STRUCTURE.md, but here's a quick breakdown of the what you will find where.

config/global configuration for all hosts
config/optional/optional configuration included by hosts
hosts/<hostname>top-level configuration for <hostname>
modules/classical reusable configuration modules
nix/library functions and flake plumbing
pkgs/Custom packages and scripts
secrets/Global secrets and age identities
users/User configuration and dotfiles

How-To

Add new machine

... incomplete.

  • Add to hosts in flake.nix
  • Create hosts/
  • Fill net.nix
  • Fill fs.nix (you need to know the device /dev/by-id paths in advance for partitioning to work!)
  • Run agenix generate and agenix rekey (create's dummy secrets for initial deploy)

Initial deploy

  • Create a bootable iso disk image with nix build --print-out-paths --no-link .#images.<target-system>.live-iso, dd it to a stick and boot
  • (Alternative) Use an official NixOS live-iso and setup ssh manually
  • Copy the installer from a local machine to the live system with nix copy --to <target> .#nixosConfigurationsMinimal.config.system.build.installFromLive

Afterwards:

  • Run install-system in the live environment, export your zfs pools and reboot
  • Retrieve the new host identity by using ssh-keyscan <host/ip> | grep -o 'ssh-ed25519.*' > hosts/<host>/secrets/host.pub
  • (If the host has guests, also retrieve their identities!)
  • Rekey the secrets for the new identity nix run .#rekey
  • Deploy again

New secret

...

Stuff

  • Generate, edit and rekey secrets with agenix <generate|edit|rekey>

To be able to decrypt the repository-wide secrets (files that contain my PII and are thus hidden from public view), you will need to (be me and) add nix-plugins and point it to ./nix/extra-builtins.nix. The devshell will do this for you automatically. If this doesn't work for any reason, this can also be done manually:

  1. Get nix-plugins: NIX_PLUGINS=$(nix build --print-out-paths --no-link nixpkgs#nix-plugins)
  2. Run all commands with --option plugin-files "$NIX_PLUGINS"/lib/nix/plugins --option extra-builtins-file ./nix/extra-builtins.nix

Misc

Generate self-signed cert, e.g. for kanidm internal communication to proxy:

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
  -keyout selfcert.key -out selfcert.crt -subj \
  "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:sub1.example.com,DNS:sub2.example.com,IP:10.0.0.1"

Access backups

restic -o rclone.program="ssh -p 23 u000000@u000000.your-storagebox.de rclone" -o rclone.args="serve restic --stdio /home/restic/<subuser>/repo" -r rclone: stats
dotfiles
flake
nix
nix-dotfiles
nix-flake
nixos
nixos-configuration
nixos-dotfiles

Contributors

oddlama

1,210 commits

PatrickDaG

1 commits

Languages

Nix

97.1%

Shell

2.2%