Einführung

Zunächst die Basics. Wir haben 2 Server

  • Teefax, unser Hauptserver
  • Verleihnix, unser Testserver (wo wir leider zu wenig testen)

Auf beiden diesen Server läuft NixOS. Teenix ist die Konfiguration die diese NixOS Systeme beschreibt.

Übersicht

  • Teenix ist (offensichtlich) deklarativ. Wir möchten imperativen Zustand möglichst vermeiden.
  • Teenix setzt nicht auf docker, sondern auf NixOS Container. Diese können vollständig aus nix heraus konfiguriert werden und verhalten sich effektiv wie eine NixOS Maschine. Einige Services laufen trotzdem noch in docker, das wollen wir aber langfristig komplett abschaffen.
  • Teenix ist “impernanent”. Das heißt, das standardmässig alle Dateien bei einem Reboot gelöscht werden. Es ist jedoch möglich Dateien/Ordner als “persistent” zu markieren, diese liegen dann unter /persist. Der Vorteil davon ist das das Dateisystem standardmässig aufgeräumt bleibt und sich nicht Müll über Ratsgenerationen ansammelt, von dem niemand weiß ob er noch gebraucht wird.

Dateistruktur

Keine vollständige Auflistung, dient nur der groben Übersicht

├─ doc          - ein mdbook, die dokumentation die du gerade liest
├─ lib          - erweiterung der nixpkgs lib, verfügbar unter lib.teenix
├┬ mod          - das herz von teenix, hier liegen module die zwischen den verschiedenen hosts
││                unterschiedlich konfiguriert werden können.
│└─┬ nixos
│  └── services - die module für all unsere services
├┬ nixos        - konfigurationen der einzelnen hosts
│└─┬ keys       -
│  ├ secrets    - sops secrets
│  ├ teefax     - die konfiguration von teefax
│  ├ verleihnix - die konfiguration von testfax
│  └ share      - geteilte konfiguration, sollte in jedem host unbedingt importiert werden
├─ pkgs         - eigene packages
├─ flake.nix    - der "einstieg" in die konfiguration
├─ overlays.nix - nixpkgs overlays
└─ .sops.yaml   - konfigurationsdatei für sops, nur wer hier eingetragen ist kann die secrets lesen

Container und Services

Hier eine kurze Einführung in Container und Systemd Services.

Systemd Services

Eine systemd Instanz verwaltet (unter anderem) mehrere Services. Diese bestehen aus einem einzelnen Prozess, einer einzelnen Komponente.
Der Webserver unserer Fachschaftswebsite ist ein Service, die dazugehörige Datenbank ein weiterer. Die Services sind nicht sonderlich isoliert voneinander, sie reden z.B. mit dem selben Netzwerk Interface und teilen sich ein Dateisystem.

Container

Container hingegen sind stärker voneinander isoliert, sie sind quasi ein eigenes System. Sie haben ein eigenes Dateisystem und ein eigens Netzwerk Interface. Unter anderem haben sie auch eine eigene Systemd Instanz.

Sie fassen quasi Komponenten zusammen. Um wieder die Fachschaftswebsite als Beispiel zu nehmen:
Es gibt einen Container fscshhude der diese als ganzes repräsentiert. Innerhalb dessen läuft der Webserver und die Datenbank, von außen gesehen interessiert uns das aber nicht. Wir können es von außen auch nicht (ohne weiteres) feststellen, den das “äußere” systemd weiß nicht was das “innere” systemd tut.

Netzwerk

Jedem Container wird automatisch eine eigene IP zugeordnet, außerhalb ist diese 192.18.<id>.11 und innerhalb 192.168.<id>.10.

Dateisystem

Unsere Container sind “ephemeral”, das heißt das das Dateisystem nicht über Container Neustarts persistent ist. Natürlich brauchen sie trotzdem persistente Daten, wir möchten aber entscheiden können welche das sind. Auf dem Host hat jeder Container seinen eigenen Ordner unter /persist wo diese Daten liegen. Damit diese im Container zu sehen sind werden sie in den Container gemountet, z.B. /persist/vaultwarden/data nach /var/lib/vaultwarden

Updating

Schritt 1

Update eines spezifischen Inputs (z.B. nur die Fachschafts Website). Die Namen der Inputs stehen entweder in der flake.nix oder einfach per <TAB> completion.

nix flake update <input>

Vollständiges Update. Wahrhscheinlich nicht so ganz trivial, hier sollte man sich auf jeden Fall darauf einstellen danach noch etwas zu debuggen.

