Commit graph

47 commits

Author SHA1 Message Date
steffen
841568fcdc add jq to forgejo-runner hostPackages for release creation
All checks were successful
CI / flake-check (pull_request) Successful in 36s
CI / build-hosts (pull_request) Successful in 33s
2026-03-14 15:50:37 +01:00
steffen
db260115a9 fix SD image CI: use find -L to follow symlinks in Nix store
All checks were successful
CI / flake-check (pull_request) Successful in 35s
CI / build-hosts (pull_request) Successful in 34s
The built image is a symlink in the Nix store. find with -type f
skips symlinks, causing 'No image found' error.
2026-03-14 15:38:42 +01:00
steffen
c141e22feb updated digingest 2026-03-14 15:37:09 +01:00
steffen
c2db28eb29 rewrite AGENTS.md: comprehensive agent guidelines
Rewritten from scratch with accurate project state:
- Correct deployment strategy (Comin, not deploy-rs)
- All 4 apps documented (create, deploy, install, rebuild)
- Module pattern with inherit and assertions
- Host service file pattern with constants usage
- lib.utils helpers documented
- Secret path naming convention
- Complete directory structure with current file layout
- Verification checklist including English docs requirement
2026-03-14 15:36:18 +01:00
steffen
a0da5be8fc translate all docs to English
Translate 8 documentation files from German to English:
- docs/index.md (complete)
- docs/getting-started/first-install.md (complete)
- docs/getting-started/new-client.md (complete)
- docs/getting-started/reinstall.md (complete)
- docs/getting-started/sd-image.md (complete)
- docs/deployment/dns.md (PTR, Hetzner, checklist sections)
- docs/services/tailscale.md (code comments)
- docs/services/forgejo.md (placeholder names)
2026-03-14 15:31:50 +01:00
steffen
c81b43530a remove markdown-preview plugin, re-enable Pi builds in CI
All checks were successful
CI / flake-check (pull_request) Successful in 35s
CI / build-hosts (pull_request) Successful in 6m51s
markdown-preview.nvim runs yarn install with native Node.js binaries
that crash under QEMU aarch64 emulation. The plugin is also useless
on headless servers (requires a browser). Removing it allows the Pi
build to succeed in CI again.

Re-enabled Pi build and SD image jobs in both ci.yml and deploy.yml.
2026-03-14 15:12:24 +01:00
steffen
2a418868e6 disable Pi builds in CI: QEMU crashes on aarch64 Node.js packages
markdown-preview.nvim runs yarn install which compiles native binaries.
Under QEMU aarch64 emulation on x86_64 this causes 'Illegal instruction'
crashes. Pi images must be built locally or on a native aarch64 runner.

Pi deployment still works via Comin (builds locally on the Pi itself).
2026-03-14 15:08:35 +01:00
steffen
2155f4073f fix Pi build: force initrd modules to exclude x86 hardware
Some checks failed
CI / flake-check (pull_request) Successful in 31s
CI / build-hosts (pull_request) Failing after 1m23s
sd-image.nix imports all-hardware.nix which adds modules like dw-hdmi
that don't exist in the RPi4 kernel. mkForce the availableKernelModules
list to only include Pi-relevant modules.
2026-03-14 15:04:29 +01:00
steffen
6ad46e7452 fix Pi build and CI pipeline ordering
Some checks failed
CI / flake-check (pull_request) Successful in 33s
CI / build-hosts (pull_request) Failing after 47s
- Fix Pi kernel build: disable includeDefaultModules in initrd.
  NixOS all-hardware.nix includes dw-hdmi which doesn't exist in
  the RPi4 kernel 6.12, causing module-shrunk to fail.
- Fix CI: SD image build now depends on build-hosts instead of
  flake-check, so it won't run if the Pi build fails.
- Apply same fix to raspberry-pi template.
2026-03-14 14:56:10 +01:00
steffen
4e36cca637 remove all deploy-rs references from docs and config
- Update README, AGENTS.md, docs/index.md, docs/deployment/cd.md,
  docs/services/forgejo.md: replace deploy-rs with Comin everywhere
