Port the AMD, ROCm, gaming, VPN and Docker aspects; document the new secrets
Replace the T0 stubs with the old modules' behaviour, one aspect each: - nixos.amd: graphics (32-bit), amdgpu (initrd, OpenCL, overdrive), microcode, kvm-amd, monitoring tools and LACT (the old default). - nixos.rocm: rocminfo, rocm-smi and /opt/rocm/hip; the desktop host does not import it, as before. - nixos.gaming: Steam, Proton-GE, gamescope (off), gamemode, MangoHud, the vm.max_map_count sysctl and the owner's `gamemode` group. - nixos.vpn: AmneziaVPN and nm-applet; the OpenVPN plugin stays in core/networking.nix. - nixos.docker: rootful and rootless Docker on btrfs and the owner's `docker` group. secrets/secrets.nix gains the recipient entries for gitea-runner-token.age and tg-ws-proxy-secret.age (additive). secrets/README.md documents both optional secrets, the exact commands to create them from a pipe, and rotation, because the old plaintext values are in the git history. proxy-suite.nix, gitea-runner.nix, secrets.nix and ssh.nix were verified against the old modules and need no change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
This commit is contained in:
7 files changed
+176
-10
No files matched your search
@@ -14,3 +14,46 @@ required: a secret is only used when its `.age` file exists.
|
||||
3. `git add` the new `.age` files: flakes only see tracked files.
|
||||
|
||||
Decryption on the machine uses `/etc/ssh/ssh_host_ed25519_key`.
|
||||
|
||||
## Service secrets
|
||||
|
||||
Two more optional secrets belong to services. Without them the service is
|
||||
switched off, and the build prints a warning that names the missing file.
|
||||
|
||||
| File | Content | Used by | Without the file |
|
||||
| ------------------------ | --------------------------------------- | ------------------------------------------------ | ------------------------------------------ |
|
||||
| `gitea-runner-token.age` | One line `TOKEN=<registration token>` | `modules/dev/gitea-runner.nix` (`tokenFile`) | The runner "performance" is not configured |
|
||||
| `tg-ws-proxy-secret.age` | The hex secret (`openssl rand -hex 16`) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off |
|
||||
|
||||
Both are decrypted to `/run/agenix/<name>` (root, mode `0400`) and read by the
|
||||
service units. No `.nix` file contains a secret value.
|
||||
|
||||
Create them from the repository root (`-i` checks that your key can decrypt the
|
||||
result; `secret-from-file` also runs `git add` on the new file). The values go
|
||||
through a pipe, so they never touch the disk or a command line:
|
||||
|
||||
```sh
|
||||
# Registration token: Gitea -> Site Administration -> Actions -> Runners.
|
||||
printf 'Registration token: '; read -rs t; echo
|
||||
printf 'TOKEN=%s\n' "$t" | nix run .#secret-from-file -- gitea-runner-token.age - -i ~/.ssh/id_ed25519
|
||||
unset t
|
||||
|
||||
# Telegram proxy secret: a fresh random value.
|
||||
openssl rand -hex 16 | tee /dev/stderr | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519
|
||||
```
|
||||
|
||||
The second command also prints the secret once, because the Telegram clients
|
||||
need it. Then switch (`nix run .#switch`).
|
||||
|
||||
### Rotation
|
||||
|
||||
Earlier versions of this repository (up to commit `030e97e`) kept the runner
|
||||
token and the Telegram proxy secret as plaintext in the networking
|
||||
configuration; both are still in the git history. Treat them as leaked: create
|
||||
a new registration token in Gitea (and remove the old runner there), generate a
|
||||
new Telegram secret, and store the new values with the commands above. To
|
||||
replace an existing file later, add `--force`:
|
||||
|
||||
```sh
|
||||
openssl rand -hex 16 | nix run .#secret-from-file -- tg-ws-proxy-secret.age - --force -i ~/.ssh/id_ed25519
|
||||
```
|
||||
@@ -21,4 +21,6 @@ in
|
||||
"faumaray-password.age".publicKeys = recipients;
|
||||
"ssh-id_ed25519.age".publicKeys = recipients;
|
||||
"ssh-id_ed25519_work.age".publicKeys = recipients;
|
||||
"gitea-runner-token.age".publicKeys = recipients;
|
||||
"tg-ws-proxy-secret.age".publicKeys = recipients;
|
||||
}
|
||||
Reference in new issue
Block a user