nix flake update

Manche Services (wie z.B. nextcloud) haben die package option gesetzt so das sie nicht immer automatisch geupdatet werden.

Schritt 2

Überprüfen ob alles noch da ist und funktioniert. Besondere Kandidaten sind hier:

  • Nextcloud
  • Traefik (obwohl das ziemlich offensichtlich ist, weil gar nichts mehr geht)

Command Cheatsheet

Services

Der Service Name ist meistens am besten per <TAB> herauszufinden. (Außer bei journalctl, dessen completion ist etwas kaputt)

Liste aller Services

Mit / kann man in dieser Liste auch suchen.

systemctl -atservice

Status eines Service

systemctl status <service>

Service Starten/Stoppen

sudo systemctl stop <service>
sudo systemctl start <service>
sudo systemctl restart <service>

Logs

Das -e springt an das Ende des Logs (was man ja meistens auch möchte). Falls dies nicht gewünscht ist, das -e einfach weglassen

journalctl -xe

Um den Log kontinuierlich zu sehene (neue einträge werden sofort angezeigt)

journalctl -xf

Logs eine spezifischen Services

journalctl -xeu <service>

Auch diese kann man kontinuierlich anzeigen lassen

journalctl -xfu <service>

NixOS-Container

Container auflisten

Reine Auflistung

nixos-container list

Etwas detailreicher, Machines ist ein anderes Wort für Container

machinectl

Container Starten/Stoppen

sudo nixos-container stop <container>
sudo nixos-container start <container>
sudo nixos-container restart <container>

In einen Container einloggen

sudo nixos-container root-login <container>

Logs eines Containers

sudo journalctl -xeM <container>

(Oder im Grafana)

Sops

Secret Keys updaten

Synchronisiert alle secrets mit .sops.yaml und rotiert ihre encryption keys

find nixos/secrets -type f -exec sops updatekeys --yes {} \; -exec sops rotate -i {} \;

Aufräumen

Subvolumes die nicht deklariert sind

Dieser Command printet ordner in /persist, die nicht in teenix deklariert sind.

bash -c 'comm -3 <(find /persist/ -maxdepth 1 -mindepth 1 -type d| sort) <(cat /etc/teenix-persistence.json | jq -r "keys|sort|.[]")'

Deploy A New Service

Repository Struktur

Um einen neuen Service zu deployen sollte man unter mod/nixos/services eine Datei erstellen, welche den Service am besten über einen NixOS Container deployed. Die wenigsten Services sollten auf Teefax selbst laufen. sollte der Service nicht in eine Datei sinnvoll strukturiert werden können, so sollte der service in einen Ordner verschoben werden. Die Struktur in dem Ordner sollte z.B. wie folgt aussehen:

Servicename
| -> default.nix
| -> container.nix

Deployen eines Beispiel Services

Wenn man die wie in Repository Struktur beschriebene Ordnerstruktur erstellt hat, so werden die Dateien automatisch geladen und sind verfügbar. Um die Services konfigurierbar zu machen sollte man also umbeding auf Options setzen. Einige Beispiel Options die wir fast immer haben sind:

  • Enable (enable)
  • Hostname (hostname)
  • Environment File (secretFile)
options.teenix.services.vaultwarden = {
  enable = lib.mkEnableOption "setup vaultwarden";
  hostname = lib.teenix.mkHostnameOption;
  secretsFile = lib.teenix.mkSecretsFileOption "vaultwarden";
};

Die reguläre NixOS config kann nun in eien config block geschreieben werden.

config =
let
  opts = config.teenix.services.vaultwarden;
in
lib.mkIf opts.enable {
  ...
}

Wir verwenden Sops um Secrets zu verschlüsseln und zu verwalten. Um diese einzubinden, muss das secret in die NixOS config eingebunden werden. Hier Doku

Wichtig Um die secrets für alle entschlüsselbar zu machen, muss gpgagent installiert sein und laufen. Des weiteren muss die devSell genutz werden, damit alle Keys der User als auch die von Teefax geladen werden.

NixOS Container

Um die Verwaltung der NixOS Container zu verbessern, haben wir ein eigenes Container Module geschrieben. dieses verwaltet die IP Pools und sämtliche Grundfunktionen, die die meisten unserer Container brauchen. Dies erspart Gehirnschmalz und Tipparbeit. Doku zum Modul

Docker Container