- Fix repo URL references (cryodev-server -> cryodev)
- Fix forgejo admin create command to use shell alias
- Rewrite cd.md for Comin-only deployment
2026-03-14 14:52:30 +01:00
steffen
a4dfbdcd52 remove deploy-rs completely
Some checks failed
Deploy / flake-check (push) Successful in 37s
Deploy / build-hosts (push) Failing after 50s
Deploy / build-pi-images (cryodev-pi) (push) Failing after 29s
Deploy / create-release (push) Has been skipped
- Remove deploy-rs flake input
- Remove deploy block from flake.nix
- Remove deployChecks from flake checks
- Remove deploy-rs from forgejo-runner hostPackages
- Deployment is now handled by Comin (auto) and nix run .#deploy (manual)
2026-03-14 14:47:49 +01:00
steffen
e9a5af27e9 remove sid.ovh and clean up gitignore 2026-03-14 14:44:44 +01:00
steffen
c45a603d1c replace deploy-rs CI with Comin pull-based deployment
- Add Comin service for cryodev-main (polls git repo, auto-deploys)
- Fix cryodev-pi Comin URL (cryodev-server.git -> cryodev.git)
- Remove deploy-rs from CI pipeline (was insecure with shared runner)
- Remove deploy SSH key, root SSH login, sudo rules for gitea-runner
- Revert PermitRootLogin back to 'no'
- CI now only runs flake-check + build (no deploy)
- Deployment happens via Comin (both hosts poll and self-deploy)
2026-03-14 14:43:15 +01:00
steffen
ed806bf5fb fix CI deploy: use global SSH config for deploy-rs
The nix-daemon runs as root and cannot access the gitea-runner user's
~/.ssh directory. Solution: write the deploy key and SSH config to
/etc/deploy/ and /etc/ssh/ssh_config.d/ which are readable by all
users including the nix-daemon.

- Deploy key is written to /etc/deploy/key (cleaned up after deploy)
- SSH config in /etc/ssh/ssh_config.d/deploy.conf (cleaned up after)
- Minimal NOPASSWD sudo rules for gitea-runner to manage these files
- Reverts local deploy approach, back to deploy-rs over SSH
2026-03-14 14:35:56 +01:00
steffen
e2e87d5694 switch CI deploy to local nixos-rebuild instead of deploy-rs over SSH
Runner runs on the same server it deploys to, so SSH to itself was
unnecessarily complex. Now builds locally and activates directly.

- Replace deploy-rs SSH workflow with local build + switch
- Add NOPASSWD sudo for gitea-runner to run nix-env and
  switch-to-configuration (required for local deployment)
- Remove SSH key setup from deploy workflow
2026-03-14 14:33:06 +01:00
steffen
4ef5199810 fix deploy-rs: add StrictHostKeyChecking to sshOpts
Some checks failed
Deploy / flake-check (push) Successful in 35s
Deploy / deploy-cryodev-main (push) Failing after 23s
Deploy / build-pi-images (cryodev-pi) (push) Failing after 29s
Deploy / create-release (push) Has been skipped
deploy-rs ignores NIX_SSHOPTS and only uses its own sshOpts.
The host key verification prompt was blocking the non-interactive
CI pipeline. Adding accept-new to sshOpts directly.
2026-03-14 14:28:56 +01:00
steffen
8b467f071f fix deploy-rs: set sshUser=root explicitly, fix host key verification
Some checks failed
Deploy / flake-check (push) Successful in 35s
Deploy / deploy-cryodev-main (push) Has been cancelled
Deploy / create-release (push) Has been cancelled
Deploy / build-pi-images (cryodev-pi) (push) Has been cancelled
deploy-rs was using 'gitea-runner' as ssh_user because the runner
process runs as that user. Set sshUser=root at the node level.
Also add StrictHostKeyChecking=accept-new as fallback for host key.
2026-03-14 14:26:51 +01:00
steffen
5607cad78f make templates user-agnostic
Some checks failed
Deploy / flake-check (push) Successful in 40s
Deploy / deploy-cryodev-main (push) Has been cancelled
Deploy / create-release (push) Has been cancelled
Deploy / build-pi-images (cryodev-pi) (push) Has been cancelled
Templates should not reference specific users. Users are added
manually when creating a new host from the template.
2026-03-14 14:22:21 +01:00
steffen
7c7eaf32af remove cryotherm user from all hosts and templates 2026-03-14 14:18:05 +01:00
steffen
402086b374 move deploy key to host config, add ralph and benjamin users
- Move forgejo-deploy pubkey from users/steffen to hosts/cryodev-main/
  (deploy key belongs to the host, not a user)
