No description
Find a file
Moritz 'e1mo' Fromm 6bdafe2bbe
Diff server closures on pull_request
Also updated the triggers, only building on pushes to main since the
rest will eventually be a PR to main, so that the we can ditch the avoid
duplicates action.
2023-07-24 18:32:34 +02:00
.github/workflows Diff server closures on pull_request 2023-07-24 18:32:34 +02:00
common Remove n0emis due to them leaving the admin team 2023-07-17 11:54:39 +02:00
hosts services/freescout: Initial setup 2023-04-13 18:38:10 +02:00
packages Remove redundand dokuwii override+openssh settings 2023-02-10 15:30:09 +01:00
secrets Remove n0emis from sops 2023-07-17 12:20:02 +02:00
services website: Clear old generations on dev 2023-07-22 21:18:55 +02:00
.envrc Initial commit 2022-11-27 23:11:34 +01:00
.gitattributes dokuwiki: Initial service setup 2022-12-30 14:57:33 +01:00
.gitignore dokuwiki: Initial service setup 2022-12-30 14:57:33 +01:00
.sops.yaml Remove n0emis from sops 2023-07-17 12:20:02 +02:00
CODEOWNERS Add CODEOWNERS 2023-02-15 12:55:50 +01:00
flake.lock Flake update 2023-05-20 00:43:55 +02:00
flake.nix Colmena: Add deployment tags and block deploy all 2023-05-20 00:48:06 +02:00
README.md services/freescout: Initial setup 2023-04-13 18:38:10 +02:00

chaos-jetzt nixfiles

NixOS configuration for the chaos.jetzt project. They are very much work in progress

(Migration) TODOs

Development setup

These nixfiles are built using nix flakes. See here for nix installation instructions and the nixos.wiki page on flakes. colmena is used for deployment, secret management is done using the sops based sops-nix. The later two (colmena and sops) are available via a devShell, defined in the flake, which can be invoked using nix develop. nix-direnv can also be used in order to automatically create the respective shell upon entering these nixfiles.

Deployment

colmena is used for deployment:

# Build all hosts
colmena build
# Build specific host(s)
colmena build --on host-a,host-b

# Deploy all hosts in test mode (activate config but do not add it to the bootloader menu)
colmena apply test

# Deploy specific host (actiavte config and use it at the next boot (switch goal))
colmena apply --on host-a

# A VM of the host can be built using plain nix build

nix build .\#nixosConfigurations.host-a.config.system.build.vmWithBootLoader

Note on VMs: Since the secrets are decrypted for each servers ssh key, the secrets setup will fail.

Secrets

Secrets are managed using sops-nix which is based on sops. All secrets are stored in the secrets/ folder. The .sops.yaml configuration file contains information on who has (a) access to keys and (b) which servers can decrypt which keys.

A servers private key can be derived from it's ssh key using ssh-to-age, generated during initial installation:

# Only ed25519 keys can be converted using ssh-to-age
ssh-keyscan -t ed25519 shirley.net.chaos.jetzt | nix shell nixpkgs#ssh-to-age -c ssh-to-age
# Or from the host (using legacy nix-shell)
cat /etc/ssh/ssh_host_ed25519_key.pub | nix-shell -p ssh-to-age --run ssh-to-age

When users or servers get added or removed, the secret files need to be updated using sops updatekeys. Since this can not be called on all files, find secrets -type f -exec sops updatekeys {} \; may be used for convenience.