Um Docker Dienste zu deployen ist einiges mehr an aufwand nötig. Hierzu muss die docker-compose.yml in Nix Code umgewandelt werden. Ein tolles Tool dazu ist compose2nix. Nun muss der gnerierte Nix Code noch etwas modifiziert werden und die Secrets über sops eingefügt werden. Wichtig keine Secrets in die nix File schreiben.

Service accessible machen

Um von Aussen auf den Service zuzugreifen, muss der jeweilige Port im Container geöffnet werden:

teenix.containers.vaultwarden = {
  networking = {
    useResolvConf = true;
    ports.tcp = [ 8222 ];
  };
};

Der Service muss nun auch noch durch unsere Reverse Proxy Traefik.
Hierzu haben wir natürlich auch ein Modul Geschrieben. Dies erlaubt uns, unsere Services einfach in Traefik einzubinden. Der einfachste Fall ist ein Service ohne Middleware o.ä.
Doku zum Moul

Alloy

Exportiert unsere SystemD Journals nach Loki

Options

teenix.services.alloy.enable

Whether to enable enable grafana alloy.

Type: boolean

Default: false

Example: true

teenix.services.alloy.extraConfig

extra config for alloy

Type: strings concatenated with “\n”

teenix.services.alloy.loki.exporterName

name of the loki exporter

Type: non-empty string

Default: "loki_write"

teenix.services.alloy.loki.exporterUrl

loki url to export to

Type: non-empty string

Attic

nix binary cache

Options

teenix.services.atticd.enable

Whether to enable the attic binary cache.

Type: boolean

Default: false

Example: true

teenix.services.atticd.hostname

hostname for attic

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.atticd.secretsFile

path to the secrets file for attic

Type: absolute path

Example: ./secrets/myservice.yml

Authentik

Ein SSO (Single Sign On) Provider mit vielen Anbindungsmöglichkeiten. Ein universeller Login für alle Dienste

Options

teenix.services.authentik.enable

Whether to enable authentik.

Type: boolean

Default: false

Example: true

teenix.services.authentik.hostname

hostname for authentik

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.authentik.secretsFile

path to the secrets file for authentik

Type: absolute path

Example: ./secrets/myservice.yml

Bahn Monitor

Tolles Bahn tool das auch essen zeigt. Steht in der FS Info

Options

teenix.services.bahn-monitor.enable

Whether to enable fscs-monitor-plus, a train monitoring service.

Type: boolean

Default: false

Example: true

teenix.services.bahn-monitor.hostname

hostname for fscs-monitor-plus

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Campus Guesser

GeoGuesser für den Campus

Options

teenix.services.campus-guesser-server.enable

Whether to enable campus-guesser-server.

Type: boolean

Default: false

Example: true

teenix.services.campus-guesser-server.hostname

hostname for campus-guesser-server

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.campus-guesser-server.secretsFile

path to the secrets file for campus-guesser-server

Type: absolute path

Example: ./secrets/myservice.yml

NextCloud Office

Backend für NextCloud Office, wir nutzen es für z.B. MS-Office Dateien(würg)

Options

teenix.services.collabora.enable

Whether to enable collabora.

Type: boolean

Default: false

Example: true

teenix.services.collabora.hostname

hostname for collabora

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.collabora.nextcloudHost

Url of the connected NextCloud Instance

Type: string

Teenix Containers

Wie bereits erwähnt benutzt Teenix sehr viele NixOS Container. Um uns die Arbeit etwas einfacher zu machen haben wir uns ein eigenes Modul geschrieben was die containers und teenix.persist Optionen “wrapped” um häufige Konfigurationen umzusetzen.

Überblick

Diese Defaults sind:

  • Den Container Autostarten
  • Das Dateisystem des Containers ephemeral (nicht-persistent) zu machen
  • Dem Container ein eigenes Netzwerk Interface zu geben und diesem IPs zuzuordnen
  • Das Journal (Logs) des Containers in /var/log/containers verfügbar zu machen

Auf Bedarf kann auch:

  • Dem Container DNS Zugriff gewährt werden (standardmässig ist das nämlich nicht der Fall)
  • Ein Subvolume in /persist/<container-name> für persistente Daten erstellt werden
  • Standard Ordner von Datenbanken (postgres, mysql) dorthin mounten
  • Die “data dir” des containers dorthin gemounted werden (/var/lib/<container-name>)
  • TCP/UDP Ports in der Firewall des Containers geöffnet werden
  • Sops Secrets/Templates an den Container weitergereicht werden (damit der Container die Schlüssel nicht kennt)

Options

teenix.containers