- Remove deploy key from steffen's authorized keys
- Add users ralph and benjamin (pubkeys pending)
- Register both new users in cryodev-main host config
2026-03-14 14:15:40 +01:00
steffen
92abe2574d enable root SSH key-only login for deploy-rs
- Change PermitRootLogin from 'no' to 'prohibit-password' (key-only)
- Add forgejo-deploy public key to root's authorized_keys
- Revert deploy-rs user back to root (needs root for activation)

Root can only login via SSH key, password auth remains disabled.
2026-03-14 14:13:26 +01:00
steffen
3f07d27c78 fix deploy-rs: use SSH port 2299 and user steffen instead of root
deploy-rs was configured with default port 22 and user root, but
SSH runs on port 2299 and root login is disabled. Also fix ssh-keyscan
in the deploy workflow to use the correct port.
2026-03-14 14:11:08 +01:00
steffen
72e53ea17f add forgejo-deploy SSH key for CI/CD pipeline deployment
Some checks failed
Deploy / flake-check (push) Successful in 32s
Deploy / deploy-cryodev-main (push) Failing after 2s
Deploy / build-pi-images (cryodev-pi) (push) Failing after 1m18s
Deploy / create-release (push) Has been skipped
2026-03-14 14:05:30 +01:00
steffen
14d02a0c57 fix CI: use runs-on host, remove install-nix-action
Some checks failed
Deploy / flake-check (push) Successful in 45s
Deploy / deploy-cryodev-main (push) Failing after 1s
Deploy / build-pi-images (cryodev-pi) (push) Failing after 57s
Deploy / create-release (push) Has been skipped
Runner has label 'host' not 'docker'. Jobs were stuck in 'waiting to
run' because no runner matched the docker label. Also removed the
cachix/install-nix-action steps since Nix is already available on the
host runner.
2026-03-14 13:56:31 +01:00
steffen
8d7794a08c restructure CI/CD: flake-check gates all deployments
Some checks are pending
Deploy / flake-check (push) Waiting to run
Deploy / deploy-cryodev-main (push) Blocked by required conditions
Deploy / build-pi-images (cryodev-pi) (push) Blocked by required conditions
Deploy / create-release (push) Blocked by required conditions
Consolidate 4 separate workflows into 2:

- ci.yml (pull_request): flake-check -> build-hosts
- deploy.yml (push to main): flake-check -> deploy + build-pi-images

Previously, deploy and build-pi-image ran on push to main without
any checks. Now flake-check must pass before anything gets deployed
or built.
2026-03-14 13:52:21 +01:00
steffen
d623a01ebd fix ACME: set default group to nginx for webroot permissions
Some checks failed
Build Raspberry Pi SD Images / create-release (push) Has been cancelled
Build Raspberry Pi SD Images / build-pi-images (cryodev-pi) (push) Has been cancelled
Deploy cryodev-main / deploy-cryodev-main (push) Has been cancelled
The ACME challenge directory was created with group 'acme' but nginx
needs read access to serve challenge responses. Setting defaults.group
to 'nginx' ensures all ACME directories are accessible by nginx.
2026-03-14 13:45:08 +01:00
steffen
5225974c2a fix headplane: disable strict config validation
NixOS headscale module generates a minimal config.yaml with only
explicitly set values. Headplane with config_strict=true rejects this
because fields like database, derp, dns, listen_addr are missing
(headscale fills these with internal defaults). Setting config_strict
to false makes headplane tolerate the incomplete config.
2026-03-14 13:25:59 +01:00
steffen
bd165bc592 docs: add Hetzner PTR record setup instructions 2026-03-14 13:05:14 +01:00
steffen
9f4f8b9c97 complete DNS docs: add www, PTR record, DKIM checklist, fix SSH port 2026-03-14 12:58:15 +01:00
steffen
da219a52ec fix forgejo-runner: use local URL instead of public FQDN
Runner on the same host cannot reach Forgejo via the public HTTPS URL
during boot (ACME certs not ready, nginx not fully up). Use the local
HTTP endpoint instead.
2026-03-14 12:52:46 +01:00
steffen
82f3be3b9d fix forgejo-runner token: use SOPS template with TOKEN= prefix
The gitea-actions-runner NixOS module expects tokenFile to be an
EnvironmentFile containing TOKEN=<value>, but sops-nix writes only
the raw secret value. Use a sops template to prepend TOKEN= prefix.
2026-03-14 12:43:07 +01:00
steffen
086e760b9e fix forgejo admin create command to use shell alias 2026-03-14 12:36:13 +01:00
steffen
7e31405f91 rename admin_key to steffen_key, add forgejo admin account step
- Rename SOPS key alias from generic admin_key to steffen_key in
  .sops.yaml and all docs (keys should identify the person, not a role)
