• Nix 95%
  • HTML 1.3%
  • Shell 1.1%
  • Ruby 1%
  • Python 0.7%
  • Other 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-06 04:44:33 +01:00
backgrounds graphical: fix time and background 2026-06-03 00:50:34 +02:00
config gradient: add nix features for container tests 2026-10-24 17:03:50 +02:00
docs Move secrets to extra repo 2026-12-04 02:44:03 +01:00
hosts zammad: update postgresql 2026-12-06 04:44:33 +01:00
lib Add missing domain to mta-sts 2026-11-08 02:20:16 +01:00
modules Migrate journald settings 2026-12-06 01:00:01 +01:00
.envrc envrc: fix direnv-instant 2025-11-26 01:39:34 +01:00
.git-blame-ignore-revs git-blame-ignore-revs: add format commit 2023-05-16 23:16:11 +02:00
.gitattributes Fix sops diff filter 2023-12-28 22:24:01 +01:00
.gitignore Ignore my submodule 2024-03-12 01:37:03 +01:00
book.toml Fix mdbook config 2026-06-07 16:29:06 +02:00
flake.lock flake.lock: Update 2026-12-06 03:54:20 +01:00
flake.nix Bump everything to 26.11 2026-12-05 22:24:38 +01:00
LICENSE Fix year 2025-10-02 16:01:57 +02:00
packages.nix packages: fix secrets location condition for caveman 2026-12-06 03:11:18 +01:00
README.md Delete lies from the documentation 2026-12-04 23:00:14 +01:00
renovate.json Update renovate.json 2024-11-05 22:16:11 +01:00
ssh-public-keys.nix adding ssh-rsa pub key for eri 2026-12-04 20:16:15 +01:00

C3D2 infrastructure based on NixOS

Online version at https://docs.zentralwerk.org

Further documentation

Helpful tools

Laptops / Desktops

This repo could be used in the past as a module. While still technically possible, it is not recommended because the amounts of flake inputs highly increased and the modules are not designed with that in mind.

For end user modules take a look at the c3d2-user-module.

For the deployment options take a look at deployment.

Use flake inputs

nixpkgs/nixos

The nixpkgs/nixos input used lives at https://github.com/NuschtOS/nuschtpkgs/tree/backports-25.05. We are using a fork managed by sandro to make backports, cherry-picks and custom fixes dead easy. If you want to have an additional backport, cherry-pick or other change, please contact sandro.

nixos-modules repo

The nixos-modules repo lives at https://github.com/NuschtOS/nixos-modules and is mirrored to https://gitea.c3d2.de/c3d2/nixos-modules. Auto generated documentation about all options is available at https://nuschtos.github.io/nixos-modules/. It contains options sandro shares between his private nixos configs and the C3D2 one and which others also started to use. It sets many options by default and when searching for a particular setting you should always grep this repo, too. In question ask sandro and consider improving the documentation about this with comments and readme explanations. Something should be changed/added/removed/etc? Please create a PR or start a conversations with your ideas.

SSH access

If people should get root access to all machines, their keys should be added to ssh-public-keys.nix.

Deployment

Deploy to a remote NixOS system

For every host that has a nixosConfiguration in our Flake, there are two scripts that can be run for deployment via ssh.

  • nix run .#HOSTNAME-nixos-rebuild switch

    Copies the current state to build on the target system. This may fail due to resource limits on e.g.: Raspberry Pis.

  • nix run .#HOSTNAME-nixos-rebuild-local switch

    Builds everything locally, then uses nix copy to transfer the new NixOS system to the target.

    To use our nix binary cache set the following nix options similar to enabling flakes:

    trusted-public-keys = gradient.c3d2.de-main:Huerx2/tXWXB+5C3nxkOLZtYYF5odPVudhhUDEc+BmA=
    extra-substituters = https://gradient.c3d2.de/cache/main
    

    This can also be set with the c3d2.addBinaryCache option from the c3d2-user-module.

Checking for updates

nix run .#list-upgradable

list-upgradable output

Checks all hosts with a nixosConfiguration in flake.nix.

Deploy a MicroVM

Build a microvm remotely and deploy:

nix run .#microvm-update-HOSTNAME

Build MicroVM locally and deploy:

nix run .#microvm-update-HOSTNAME-local

Secrets management

SOPS files and configuration live in the sibling nix-secrets repository. From this repository, enter it before using the SOPS development shell:

cd ../nix-secrets
nix develop

How to add a new host

Edit nix-secrets/.sops.yaml:

  1. Add an AGE key for this host. Comments in this file tell you how to do it.
  2. Add a creation_rules section for hosts/$host/*.yaml files.

Edit a secret

# From the nix-secrets repository root; decrypt, edit, and re-encrypt.
sops hosts/.../secrets.yaml