Type: attribute set of (submodule)

Default: { }

Example:

{
  config = {
    services = {
      postgresql = {
        enable = true;
      };
    };
    system = {
      stateVersion = "24.11";
    };
  };
  networking = {
    ports = {
      tcp = [
        8000
      ];
    };
  };
}

teenix.containers.<name>.backup

Automatically snapshot this containers persisted subvolume.

In addition to time-based snapshotting, a snapshot is also taken every time the container restarts

Type: boolean

Default: true

Example: false

teenix.containers.<name>.config

The containers NixOS configuration, specified as a file, attribute set or NixOS Module function.

The special arg “host-config” can be used to access the hosts configuration from within the container.

Type: module

Example:

{
  services = {
    postgresql = {
      enable = true;
    };
  };
  system = {
    stateVersion = "24.11";
  };
}

teenix.containers.<name>.extraConfig

Extra Options/Overrides to pass to the underlying container option

Type: attribute set

Default: { }

Example:

{
  timeoutStartSec = "15min";
}

teenix.containers.<name>.machineId

The containers machine-id, uniquely identifiying this container. You shouldn’t ever have to set this yourself.

Used for mounting the systemd journals back to the host.

Type: string matching the pattern ^[a-f0-9]{32} $

Default: lib.substring 0 32 (builtins.hashString "sha256" name) + "\n"

teenix.containers.<name>.mounts.data.enable

Mount (from the containers perspective) /var/lib/<containerName> into persisted storage (at /persist/container/data)

This is a really common pattern. A service named “example” will propably have a container called “example” and place its data within a folder under /var/lib.

Nonetheless, verify if this is actually the case. This option is just a really stupid shortcut.

Type: boolean

Default: false

Example: true

teenix.containers.<name>.mounts.data.name

Change the folder name under /var/lib

This makes this option at least a bit more versatile, and should be used to achieve consistency (data dir at /persist/container/data)

Type: non-empty string

Default: "container name"

Example: "myservice"

teenix.containers.<name>.mounts.data.ownerUid

Owner of the data dir. Since the desired user may not exist on the host, this option takes an id instead of a name.

Be ware, that if set this is enforced and set to this value on a regular basis.

If set to null, the folder will at first be owned by root and its left up to the service to set the correct owner.

The privateUsers option may interfere with this.

Type: null or signed integer

Default: null

Example: config.containers.myservice.config.users.users.myservice.uid

teenix.containers.<name>.mounts.extra

Additional Mounts for the container

Type: attribute set of (submodule)

Default: { }

teenix.containers.<name>.mounts.extra.<name>.hostPath

Path on the host to mount from

Type: null or non-empty string

Default: null

Example: "/mnt/netapp/Nextcloud"

teenix.containers.<name>.mounts.extra.<name>.isReadOnly

Make the mount read-only, prohibiting any modifications (from anything) from within the container

Type: boolean

Default: true

teenix.containers.<name>.mounts.extra.<name>.mode

Be ware, that if set this is enforced and set to this value on a regular basis.

If set to null, the folder will at first be owned by root and its left up to the service to set the correct owner.

The privateUsers option may interfere with this.

Type: non-empty string

Default: "0700"

Example: "0755"

teenix.containers.<name>.mounts.extra.<name>.mountPoint

Path inside the container to mount to

Type: non-empty string

Example: "/var/lib/nextcloud/data"

teenix.containers.<name>.mounts.extra.<name>.ownerUid

Be ware, that if set this is enforced and set to this value on a regular basis.

If set to null, the folder will at first be owned by root and its left up to the service to set the correct owner.

The privateUsers option may interfere with this.

Type: null or signed integer

Default: null

Example: config.users.users.nextcloud.uid

teenix.containers.<name>.mounts.mysql.enable

Mount the container’s mysql data dir into persisted storage (at /persist/container/mysql).

If a mysql database is used within the container, you’ll always want this enabled.

Type: boolean

Default: false

Example: true

teenix.containers.<name>.mounts.postgres.enable

Mount the container’s postgresql data dir into persisted storage (at /persist/container/postgres)

If a postgresql database is used within the container, you’ll always want this enabled.

Type: boolean

Default: false

Example: true

teenix.containers.<name>.mounts.sops.secrets

Names of sops-nix secrets to mount into the container.

Use host-config.sops.secrets.my-secret.path to access the path within the container

Type: list of non-empty string

Default: [ ]

Example: [ "my-secret" ]

teenix.containers.<name>.mounts.sops.templates