- Add step 3.6 to first-install docs: create Forgejo admin account
  via CLI (required since DISABLE_REGISTRATION is enabled)
- Fix cryodev-pi_key comment naming in .sops.yaml
2026-03-14 12:33:09 +01:00
steffen
dbf98e2f22 add .gitignore, fix headscale CLI to use numeric user IDs
- Add .gitignore for nix build result symlinks
- Fix all headscale CLI commands: --user now requires numeric ID,
  not username (changed in newer headscale versions)
- Add 'headscale users list' step to docs where preauth keys are created
2026-03-14 12:28:47 +01:00
steffen
4c560abffd split forgejo-runner into own service file for staged deployment
- Extract forgejo-runner config from forgejo.nix into forgejo-runner.nix
- Move forgejo-runner to stage 2 (requires running Forgejo for token)
- Remove all stage-2 secrets from sops.nix (each service file owns its secrets)
- Update first-install docs with corrected staged deployment flow
- Fixes deployment failure caused by runner crashing with placeholder token
2026-03-14 12:22:33 +01:00
steffen
da37a2dce3 updated docs for an other activation step 2026-03-14 12:14:54 +01:00
steffen
6037b55091 fix: use --sudo --ask-sudo-password instead of deprecated --use-remote-sudo 2026-03-14 12:11:21 +01:00
steffen
10bb0c8e34 add deploy/create/install apps, fix templates and docs
- Add apps: create (scaffold host from template), deploy (multi-host
  deployment with -n filter), install (NixOS installation from live ISO)
- Register all apps in flake.nix (create, deploy, install, rebuild)
- Add deploy.json config (cryodev-main, SSH port 2299)
- Fix generic-server template: was using Pi hardware/boot config,
  now correct x86_64 with systemd-boot, UEFI, ROOT/BOOT/SWAP labels
- Fix template networking.nix: use HOSTNAME placeholder instead of
  hardcoded cryodev-pi (both templates)
- Fix headplane upstream pnpm-deps hash mismatch via overlay
- Fix all docs: replace root@ with user@, --ssh-option with
  NIX_SSHOPTS, add deploy app references, update first-install guide
  to use create app and document service deactivation steps
2026-03-14 12:08:30 +01:00
steffen
1653398873 updated docs and ai shit 2026-03-14 11:44:41 +01:00
steffen
8f83105aa4 added not tested isntall script and some secrets 2026-03-14 11:33:59 +01:00
steffen
728edd0036 updated pubkey for server, reenabled services, updated docs 2026-03-14 11:19:48 +01:00
steffen
304afdc0d4 prepearing first installations 2026-03-14 10:44:36 +01:00
steffen
834407a4c3 updated gitinget 2026-03-11 08:45:21 +01:00
steffen
c021af7d80 Update AGENTS.md with SD image pipeline and current project structure
- Add SD image build commands
- Add deployment commands (deploy-rs, nixos-rebuild)
- Update directory structure with docs/, lib/, apps/
- Add key patterns for new Pi hosts and SOPS
- Add deployment workflows table
- Remove reference to deleted INSTRUCTIONS.md
2026-03-11 08:43:48 +01:00
steffen
5ba78886d2 Add SD image pipeline, documentation overhaul, and fix module issues
- Add automatic SD image builds for Raspberry Pi via Forgejo Actions
- Enable binfmt emulation on cryodev-main for aarch64 cross-builds
- Add sd-image.nix module to cryodev-pi configuration
- Create comprehensive docs/ structure with installation guides
- Split installation docs into: first-install (server), reinstall, new-client (Pi)
- Add lib/utils.nix and apps/rebuild from synix
- Fix headplane module for new upstream API (tale/headplane)
- Fix various module issues (mailserver stateVersion, option conflicts)
- Add placeholder secrets.yaml files for both hosts
- Remove old INSTRUCTIONS.md (content moved to docs/)
2026-03-11 08:41:58 +01:00
steffen
a5261d8ff0 added correct disk-id 2026-03-11 07:33:34 +01:00
stherm
430194beda Initial commit 2026-03-06 08:31:13 +01:00