• Nix 94.9%
  • HTML 1.3%
  • Shell 1.1%
  • Ruby 1%
  • Python 0.8%
  • Other 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-22 00:31:15 +02:00
backgrounds graphical: fix time and background 2026-06-03 00:50:34 +02:00
config auth: fix eval 2026-10-09 23:39:26 +02:00
docs Expand baremetal installation docs 2026-08-15 18:23:51 +02:00
hosts nixos-misc: drop now default 2026-10-21 20:21:02 +02:00
keys Update sandro's key 2025-09-15 01:04:35 +02:00
lib rpx{1,2}: init 2026-10-04 23:25:11 +02:00
modules anubis: also unset Content-Type 2026-10-22 00:31:15 +02: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
.sops.yaml Sort stuff 2026-10-11 03:00:53 +02:00
book.toml Fix mdbook config 2026-06-07 16:29:06 +02:00
flake.lock flake.lock: Update 2026-10-21 20:56:55 +02:00
flake.nix packages: remove self usage 2026-10-16 22:45:07 +02:00
LICENSE Fix year 2025-10-02 16:01:57 +02:00
packages.nix Allocate ttys to support cancellation 2026-10-21 19:43:10 +02:00
README.md public-access-proxy: remove 2026-10-05 22:19:58 +02:00
renovate.json Update renovate.json 2024-11-05 22:16:11 +01:00
ssh-public-keys.nix ssh-public-keys: fix nix code 2026-03-01 23:15:40 +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

Update MicroVM from our Hydra

Our Hydra runs nix flake update daily in the updater.timer, pushing it to the flake-update branch so that it can build fresh systems. This branch is setup as the source flake in all the MicroVMs, so the following is all that is needed on a MicroVM-hosting server:

microvm -Ru $hostname

Secrets management

How to add a new host

Edit .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 host/$host/*.yaml files

Edit a secret

Edit .sops.yaml to add files for a new host and its SSH pubkey.

# Get sops
nix develop
# Decrypt, start EDITOR, encrypt
sops hosts/.../secrets.yaml