Names of sops-nix templates to mount into the container

Use host-config.sops.templates.my-template.path to access the path within the container

Type: list of non-empty string

Default: [ ]

Example: [ "my-template" ]

teenix.containers.<name>.networking.id

Network id this container should be placed in. If null, one is picked automatically

Type: null or non-empty string

Default: null

Example: "192.168.1"

teenix.containers.<name>.networking.ports.tcp

TCP Ports to open in the containers firewall

Type: list of 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default: [ ]

Example:

[
  8080
]

teenix.containers.<name>.networking.ports.udp

UDP Ports to open in the containers firewall

Type: list of 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default: [ ]

Example:

[
  25565
]

teenix.containers.<name>.networking.useResolvConf

Whether to enable Make a resolv.conf file available in the container.

This is required if the container wants to do DNS lookups. .

Type: boolean

Default: false

Example: true

teenix.containers.<name>.privateUsers

Whether to give the container its own private UIDs/GIDs space (user namespacing). This greatly enhances security.

In addition to the options provided by nixos containers, this option also takes a boolean. If true, privateUsers is set to “pick”, If set to false, privateUsers is set to “no”

Type: boolean or 32 bit unsigned integer; between 0 and 4294967295 (both inclusive) or one of “no”, “identity”, “pick”

Default: false

Example: true

Crab.Fit

When2Meet Alternative

Options

teenix.services.crabfit.enable

Whether to enable crab.fit, a meeting scheduler.

Type: boolean

Default: false

Example: true

teenix.services.crabfit.hostnames.backend

hostname for backend for crabfit

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.crabfit.hostnames.frontend

hostname for frontend for crabfit

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Awareness Tool

Awareness Tool

Options

teenix.services.cryptpad.enable

Whether to enable cryptpad.

Type: boolean

Default: false

Example: true

teenix.services.cryptpad.hostname

hostname for cryptpad

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

INPhiMa(PhyNIx) Discord Bot

INPhiMa Reaktion und zuweis Bot für Studiengänge

Options

teenix.services.discord-inphima-bot.enable

Whether to enable discord-inphima-bot.

Type: boolean

Default: false

Example: true

teenix.services.discord-inphima-bot.secretsFile

path to the secrets file for discord-inphima-bot

Type: absolute path

Example: ./secrets/myservice.yml

Dokumentation

Hier liegt diese Website

Options

teenix.services.docnix.enable

Whether to enable serve the documentation.

Type: boolean

Default: false

Example: true

teenix.services.docnix.hostname

hostname for documentation

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Engelsystem

Hier liegt ein Test Helfertool

Options

teenix.services.engelsystem.enable

Whether to enable engelsystem.

Type: boolean

Default: false

Example: true

teenix.services.engelsystem.hostname

hostname for engelsystem

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.engelsystem.secretsFile

path to the secrets file for engelsystem

Type: absolute path

Example: ./secrets/myservice.yml

Freescout

Ticketsystem

Options

teenix.services.freescout.enable

Whether to enable freescout.

Type: boolean

Default: false

Example: true

teenix.services.freescout.hostname

hostname for freescout

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.freescout.mariaEnvFile

path to the sops secret file for the freescout website Server

Type: absolute path

teenix.services.freescout.secretsFile

path to the secrets file for freescout

Type: absolute path

Example: ./secrets/myservice.yml

Fachschafts Website

Die Fachschafts Website, wie man sie kennt und liebt.

Options

teenix.services.fscshhude.enable

Whether to enable fscshhude.

Type: boolean

Default: false

Example: true

teenix.services.fscshhude.secretsFile

path to the secrets file for fscshhude

Type: absolute path

Example: ./secrets/myservice.yml

Nawi Website

Sie haben keinen Server und wir sind nett.

Options

teenix.services.fsnawide.enable

Whether to enable fsnawide.

Type: boolean

Default: false

Example: true

teenix.services.fsnawide.hostname

hostname for fsnawide

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.fsnawide.mariaEnvFile

delete me

Type: absolute path

teenix.services.fsnawide.secretsFile

path to the secrets file for fsnawide

Type: absolute path

Example: ./secrets/myservice.yml

Gatus

Unsere Status Seite

Options

teenix.services.gatus.enable

Whether to enable gatus, a status page.

Type: boolean

Default: false

Example: true

teenix.services.gatus.groups

groups of healthchecks

Type: attribute set of (submodule)

teenix.services.gatus.groups.<name>.endpoints

endpoints of this group

Type: attribute set of (submodule)

teenix.services.gatus.groups.<name>.endpoints.<name>.extraConfig

extra config options for this endpoint

Type: YAML value

Default: { }

teenix.services.gatus.groups.<name>.endpoints.<name>.interval

interval to healthcheck on

Type: non-empty string

Default: cfg.interval

teenix.services.gatus.groups.<name>.endpoints.<name>.name

name of this service

Type: non-empty string

teenix.services.gatus.groups.<name>.endpoints.<name>.status

returned status code to consider the service healthy

Type: null or integer between 0 and 599 (both inclusive)

Default: 200

teenix.services.gatus.groups.<name>.endpoints.<name>.url

url to healthcheck

Type: non-empty string

teenix.services.gatus.groups.<name>.name

display name of this group

Type: non-empty string

teenix.services.gatus.hostname

hostname for gatus

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.gatus.interval

default interval to healthcheck on

Type: non-empty string

Default: "5m"

Hockeypuck

PGP Keyserver

Options

teenix.services.hockeypuck.enable

Whether to enable hockeypuck openpgp key server.

Type: boolean

Default: false

Example: true

teenix.services.hockeypuck.hostname

hostname for pgp keyserver

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Immich

Unser Photo Server

Options

teenix.services.immich.enable

Whether to enable immich, a photo server.

Type: boolean

Default: false

Example: true

teenix.services.immich.hostname

hostname for immich

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.immich.secretsFile

path to the secrets file for immich

Type: absolute path

Example: ./secrets/myservice.yml

INPhiMa Website

Die INPhiMa Website, legacy crap vom feinsten

Options

teenix.services.inphimade.enable

Whether to enable inphimade.

Type: boolean

Default: false

Example: true

teenix.services.inphimade.hostname

hostname for inphimade

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.inphimade.mariaEnvFile

delete me

Type: absolute path

teenix.services.inphimade.secretsFile

path to the secrets file for inphimade

Type: absolute path

Example: ./secrets/myservice.yml

Matrix

Matrix. Man kennt es, man liebt es, man hat große Angst das es kaputt geht und alle Sessions gelöscht werden.

Options

teenix.services.matrix.enable

Whether to enable matrix.

Type: boolean

Default: false

Example: true

teenix.services.matrix.hostnames.element-web

hostname for element-web

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.hostnames.homeserver

hostname for homeserver name

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.hostnames.hookshot

hostname for hookshot

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.hostnames.mas

hostname for matrix authentication service

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.hostnames.matrix

hostname for matrix

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.hostnames.sydent

hostname for sydent

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.matrix.secretsFile

path to the secrets file for matrix

Type: absolute path

Example: ./secrets/myservice.yml

Interner Matrix Bot

Matrix Bot für unseren internen Matrix Space

Options

teenix.services.matrix-intern-bot.enable

Whether to enable setup matrix-intern-bot.

Type: boolean

Default: false

Example: true

teenix.services.matrix-intern-bot.secretsFile

path to the secrets file for matrix-intern-bot

Type: absolute path

Example: ./secrets/myservice.yml

Minecraft

Ein Minecraft Server! Darf nicht fehlen

Options

teenix.services.minecraft.enable

Whether to enable minecraft server.

Type: boolean

Default: false

Example: true

NextCloud

Unser besonderes Baby

Options

teenix.services.nextcloud.enable

Whether to enable nextcloud.

Type: boolean

Default: false

Example: true

teenix.services.nextcloud.extraApps

nextcloud apps to install

Type: list of string

Default: [ ]

teenix.services.nextcloud.hostname

hostname for nextcloud

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.nextcloud.secretsFile

path to the secrets file for nextcloud

Type: absolute path

Example: ./secrets/myservice.yml

Node Exporter

Prometheus Exporter für Node Statistiken, wie CPU Auslastung etc

Options

teenix.services.node_exporter.enable

Whether to enable node_exporter.

Type: boolean

Default: false

Example: true

Ntfy

Notification Service, worüber wir unsere Alerts verschicken

Options

teenix.services.ntfy.enable

Whether to enable ntfy.

Type: boolean

Default: false

Example: true

teenix.services.ntfy.hostname

hostname for ntfy

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Persistent Storage

Hier sollte dringend mehr Text stehen!

Options

teenix.persist.enable

A wrapper arround impermanence and btrbk. Expects a btrfs filesystem with the following layout:

  • /root <- The actual root mounted at /
  • /nix <- The root for all things nix. Mounted at /nix
  • /persist <- The root of all other persistent storage, mounted at /persist

Note: For systems that use more than one (logical) drive, simply mount more

Type: boolean

Default: false

Example: true

teenix.persist.path

The root directory for all of non generated persistent storage, except /nix and /boot.

Type: non-empty string

Default: "/persist"

teenix.persist.subvolumes

Subvolumes that should be persistent.

Type: attribute set of (submodule)

Default: { }

teenix.persist.subvolumes.<name>.backup

Whether to enable automatic snapshotting of this subvolume.

Type: boolean

Default: true

Example: true

teenix.persist.subvolumes.<name>.backupUnitTriggers

List of unit names. If any of these units get started or restarted during activation, backup this subvolume.

Type: list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)

Default: [ ]

teenix.persist.subvolumes.<name>.bindMountDirectories

Whether all directories inside this subvolume should be bind-mounted to their respective paths in / (according to their name).

Type: boolean

Default: false

Example: true

teenix.persist.subvolumes.<name>.directories

Directories that should be created per default inside the subvolume

Type: attribute set of (submodule)

Default: { }

teenix.persist.subvolumes.<name>.directories.<name>.group

Group for this directory. If set to null, the group will not be enforced

Type: null or signed integer or non-empty string

Default: "root"

teenix.persist.subvolumes.<name>.directories.<name>.mode

Mode for this directory. If set to null, the mode will not be enforced

Type: null or non-empty string

Default: "0755"

teenix.persist.subvolumes.<name>.directories.<name>.owner

Owner for this directory. If set to null, the owner will not be enforced

Type: null or signed integer or non-empty string

Default: "root"

teenix.persist.subvolumes.<name>.group

The group of the subvolume. If set to null, the group will not be enforced

Type: null or signed integer or non-empty string

Default: "root"

teenix.persist.subvolumes.<name>.mode

The mode of the subvolume. If set to null, the mode will not be enforced

Type: null or non-empty string

Default: "0755"

teenix.persist.subvolumes.<name>.owner

The owner of the subvolume. If set to null, the owner will not be enforced

Type: null or signed integer or non-empty string

Default: "root"

teenix.persist.subvolumes.<name>.path

Path this subvolume will be mounted at

Type: non-empty string (read only)

Default: "/persist/‹name›"

PhyNIx Website

PhyNIx Website

Options

teenix.services.phynixhhude.enable

Whether to enable phynixhhude.

Type: boolean

Default: false

Example: true

teenix.services.phynixhhude.hostname

hostname for phynixhhude

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.phynixhhude.secretsFile

path to the secrets file for phynixhhude

Type: absolute path

Example: ./secrets/myservice.yml

Pretix

System um Tickets für die Erstifahrt zu buchen

Options

teenix.services.pretix.enable

Whether to enable pretix.

Type: boolean

Default: false

Example: true

teenix.services.pretix.email

from email address

Type: string

teenix.services.pretix.hostname

hostname for pretix

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Prometheus

Metrics für alles mögliche. Irgendwie ist in dem Module auch noch ein Grafana und ein Loki drinne, sollte mal jemand refactorn

Options

teenix.services.prometheus.enable

Whether to enable prometheus.

Type: boolean

Default: false

Example: true

teenix.services.prometheus.hostnames.grafana

hostname for prometheus

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.prometheus.hostnames.prometheus

hostname for prometheus

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.prometheus.secretsFile

path to the secrets file for prometheus

Type: absolute path

Example: ./secrets/myservice.yml

Sitzungsverwaltung

Sitzungsverwaltung verwaltet Sitzungen

Options

teenix.services.sitzungsverwaltung.enable

Whether to enable sitzungsverwaltung.

Type: boolean

Default: false

Example: true

teenix.services.sitzungsverwaltung.hostname

hostname for sitzungsverwaltung

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

static-files Datenschutz und So

static-files Datenschutz und So

Options

teenix.services.static-files.enable

Whether to enable static-files. simple, stupid http file serving.

Type: boolean

Default: false

Example: true

teenix.services.static-files.hostname

hostname for static-files

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Traefik

Unser Reverse Proxy

Options

teenix.services.traefik.enable

Whether to enable traefik.

Type: boolean

Default: false

Example: true

teenix.services.traefik.dashboard.enable

Whether so serve the traefik dashboard.

It will only be accessible from within the PhyNIx HHU Subnet

Type: boolean

Default: false

Example: true

teenix.services.traefik.dashboard.url

url to serve the dashboard on

Type: non-empty string

teenix.services.traefik.dynamicConfig

Traefik’s dynamic config options.

This is passed through sops-nix templating, so you can use sops.placeholders to insert secrets into the config

Type: YAML value

Default: { }

teenix.services.traefik.entryPoints

Traefik’s entrypoints, as defined in the static config

Type: attribute set of (submodule)

Default: { }

teenix.services.traefik.entryPoints.<name>.extraConfig

extra config options for this entrypoint

Type: YAML value

Default: { }

teenix.services.traefik.entryPoints.<name>.port

port of this entrypoint

Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

teenix.services.traefik.entryPoints.<name>.protocol

protocol of this entrypoint

Type: one of “tcp”, “udp”

Default: "tcp"

teenix.services.traefik.httpServices

http based services, each using a single per-service router

Type: attribute set of (submodule)

Default: { }

teenix.services.traefik.httpServices.<name>.extraConfig

extra config options for this services, as defined in the dynamic config

Type: YAML value

Default: { }

teenix.services.traefik.httpServices.<name>.healthCheck.enable

Whether to enable health checking for this service.

Type: boolean

Default: false

Example: true

teenix.services.traefik.httpServices.<name>.healthCheck.interval

interval between health checks

Type: non-empty string

Default: "10s"

teenix.services.traefik.httpServices.<name>.healthCheck.path

path to healthcheck on

Type: string

Default: "/"

teenix.services.traefik.httpServices.<name>.router.entryPoints

entryPoints for this router

if tls is enabled, uses websecure (https) by default;

Type: list of non-empty string

Default: [ ]

teenix.services.traefik.httpServices.<name>.router.extraConfig

extra config options for this router

Type: YAML value

Default: { }

teenix.services.traefik.httpServices.<name>.router.middlewares

list of middlewares for this router

Type: list of non-empty string

Default: [ ]

teenix.services.traefik.httpServices.<name>.router.rule

rule for this router, see https://doc.traefik.io/traefik/routing/routers/#configuring-http-routers

Type: non-empty string

teenix.services.traefik.httpServices.<name>.router.tls.enable

Whether to enable tls for this router.

Type: boolean

Default: true

Example: true

teenix.services.traefik.httpServices.<name>.router.tls.certResolver

certificate resolver for this router

Type: non-empty string

Default: "letsencrypt"

teenix.services.traefik.httpServices.<name>.servers

hosts for this service

Type: list of non-empty string

Default: [ ]

teenix.services.traefik.letsencryptMail

The email address used for letsencrypt certificates

Type: non-empty string

teenix.services.traefik.middlewares

Traefik’s middlewares, as defined in the dynamic config

Type: YAML value

Default: { }

teenix.services.traefik.redirects

Permanently redirect one URL to another

Type: attribute set of (submodule)

Default: { }

Example:

{
  fscs_phynix = {
    from = "fscs.phynix-hhu.de";
    to = "fscs.hhu.de";
  };
}

teenix.services.traefik.redirects.<name>.from

url to redirect from

Type: string

teenix.services.traefik.redirects.<name>.to

url to redirect to

Type: string

teenix.services.traefik.secretsFile

path to the secrets file for traefik

Type: absolute path

Example: ./secrets/myservice.yml

teenix.services.traefik.staticConfig

Traefik’s static config options.

This is passed through sops-nix templating, so you can use sops.placeholders to insert secrets into the config

Type: YAML value

Default: { }

Tür Sensor

Tür auf? Tür zu? Schrödingers Tür?

Options

teenix.services.tuer-sensor.enable

Whether to enable was-letzte-tuer, ein toller tür sensor.

Type: boolean

Default: false

Example: true

teenix.services.tuer-sensor.hostname

hostname for tuer-sensor

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Uptime Kuma

Uptime Monitor der uns anschreit wenn ein ganzer Host down ist

Options

teenix.services.uptime-kuma.enable

Whether to enable uptime-kuma.

Type: boolean

Default: false

Example: true

teenix.services.uptime-kuma.hostname

hostname for uptime-kuma

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

Vaultwarden

Unser Passwort Manager, Bitwarden self-hosted edition

Options

teenix.services.vaultwarden.enable

Whether to enable vaultwarden.

Type: boolean

Default: false

Example: true

teenix.services.vaultwarden.hostname

hostname for vaultwarden

Type: non-empty string

Example: "nextcloud.phynix-hhu.de"

teenix.services.vaultwarden.secretsFile

path to the secrets file for vaultwarden

Type: absolute path

Example: ./secrets/myservice.yml