Compare commits
110
Commits
7dd5f9e17b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3def9ce938 | ||
|
|
2e540a2224 | ||
|
|
89484504e4 | ||
|
|
6fbc61c7ea | ||
|
|
1dc3ae47f9 | ||
|
|
a092e23f6e | ||
|
|
7a973aaee6 | ||
|
|
5c48ef9c1e | ||
|
|
01f039a5ce | ||
|
|
4c9d8f88cb | ||
|
|
c8223aec40 | ||
|
|
6abc047879 | ||
|
|
a48af90346 | ||
|
|
32ea399d89 | ||
|
|
705f2eb4c6 | ||
|
|
5139a55daa | ||
|
|
f9835c150f | ||
|
|
e9479f9be1 | ||
|
|
a1ebcfb6aa | ||
|
|
956158729e | ||
|
|
87aea41843 | ||
|
|
f3d03f4c20 | ||
|
|
ff770c1d03 | ||
|
|
d7875b588e | ||
|
|
5881b9c8be | ||
|
|
d7bd46c0cd | ||
|
|
b583c550f3 | ||
|
|
08207da02b | ||
|
|
3efec42e72 | ||
|
|
fb5503ec36 | ||
|
|
be6e7492b3 | ||
|
|
10d85b2a91 | ||
|
|
6db82ed10a | ||
|
|
09c6fe2235 | ||
|
|
2547ec45b4 | ||
|
|
26856003d4 | ||
|
|
ce92096042 | ||
|
|
62c41a6f8e | ||
|
|
d8ea131327 | ||
|
|
a3178f0507 | ||
|
|
3b44ae1354 | ||
|
|
e72789fbb1 | ||
|
|
f06921593d | ||
|
|
416c648f99 | ||
|
|
25a21d2f66 | ||
|
|
dfd4ca06a2 | ||
|
|
d337d7605e | ||
|
|
f2d1ce5744 | ||
|
|
a8bc08de43 | ||
|
|
0c265f7a74 | ||
|
|
d6b79f8d8d | ||
|
|
39fc85e8f9 | ||
|
|
088de60af5 | ||
|
|
eb94f5a034 | ||
|
|
91d6511f01 | ||
|
|
e3f01e3c35 | ||
|
|
880c85facb | ||
|
|
6ff3b48fcf | ||
|
|
eb862ebf7e | ||
|
|
fa5343f211 | ||
|
|
82480e88f4 | ||
|
|
a60b842ee2 | ||
|
|
2d09b6c69f | ||
|
|
e2bff381b9 | ||
|
|
2b83e9c606 | ||
|
|
1c420283f4 | ||
|
|
8fec1dd4bb | ||
|
|
18f4639bb7 | ||
|
|
fdf7ecb3e4 | ||
|
|
2a2b1d8421 | ||
|
|
594a1c1901 | ||
|
|
dd4965f030 | ||
|
|
a12f10d964 | ||
|
|
9856e11416 | ||
|
|
fd733cdc21 | ||
|
|
cd7c908fde | ||
|
|
62e73eb4d2 | ||
|
|
0efbc5817b | ||
|
|
2e8529fff0 | ||
|
|
3a2cb09d07 | ||
|
|
bfdcd45746 | ||
|
|
9217e61675 | ||
|
|
6f0efacfca | ||
|
|
eecad5cc4a | ||
|
|
6ec9594f92 | ||
|
|
567a85b946 | ||
|
|
95b6885f4e | ||
|
|
57fbf70b7c | ||
|
|
86f9ae010e | ||
|
|
520f804738 | ||
|
|
9b537c9f62 | ||
|
|
bb3c73b310 | ||
|
|
eb6380ddfe | ||
|
|
0cf504ad27 | ||
|
|
39f062a7af | ||
|
|
4c8efd185d | ||
|
|
5d2ff990ae | ||
|
|
4a72048f0d | ||
|
|
97644f4598 | ||
|
|
53e272367e | ||
|
|
b53ab9c854 | ||
|
|
32bc1e83e9 | ||
|
|
b0da186ed3 | ||
|
|
3c244541cb | ||
|
|
8dcbd3bf6c | ||
|
|
56f93456cd | ||
|
|
7f8db88b8c | ||
|
|
246f2cf360 | ||
|
|
c9f459d4c6 | ||
|
|
e962c5cebc |
No files matched your search
@@ -0,0 +1,18 @@
|
||||
# .agents/looprails
|
||||
|
||||
Looprail files for this repo.
|
||||
|
||||
## journal-triage
|
||||
|
||||
`journal-triage.toml` reads the journald log of this machine, has Claude Opus triage it
|
||||
against this repo, and writes a report ranked by urgency to `.tmp/journal-reports/<host>-<date>.md` (gitignored).
|
||||
|
||||
- `journal-triage/collect.sh`: pulls warnings (and worse), failed units and a digest of
|
||||
unique messages into the run folder.
|
||||
- `journal-triage/triage.md`: the brief for Opus. It reads `GUIDELINES.md`, traces each issue to
|
||||
`hosts/<host>/` or `modules/`, and suggests fixes as repo changes. It only reads and suggests:
|
||||
no edits, no builds, no sudo.
|
||||
- Inputs: `since` (default `24 hours ago`), `priority` (`err`, `warning`, `notice`),
|
||||
`host` (default `fwbook`), `repo` (default `/home/ari/nixos-setup`).
|
||||
|
||||
Run: `looprail run .agents/looprails/journal-triage.toml`, or ask the agent to run it.
|
||||
@@ -0,0 +1,45 @@
|
||||
name = "journal-triage"
|
||||
description = "Collect journald warnings, triage them with Claude Opus against this repo, and write an urgency-ranked report with fixes as repo changes."
|
||||
|
||||
[inputs.static]
|
||||
since = { type = "string", description = "How far back to read the journal.", min_length = 1, default = "24 hours ago" }
|
||||
priority = { type = "enum", description = "Lowest log priority to include.", values = ["err", "warning", "notice"], default = "warning" }
|
||||
host = { type = "string", description = "Name of the host folder under hosts/ to trace issues to.", min_length = 1, default = "fwbook" }
|
||||
repo = { type = "string", description = "Path of the NixOS config repo.", min_length = 1, default = "/home/ari/nixos-setup" }
|
||||
|
||||
[[step.collect]]
|
||||
kind = "shell"
|
||||
description = "Collects journal warnings and failed units into a digest."
|
||||
cwd = "{{ inputs.repo }}"
|
||||
run = ["sh .agents/looprails/journal-triage/collect.sh {{ inputs.since }} {{ inputs.priority }}"]
|
||||
|
||||
[step.collect.outputs]
|
||||
raw_log = { type = "string", description = "Path of the full raw journal log." }
|
||||
digest = { type = "string", description = "Path of the deduplicated digest." }
|
||||
lines = { type = "int", description = "Number of raw log lines." }
|
||||
unique = { type = "int", description = "Number of distinct messages." }
|
||||
|
||||
[[step.triage]]
|
||||
kind = "agent"
|
||||
description = "Has Opus triage the log against the repo and suggest fixes."
|
||||
needs = ["collect"]
|
||||
agent = { command = ["claude-agent-acp"], model = "opus" }
|
||||
cwd = "{{ inputs.repo }}"
|
||||
brief = "journal-triage/triage.md"
|
||||
failover = "agent"
|
||||
|
||||
[step.triage.outputs]
|
||||
summary = { type = "string", description = "Markdown report ranked by urgency.", min_length = 1 }
|
||||
issues = { type = "list", description = "The issues found, with urgency, fix and files.", items = { title = { type = "string" }, urgency = { type = "enum", values = ["critical", "high", "medium", "low", "noise"] }, fix = { type = "string" }, files = { type = "list" } } }
|
||||
|
||||
[[step.report]]
|
||||
kind = "shell"
|
||||
description = "Writes the report to .tmp/journal-reports."
|
||||
needs = ["triage"]
|
||||
run = [
|
||||
"R={{ inputs.repo }}; mkdir -p \"$R/.tmp/journal-reports\"",
|
||||
"S={{ steps.triage.outputs.summary }}; H={{ inputs.host }}; R={{ inputs.repo }}; f=\"$R/.tmp/journal-reports/$H-$(date +%Y-%m-%d-%H%M).md\"; printf '%s\\n' \"$S\" > \"$f\"; echo \"report=$f\" >> \"$NBOT_LR_OUTPUTS\"; echo \"Report written to $f\"",
|
||||
]
|
||||
|
||||
[step.report.outputs]
|
||||
report = { type = "string", description = "Path of the written report." }
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# Collect journald warnings+ and failed units into the run folder, plus a deduplicated digest.
|
||||
set -eu
|
||||
since="$1"; priority="$2"
|
||||
dir="$NBOT_LR_RUN_DIR"
|
||||
raw="$dir/journal-raw.log"; digest="$dir/journal-digest.txt"
|
||||
|
||||
journalctl -p "$priority" --since "$since" --no-pager -q -o short-iso > "$raw" || true
|
||||
|
||||
{
|
||||
echo "=== Failed systemd units ==="
|
||||
systemctl --failed --no-legend --plain || true
|
||||
systemctl --user --failed --no-legend --plain 2>/dev/null || true
|
||||
echo
|
||||
echo "=== Boots in window ==="
|
||||
journalctl --list-boots --no-pager -q | tail -5 || true
|
||||
echo
|
||||
echo "=== Unique messages (count, source: message; numbers/hex normalized), most frequent first ==="
|
||||
cut -d' ' -f3- "$raw" \
|
||||
| sed -E 's/\[[0-9]+\]//; s/0x[0-9a-fA-F]+/0xN/g; s/[0-9]+/N/g' \
|
||||
| sort | uniq -c | sort -rn | head -400
|
||||
} > "$digest"
|
||||
|
||||
lines=$(wc -l < "$raw")
|
||||
uniq=$(grep -c '^ *[0-9]' "$digest" || true)
|
||||
printf 'raw_log=%s\ndigest=%s\nlines=%s\nunique=%s\n' "$raw" "$digest" "$lines" "$uniq" >> "$NBOT_LR_OUTPUTS"
|
||||
@@ -0,0 +1,65 @@
|
||||
You are triaging the systemd journal of the NixOS host `{{ inputs.host }}`, and tracing each issue
|
||||
back to the NixOS config repo that builds it: {{ inputs.repo }} (your working folder).
|
||||
|
||||
Window: since {{ inputs.since }}, priority {{ inputs.priority }} and worse.
|
||||
{{ steps.collect.outputs.lines }} log lines, {{ steps.collect.outputs.unique }} distinct messages.
|
||||
|
||||
- Digest (failed units, boots, deduplicated messages with counts): {{ steps.collect.outputs.digest }}
|
||||
- Full raw log (timestamps, for context): {{ steps.collect.outputs.raw_log }}
|
||||
|
||||
## Rules: read and suggest only
|
||||
|
||||
- Change nothing. Do not edit, create or delete files, in the repo or anywhere else.
|
||||
- Do not run builds or switches: no `nixos-rebuild`, `nh`, `skyg`, `nix build`, `nix flake check`,
|
||||
`nixos-anywhere`, docker/podman builds. No sudo. No git commands that change state.
|
||||
- You may run read-only commands: `systemctl status`, `journalctl -u`, `ls`, `cat`, `grep`, `rg`,
|
||||
`git log`, `git diff`, `nix-instantiate --parse`.
|
||||
- Never read anything in `secrets/`.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Read `GUIDELINES.md` in the repo. Your suggested changes must follow it.
|
||||
2. Read the digest, then grep the raw log for detail where needed.
|
||||
3. Group related messages into issues. Ignore harmless boot-time noise unless it points to
|
||||
something real; list it briefly under "noise" so the reader knows it was seen.
|
||||
4. For each real issue, find where it comes from in the repo: start with `hosts/{{ inputs.host }}/`,
|
||||
then `modules/`, `configs/`, `pkgs/` and `flake.nix`. Check whether another host
|
||||
(`hosts/*/`) already solves the same problem, and reuse that pattern.
|
||||
Note when the cause is outside the repo (a hand-written file in `~/.config`, state on disk).
|
||||
|
||||
## How to write fixes
|
||||
|
||||
- Give each fix as a short suggested Nix change with its repo path, e.g.
|
||||
`hosts/{{ inputs.host }}/systemd.nix` plus a small snippet.
|
||||
- Follow the repo's layout: put config in the matching host sub-file (`hardware.nix`, `systemd.nix`,
|
||||
`packages.nix`, `networking.nix`, `services.nix` or `services/<name>.nix`, `home/default.nix`).
|
||||
Custom options live under `skyg.*`; check `modules/lib.nix` before naming one.
|
||||
- Never suggest `imports = [...]` in host files.
|
||||
- Never suggest editing `flake.lock`, anything in `hosts/*/hardware-configuration/` or
|
||||
`*.hardware-configuration.nix`, or `secrets/`. If the cause lives there, say so and suggest an
|
||||
override in the right host sub-file instead (e.g. `fileSystems."/boot".options` in `hardware.nix`
|
||||
with `lib.mkForce`).
|
||||
- When a fix is imperative (a one-off command), say it needs to be run by hand, and prefer a
|
||||
declarative option when one exists.
|
||||
- Remind the reader that they rebuild themselves; do not tell them a change has been applied.
|
||||
|
||||
## Urgency
|
||||
|
||||
- critical: data loss, security, hardware failing, system unbootable or core service down
|
||||
- high: a service failing or crash-looping, repeated errors with user-visible effect
|
||||
- medium: degraded behaviour, misconfiguration, something that will bite later
|
||||
- low: cosmetic or rare warnings worth a look
|
||||
- noise: benign, safe to ignore
|
||||
|
||||
## Output
|
||||
|
||||
`summary` is a Markdown report:
|
||||
- a one-paragraph overview
|
||||
- sections by urgency, critical first; each issue with evidence (unit, sample message, count,
|
||||
first/last seen), likely cause, the repo files involved, and fixes as suggested repo changes
|
||||
- a short "Repo recommendations" section: patterns across hosts or modules worth changing
|
||||
(duplication, hand-made units that should be declarative, a fix that would help other hosts too)
|
||||
|
||||
Keep it concise, with plain words.
|
||||
|
||||
`issues` is the same issues as a list; `files` holds the repo paths involved (empty if none).
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: nbot-wf
|
||||
description: When anything to do with workflows comes up, use the nbot-wf MCP tools; if they are not available, run nbot-wf install and restart the session.
|
||||
---
|
||||
|
||||
When anything to do with workflows comes up, use the nbot-wf MCP tools; if they are not available, run `nbot-wf install` and restart the session.
|
||||
|
||||
The `get_workflow_guide` tool explains how to find, run, watch, answer, stop, resume, write and update a workflow.
|
||||
@@ -0,0 +1,3 @@
|
||||
[mcp_servers.nbot-wf]
|
||||
command = "nbot-wf"
|
||||
args = ["mcp"]
|
||||
@@ -42,3 +42,9 @@ docs
|
||||
.claude
|
||||
.mnt
|
||||
.pi
|
||||
|
||||
# Zed local settings (machine-local MCP tokens live here)
|
||||
.zed/settings.local.json
|
||||
|
||||
|
||||
.nbot-wf
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"nbot-wf": {
|
||||
"command": "nbot-wf",
|
||||
"args": [
|
||||
"mcp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
/nix/store/8wpcklj1m0cp057gvc6ksvkc6znlipd5-pre-commit-config.json
|
||||
/nix/store/mbdhxcacyi218765m4p2b53ww4fhrlsf-pre-commit-config.json
|
||||
+34
-25
@@ -1,29 +1,38 @@
|
||||
{
|
||||
"show_completions_on_input": true,
|
||||
"languages": {
|
||||
"QML": {
|
||||
"colorize_brackets": true,
|
||||
"inlay_hints": {
|
||||
"show_background": true,
|
||||
"enabled": true
|
||||
},
|
||||
"show_whitespaces": "all",
|
||||
"show_completions_on_input": true,
|
||||
"always_treat_brackets_as_autoclosed": true,
|
||||
"format_on_save": "on",
|
||||
"language_servers": ["qmljs"]
|
||||
}
|
||||
},
|
||||
"lsp": {
|
||||
"qmljs": {
|
||||
"context_servers": {
|
||||
"linux-tracker": {
|
||||
"url": "http://fwdesk.lab.internal:1984/mcp"
|
||||
}
|
||||
},
|
||||
"languages": {
|
||||
"QML": {
|
||||
"colorize_brackets": true,
|
||||
"inlay_hints": {
|
||||
"show_background": true,
|
||||
"enabled": true
|
||||
},
|
||||
"show_whitespaces": "all",
|
||||
"show_completions_on_input": true,
|
||||
"always_treat_brackets_as_autoclosed": true,
|
||||
"format_on_save": "on",
|
||||
"language_servers": [
|
||||
"qmljs"
|
||||
]
|
||||
}
|
||||
},
|
||||
"lsp": {
|
||||
"qmljs": {
|
||||
"enable_lsp_tasks": true,
|
||||
"binary": {
|
||||
"path": "qmlls",
|
||||
"arguments": ["-E"]
|
||||
},
|
||||
"initialization_options": {
|
||||
"buildDir": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
"binary": {
|
||||
"path": "qmlls",
|
||||
"arguments": [
|
||||
"-E"
|
||||
]
|
||||
},
|
||||
"initialization_options": {
|
||||
"buildDir": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ Key non-negotiable rules from that file:
|
||||
changes — no matter how small the task.
|
||||
- **Never run builds, system switches, or remote installs** (`nixos-rebuild`,
|
||||
`nh os`, `skyg os`, `skyg remote install`, `nixos-anywhere`, `nix build`,
|
||||
`nix flake check`, etc.) — zero exceptions, even if asked.
|
||||
`nix flake check`, etc.). You may only run it after asking the user 3 times if the are sure about it!
|
||||
- Never edit `flake.lock`, `*.hardware-configuration.nix`, or anything in
|
||||
`secrets/`.
|
||||
- Never add `imports = [...]` to host files.
|
||||
|
||||
+3
-1
@@ -16,6 +16,7 @@ bin/
|
||||
├── remote.nu # `skyg remote *` (deploy, install, boot-all, status, reboot-pending)
|
||||
├── secrets.nu # `skyg secrets [list]/show/edit/compare`
|
||||
├── ca.nu # `skyg ca init/issue`
|
||||
├── buzz.nu # `skyg buzz identity`
|
||||
├── pkgs.nu # `skyg pkgs update`
|
||||
├── flake.nu # `skyg flake update/check/check-versions`
|
||||
├── build.nu # `skyg build image/openwrt`
|
||||
@@ -37,7 +38,7 @@ bin/
|
||||
| `skyg os rollback` | Roll back to previous generation |
|
||||
| `skyg remote switch <host>` | Deploy to a remote host |
|
||||
| `skyg remote install <host>` | Fresh-install a remote host via nixos-anywhere, using `hosts/<profile>.disko.nix`. Always wipes the disks in that file. Aborts if the file is missing, if the host already boots NixOS from disk (unless `--force-wipe`), or if you do not type the short hostname. |
|
||||
| `skyg remote status <host>` | Check status of a single remote host: booted / current / next-boot generation. `reboot_pending` = booted != next boot (`/nix/var/nix/profiles/system`), `needs_build` = local build != next boot. So hosts deployed with `boot` show up correctly. |
|
||||
| `skyg remote status <host>` | Check status of a single remote host: booted / current / next-boot generation. `reboot_pending` = booted != next boot (`/nix/var/nix/profiles/system`), `needs_build` = local build != next boot (or `"unknown"` if the local eval fails). So hosts deployed with `boot` show up correctly. |
|
||||
| `skyg remote status --all` | Check status of all remote hosts |
|
||||
| `skyg remote boot-all` | Boot all remote hosts |
|
||||
| `skyg remote reboot-pending` | Reboot every remote host with a pending reboot (`booted-system` != next-boot generation, so `boot` deploys count). Lists them, asks for confirmation, then reboots one at a time. Each host must prove it rebooted (boot id changed) and come back on its next-boot generation, otherwise it is reported as failed. Sends a desktop notification per host. |
|
||||
@@ -54,6 +55,7 @@ bin/
|
||||
| `skyg secrets compare <secret>` | Diff the working copy against the stored secret |
|
||||
| `skyg ca init` | Generate the lab root CA: key → `secrets/lab-ca-key.age`, cert → `configs/pki/lab-ca.crt` (see `configs/pki/ABOUTME.md`) |
|
||||
| `skyg ca issue <domain> --for <host>` | Mint a TLS leaf cert signed by the lab CA: cert → `configs/pki/<domain>.crt`, key → `secrets/<name>-tls-key.age`. Auto-registers missing `secrets.nix` entries. |
|
||||
| `skyg buzz identity <robot>` | Make a Buzz (Nostr) identity for a robot's Hermes agent and merge `BUZZ_RELAY_URL` / `BUZZ_PRIVATE_KEY` (plus optional `--channels`, `--home-channel`). The bot answers anyone on the relay by default (`BUZZ_ALLOW_ALL_USERS=true`); `--allowed-users <npubs>` limits it to a list, `--restricted` allows no one into `secrets/robots-<robot>.age`, keeping its other lines. Refuses to replace an existing key without `--rotate`. `--dry-run` only shows the npub. Prints the `buzz-manage add-member <npub>` step. Needs `nak` (dev shell). |
|
||||
| `skyg pkgs update [--all\|<pkg>]` | Update one or all custom packages |
|
||||
| `skyg net check [device]` | For every managed device (or just `[device]`): report the NIC on the default route (model, driver, current link speed, supported speeds), then run `speedtest-go` via `nix-shell` against one shared server. Logs progress per device and returns a table. `--server <id>` picks the server; `--no-speedtest` skips the test. Offline devices are listed, not tested. Every run saves the table to `.tmp/net-checks/<timestamp>.nuon`; `--save <file>` also writes it to `<file>` (format from extension). The server is saved in `.tmp/net-checks/server.nuon` on first run; later runs ask whether to change it (fuzzy pick list from `speedtest-go --list`). `--server` skips the question and leaves the saved server alone. |
|
||||
| `skyg net last` | Show the table from the most recent `skyg net check` run (newest file in `.tmp/net-checks/`). |
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
use types.nu *
|
||||
use helpers.nu *
|
||||
|
||||
# Same host as RELAY_URL in hosts/hl-minipc1/services/buzz.nix (public domain).
|
||||
const BUZZ_DEFAULT_RELAY = "https://buzz.home.sosnovsky.ca"
|
||||
|
||||
# Robots that have a secrets/robots-<name>.age (robots-shared is not a robot).
|
||||
def buzz-robots [] {
|
||||
secret-names
|
||||
| where {|s| ($s | str starts-with "robots-") and $s != "robots-shared" }
|
||||
| each {|s| $s | str replace "robots-" "" }
|
||||
}
|
||||
|
||||
# Drop existing KEY=... lines for the keys in `vars` and in `drop`, then append
|
||||
# the new values. Every other line is kept as is.
|
||||
def env-merge [lines: list<string>, vars: record, drop: list<string>] {
|
||||
let keys = (($vars | columns) ++ $drop)
|
||||
let kept = ($lines | where {|l|
|
||||
let t = ($l | str trim)
|
||||
not ($keys | any {|k| $t | str starts-with $"($k)=" })
|
||||
})
|
||||
$kept ++ ($vars | items {|k, v| $"($k)=($v)" })
|
||||
}
|
||||
|
||||
# Make a Buzz (Nostr) identity for a robot's Hermes agent and write the BUZZ_*
|
||||
# env vars into secrets/robots-<robot>.age. Other lines in the secret are kept.
|
||||
# By default the bot answers anyone on the relay (BUZZ_ALLOW_ALL_USERS=true).
|
||||
# Pass --allowed-users for an explicit list, or --restricted for no one.
|
||||
# The nsec is never printed. Afterwards, add the printed npub to the relay.
|
||||
export def "skyg buzz identity" [
|
||||
robot: string@buzz-robots # Robot name (secret: secrets/robots-<robot>.age)
|
||||
--relay: string # BUZZ_RELAY_URL (default: the lab relay)
|
||||
--allowed-users: string # Only these answer: comma-separated npubs or hex pubkeys (BUZZ_ALLOWED_USERS)
|
||||
--restricted # Neither allow-all nor a list is set: the bot ignores everyone until you add one
|
||||
--channels: string # BUZZ_CHANNELS: comma-separated channel UUIDs
|
||||
--home-channel: string # BUZZ_HOME_CHANNEL: channel UUID for cron/notifications
|
||||
--rotate # Replace an existing BUZZ_PRIVATE_KEY (loses relay membership)
|
||||
--dry-run # Make a key and show the npub; do not touch the secret
|
||||
] {
|
||||
cd $REPO_ROOT
|
||||
if (which nak | is-empty) {
|
||||
error make {msg: "nak not found — run inside the dev shell (nix develop)"}
|
||||
}
|
||||
let secret = $"secrets/robots-($robot).age"
|
||||
let relay_url = ($relay | default $BUZZ_DEFAULT_RELAY | str trim --right --char "/")
|
||||
|
||||
# Read the current secret first, so we fail before making anything.
|
||||
mut existing = []
|
||||
if not $dry_run {
|
||||
if not ($secret | path exists) {
|
||||
error make {msg: $"($secret) not found — create it first (skyg secrets edit robots-($robot))"}
|
||||
}
|
||||
$existing = (^agenix -d $secret | lines)
|
||||
let has_key = ($existing | any {|l| ($l | str trim) | str starts-with "BUZZ_PRIVATE_KEY=" })
|
||||
if $has_key and not $rotate {
|
||||
error make {msg: $"($secret) already has BUZZ_PRIVATE_KEY. Use --rotate to replace it (the robot gets a new identity and must be re-added to the relay)."}
|
||||
}
|
||||
}
|
||||
|
||||
let hex = (^nak key generate | str trim)
|
||||
let pubhex = (^nak key public $hex | str trim)
|
||||
let nsec = (^nak encode nsec $hex | str trim)
|
||||
let npub = (^nak encode npub $pubhex | str trim)
|
||||
let ok = ($nsec | str starts-with "nsec1") and ($npub | str starts-with "npub1")
|
||||
if not $ok {
|
||||
error make {msg: "nak returned an unexpected key format; nothing was written"}
|
||||
}
|
||||
|
||||
mut vars = {BUZZ_RELAY_URL: $relay_url, BUZZ_PRIVATE_KEY: $nsec}
|
||||
if ($allowed_users | is-not-empty) { $vars = ($vars | insert BUZZ_ALLOWED_USERS $allowed_users) }
|
||||
if ($channels | is-not-empty) { $vars = ($vars | insert BUZZ_CHANNELS $channels) }
|
||||
if ($home_channel | is-not-empty) { $vars = ($vars | insert BUZZ_HOME_CHANNEL $home_channel) }
|
||||
# Allow-all is the default; a list or --restricted turns it off (and clears a stale true).
|
||||
mut drop = []
|
||||
if ($allowed_users | is-not-empty) {
|
||||
$vars = ($vars | insert BUZZ_ALLOWED_USERS $allowed_users)
|
||||
$drop = ["BUZZ_ALLOW_ALL_USERS"]
|
||||
} else if $restricted {
|
||||
$drop = ["BUZZ_ALLOW_ALL_USERS"]
|
||||
} else {
|
||||
$vars = ($vars | insert BUZZ_ALLOW_ALL_USERS "true")
|
||||
}
|
||||
|
||||
if $dry_run {
|
||||
print $"Dry run: nothing written. Would set in ($secret):"
|
||||
print ($vars | columns | each {|k| $" ($k)" } | str join "\n")
|
||||
if ($drop | is-not-empty) { print $"Would remove: ($drop | str join ', ')" }
|
||||
print $"npub: ($npub)"
|
||||
return
|
||||
}
|
||||
|
||||
# Only --restricted can leave nobody allowed.
|
||||
let gated = (
|
||||
($allowed_users | is-not-empty)
|
||||
or ($existing | any {|l| ($l | str trim) | str starts-with "BUZZ_ALLOWED_USERS=" })
|
||||
)
|
||||
|
||||
# Straight into agenix over stdin: no plaintext file on disk.
|
||||
let body = ((env-merge $existing $vars $drop) | str join "\n") + "\n"
|
||||
$body | ^agenix -e $secret
|
||||
|
||||
print $"✅ Updated ($secret) with: ($vars | columns | str join ', ')"
|
||||
print $"npub: ($npub)"
|
||||
print "Next:"
|
||||
print $" 1. On hl-minipc1: sudo buzz-manage add-member ($npub)"
|
||||
if $restricted and not $gated {
|
||||
print "⚠️ --restricted with no BUZZ_ALLOWED_USERS: the bot will ignore everyone. Re-run with --rotate --allowed-users <npub,...> or edit the secret."
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ export use remote.nu *
|
||||
export use os.nu *
|
||||
export use secrets.nu *
|
||||
export use ca.nu *
|
||||
export use buzz.nu *
|
||||
export use pkgs.nu *
|
||||
export use flake.nu *
|
||||
export use build.nu *
|
||||
|
||||
+8
-3
@@ -140,7 +140,7 @@ Starting parallel boots (concurrency: 2)..."
|
||||
let boot_results = ($online_hosts | par-each --threads 1 { |host|
|
||||
let target_host = $"root@($host).lab.internal"
|
||||
let profile = $"hl-($host)"
|
||||
let runcmd = $"nh os boot --target-host ($target_host) .#($profile)"
|
||||
let runcmd = $"nh os boot --no-nom --target-host ($target_host) .#($profile)"
|
||||
print $runcmd
|
||||
let ok = (try {
|
||||
bash -c $runcmd
|
||||
@@ -214,8 +214,13 @@ export def "skyg remote status-all" [] {
|
||||
let current = (if ($info.current | is-empty) { "-" } else { $info.current | path basename })
|
||||
let next_boot = (if ($info.next_boot | is-empty) { "-" } else { $info.next_boot | path basename })
|
||||
let reboot_line = if $info.reboot_pending { $"(ansi yellow)REBOOT PENDING(ansi reset)\n" } else { "" }
|
||||
let build_line = if $info.needs_build { $"(ansi red)NEEDS NEW BUILD(ansi reset)" } else { $"(ansi green)UP TO DATE(ansi reset)" }
|
||||
print $"($host) | Booted: ($booted) | Current: ($current) | Next boot: ($next_boot)"
|
||||
# needs_build is true, false, or "unknown" (local eval failed)
|
||||
let build_line = match $info.needs_build {
|
||||
true => $"(ansi red)NEEDS NEW BUILD(ansi reset)",
|
||||
false => $"(ansi green)UP TO DATE(ansi reset)",
|
||||
_ => $"(ansi yellow)BUILD UNKNOWN (eval failed)(ansi reset)",
|
||||
}
|
||||
print $"($host) | Booted: ($booted) | Current: ($current) | Next boot: ($next_boot)\n ($reboot_line)($build_line)"
|
||||
|
||||
$info
|
||||
})
|
||||
|
||||
+5
-4
@@ -23,10 +23,11 @@ these cases where the source subdir and `~/.config` target differ.
|
||||
| `hl-fws1/hypr/` | Hyprland config for `hl-fws1` (remote slim desktop); **baked into the build** via `mountAsSource`, linked to `~/.config/hypr` |
|
||||
| `hl-pi1/quickshell/` | Quickshell configs for `hl-pi1` (full-screen clock + calendar); linked to `~/.config/quickshell` |
|
||||
| `fwbook/quickshell/` | Quickshell configs for `fwbook` (scrolling overview); linked to `~/.config/quickshell` |
|
||||
| `extra.nu` | Extra NuShell config sourced at shell startup |
|
||||
| `fwbook.knsv` | fwbook-specific Kanshi display profile |
|
||||
| `hypr-types/hl.lua` | Shared EmmyLua type stubs for the `hl` global; each host's Hyprland `.luarc.json` points here via `workspace.library` |
|
||||
| `pki/` | Public certs of the lab internal CA (`lab-ca.crt` + issued leaves), managed by `skyg ca`; **not** symlinked to `~/.config` — see `pki/ABOUTME.md` |
|
||||
|
||||
| `extra.nu` | Extra NuShell config sourced at shell startup |
|
||||
| `fwbook.knsv` | fwbook-specific Kanshi display profile |
|
||||
| `hypr-types/hl.lua` | Shared EmmyLua type stubs for the `hl` global; each host's Hyprland `.luarc.json` points here via `workspace.library` |
|
||||
| `pki/` | Public certs of the lab internal CA (`lab-ca.crt` + issued leaves), managed by `skyg ca`; **not** symlinked to `~/.config` — see `pki/ABOUTME.md` |
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
-- Autostart
|
||||
-- =========================
|
||||
local function autostart()
|
||||
-- hl.exec_cmd("setpriv --ambient-caps -all -- noctalia")
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- omarchy-launch-shell")
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- noctalia")
|
||||
-- hl.exec_cmd("setpriv --ambient-caps -all -- omarchy-launch-shell")
|
||||
-- hl.exec_cmd("setpriv --ambient-caps -all -- qs -c overview")
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- skygqts workspace-manager")
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- skygqts workspace-badge")
|
||||
|
||||
@@ -10,5 +10,5 @@ require("conf/inputs")
|
||||
require("conf/window-rules")
|
||||
require("conf/keybindings")
|
||||
require("conf/autostart")
|
||||
require("conf.omarchy.index")
|
||||
-- require("conf.noctalia.index")
|
||||
-- require("conf.omarchy.index")
|
||||
require("conf.noctalia.index")
|
||||
@@ -8,6 +8,7 @@ local mod = "SUPER"
|
||||
-- =========================
|
||||
hl.bind(mod .. " + T", hl.dsp.exec_cmd("ghostty"))
|
||||
hl.bind(mod .. " + Q", hl.dsp.window.close())
|
||||
hl.bind(mod .. " + Space", hl.dsp.exec_cmd("noctalia msg panel-toggle launcher"))
|
||||
|
||||
-- =========================
|
||||
-- Navigation
|
||||
|
||||
Generated
+235
-198
@@ -5,11 +5,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790734419,
|
||||
"narHash": "sha256-n7wew722m1OTBT9DOIMxNX/NF4zfsSUABAO5eW3wikE=",
|
||||
"lastModified": 1792507013,
|
||||
"narHash": "sha256-8tKjSQajD3mUND1GaAuaWTcuyUpgcGsh5V+l4ibzC7U=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "3daa710894355fa2fad8243380af373a2b4046ef",
|
||||
"rev": "5e5b88a0c8e56f291a108c2fe9934054d9745b2e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -18,24 +18,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ai-usagebar": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792165365,
|
||||
"narHash": "sha256-Uffpcw7fb9nYGNSryPlYkSTOUFWlsHIUHEuQ7gY1HqE=",
|
||||
"owner": "akitaonrails",
|
||||
"repo": "ai-usagebar",
|
||||
"rev": "902e9750a8c8d0ac74297f6f562e389474e02eea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akitaonrails",
|
||||
"repo": "ai-usagebar",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"aquamarine": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
@@ -232,11 +214,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791706370,
|
||||
"narHash": "sha256-mlxH9NsDf3dS3U3Ctm2nDAOrcF5oGK995zqjQcjOWyE=",
|
||||
"lastModified": 1792306534,
|
||||
"narHash": "sha256-o6UTiV5SCTIMFvOTxDb1HA0AsTOudcq4yPFm3TkLYI4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "buildbot-nix",
|
||||
"rev": "00906ba25a2b1d0f99cae93fdc86d4391dc46f40",
|
||||
"rev": "3dac4ca086a525086dd63b425bf23a1f732bd73e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -322,11 +304,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792175351,
|
||||
"narHash": "sha256-daN7sEieSw7GRp2LCVVG2F85Xz4zQbhzm26BoO1NlJQ=",
|
||||
"lastModified": 1792524306,
|
||||
"narHash": "sha256-b9S8kVbAWgynkuYcKLAittwfUr26jaE3VDlvkhqva1o=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-greeter",
|
||||
"rev": "a8b106330db763abd17bcb8eba2f58cb94ebf7a8",
|
||||
"rev": "39d3c17ba4349e6ac3af041805132807cd60a056",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -338,33 +320,32 @@
|
||||
"dank-qml-common": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1792156771,
|
||||
"narHash": "sha256-mhJY/aO1R4kovs+uliO2EWIMOlYKCO7yLB7KO8FlzEo=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "2416d14b889d6dcba43d5ec010f7f7da1d3480ea",
|
||||
"lastModified": 1792513666,
|
||||
"narHash": "sha256-RDqPdPrM5lnwRrfFGLz3IwgTjCV2Ie+nrTD3ldj1t/s=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"rev": "ebf5e6c002da1bdaa4aaa2f319fea7b8507abc42",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-qml-common_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1791392812,
|
||||
"narHash": "sha256-id6Y5XNO5K3KfXSOsEYVUwiq1ygYGNX5LeKSgHM3GR8=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "1ae722232da7110d26cd2c355b6615e078e94197",
|
||||
"lastModified": 1792513666,
|
||||
"narHash": "sha256-RDqPdPrM5lnwRrfFGLz3IwgTjCV2Ie+nrTD3ldj1t/s=",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"rev": "ebf5e6c002da1bdaa4aaa2f319fea7b8507abc42",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"ref": "stable-1.6",
|
||||
"repo": "dank-qml-common",
|
||||
"owner": "duxlabs-dev",
|
||||
"repo": "dux-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@@ -379,12 +360,12 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791931075,
|
||||
"narHash": "sha256-LLOKrs6Tu7oFP0krVFFkbpI9VA/+Pb/eD0ubXh1nk6g=",
|
||||
"rev": "4fecae08ae68ce3e620b0eba9234e33227820730",
|
||||
"revCount": 443,
|
||||
"lastModified": 1792199853,
|
||||
"narHash": "sha256-XUYVhEyY9AvkRj6T+LgSz88PdXrvY/5VXtgGQXA4sTk=",
|
||||
"rev": "5f516660eb6faa93f5cb83ef493345967ca719ef",
|
||||
"revCount": 444,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.23.2/01a1376d-c464-74d3-bbc0-b0006b730d57/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.23.3/01a14772-d2d9-7030-899c-f1e2c8b9ba1b/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -394,13 +375,13 @@
|
||||
"determinate-nixd-aarch64-darwin": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"narHash": "sha256-2pC41tcgWgzBIMEEGzJHwJ5tygIYKzoi/hrN+xXiFyw=",
|
||||
"narHash": "sha256-KDNvG7RmcfiqnOcZKhfk4DYmiDGlGzoN32FWNvVYrhw=",
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/macOS"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/macOS"
|
||||
},
|
||||
"original": {
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/macOS"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/macOS"
|
||||
}
|
||||
},
|
||||
"determinate-nixd-aarch64-darwin_2": {
|
||||
@@ -418,13 +399,13 @@
|
||||
"determinate-nixd-aarch64-linux": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"narHash": "sha256-vq9kq0oxv3qNaikdbMufO9nEs0kvu/TmLt0P3ZBK9W4=",
|
||||
"narHash": "sha256-LXI+yuBR4xuQP20PQrGLUu06xnEINFtIWYGlUHDEnMY=",
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/aarch64-linux"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/aarch64-linux"
|
||||
},
|
||||
"original": {
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/aarch64-linux"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/aarch64-linux"
|
||||
}
|
||||
},
|
||||
"determinate-nixd-aarch64-linux_2": {
|
||||
@@ -442,13 +423,13 @@
|
||||
"determinate-nixd-x86_64-linux": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"narHash": "sha256-iEMcghBU9LHNMjxzthvltzqQ84woBfPZOa4WEuLkTmY=",
|
||||
"narHash": "sha256-MOAg/08b8dXhGKGpM5G/S7vz9faMVNtUEEhXWFa956A=",
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/x86_64-linux"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/x86_64-linux"
|
||||
},
|
||||
"original": {
|
||||
"type": "file",
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.2/x86_64-linux"
|
||||
"url": "https://install.determinate.systems/determinate-nixd/tag/v3.23.3/x86_64-linux"
|
||||
}
|
||||
},
|
||||
"determinate-nixd-x86_64-linux_2": {
|
||||
@@ -469,7 +450,7 @@
|
||||
"determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux_2",
|
||||
"determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux_2",
|
||||
"nix": "nix_2",
|
||||
"nixpkgs": "nixpkgs_7"
|
||||
"nixpkgs": "nixpkgs_6"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1788427446,
|
||||
@@ -521,11 +502,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789770686,
|
||||
"narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=",
|
||||
"lastModified": 1792526520,
|
||||
"narHash": "sha256-3hSJlv8mUVnZPMWK2+CM7a9O+nR6Z4mCh27NfLCmTPc=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "725ea35e410ad83be4931d1bff7e090eacaf3563",
|
||||
"rev": "cedd626e11b635470fa6f9fdb8ad79b0075dd7f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -565,11 +546,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791395223,
|
||||
"narHash": "sha256-yDBOoDewH8LwfsZrG4x5vaCstmp6w2vV70j9hC6dIuk=",
|
||||
"lastModified": 1792523829,
|
||||
"narHash": "sha256-hyWdbsyOGXsJxvXG4Tqg0uRI1s3JwPi8DKyWips3Ta8=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "DankMaterialShell",
|
||||
"rev": "4a87e8227daf0840b3376fd5e7f891f5900165a6",
|
||||
"rev": "9b413296b16721f7679fb62e624cb1ed2433fa58",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -872,15 +853,15 @@
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"fenix": "fenix",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791925264,
|
||||
"narHash": "sha256-+atNStmGGHmlRWrlv9zw+/GXZ0rkAYASAueCbU5AsrQ=",
|
||||
"lastModified": 1792160341,
|
||||
"narHash": "sha256-ru99NNgRSl1L8l+2gQh0MuhqQp8npSv6Pns4qJm0j4M=",
|
||||
"owner": "flox",
|
||||
"repo": "flox",
|
||||
"rev": "239bceab9d2f7baff5987ed90029c953f8544af3",
|
||||
"rev": "a6a3147737de635ecb64ecc4dacea43e8e527ce0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1079,7 +1060,7 @@
|
||||
},
|
||||
"herdr": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
@@ -1102,16 +1083,16 @@
|
||||
"devenv": "devenv",
|
||||
"git-hooks": "git-hooks_3",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpkgs": "nixpkgs_8",
|
||||
"nixpkgs": "nixpkgs_7",
|
||||
"nutest": "nutest",
|
||||
"treefmt-nix": "treefmt-nix_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791570912,
|
||||
"narHash": "sha256-qWpBgsVYqmK3vKtoUm7/w1B2mOwHkridUyc1ESAooVg=",
|
||||
"lastModified": 1793031979,
|
||||
"narHash": "sha256-PKMdT/idOFtPwj03PzWzIO4prgPCtMsG1ig1FUlCeTM=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "30427e3975637593c995d357815b99aecb512cfa",
|
||||
"revCount": 43,
|
||||
"rev": "ed558a196fcbc65c1af82fb0f54fdd6773c76b66",
|
||||
"revCount": 47,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@gitea.app.internal:22/ari/hermenix.git"
|
||||
},
|
||||
@@ -1124,18 +1105,18 @@
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_4",
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs_9",
|
||||
"nixpkgs": "nixpkgs_8",
|
||||
"npm-lockfile-fix": "npm-lockfile-fix",
|
||||
"pyproject-build-systems": "pyproject-build-systems",
|
||||
"pyproject-nix": "pyproject-nix",
|
||||
"uv2nix": "uv2nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792184180,
|
||||
"narHash": "sha256-4iNfCRKHQIMsKOT0HdRU8Y+Z+4T9w7T3KVeTnRKIREQ=",
|
||||
"lastModified": 1792555911,
|
||||
"narHash": "sha256-31YuxCvFj0T39N4rEBYiG+mQDZ4bxqIAakFijYvS8dI=",
|
||||
"owner": "NousResearch",
|
||||
"repo": "hermes-agent",
|
||||
"rev": "e7e839a5f4298bf98f086dde1ac49fc8de5ecad3",
|
||||
"rev": "cf4f3a7396814ffcaef69d9af09f7cfdade3ddbe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1192,11 +1173,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791938526,
|
||||
"narHash": "sha256-yNYK2pdk3bCtJrpblrNYA6hZKdybWUeyTtx74+OEJFo=",
|
||||
"lastModified": 1792438572,
|
||||
"narHash": "sha256-5mQQOcggBRBXB7NlzUxO0dbvQN4euJOISjNybrtfxPk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "32904dfe1cf86039f3c8c9f41f94e1cfd76dbb34",
|
||||
"rev": "24f8f8e786f87d6a818e1746cb2389bf922afdab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1413,21 +1394,22 @@
|
||||
"hyprutils": "hyprutils",
|
||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||
"hyprwire": "hyprwire",
|
||||
"nixpkgs": "nixpkgs_10",
|
||||
"nixpkgs": "nixpkgs_9",
|
||||
"pre-commit-hooks": "pre-commit-hooks_2",
|
||||
"systems": "systems",
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792164938,
|
||||
"narHash": "sha256-4JnTrBgwuVMo5cihxgumqBAk26M7YOK9R6aVc1gqhrk=",
|
||||
"lastModified": 1793183825,
|
||||
"narHash": "sha256-MMn1clKPz3FyrFEq39OqXZ2SO3QBaOOFtAFVIcO+VvU=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "25f09b26f9db7dbca4a4b3c265fdb96802db122c",
|
||||
"rev": "0aa6745f705f2c4b0a5004eb019ef76e5bbdb426",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"ref": "v0.57.0",
|
||||
"repo": "Hyprland",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -1546,11 +1528,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791277361,
|
||||
"narHash": "sha256-+dv/mMnrw+uBgY+WW3KpoKQ8Nl3bVLS3lknXsbJ03zQ=",
|
||||
"lastModified": 1792149240,
|
||||
"narHash": "sha256-g09dB6NCTzD4F6YgYrGXRhUfG52xwxUtlMAbHvv/1gE=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"rev": "4c27ba9ce104782bf718aabf59df3f503afe7caa",
|
||||
"rev": "044a434ec371f985655389bcef09286b1af3d77c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1747,15 +1729,15 @@
|
||||
"hyprutils": "hyprutils_2",
|
||||
"hyprwayland-scanner": "hyprwayland-scanner_2",
|
||||
"hyprwire": "hyprwire_2",
|
||||
"nixpkgs": "nixpkgs_11",
|
||||
"nixpkgs": "nixpkgs_10",
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1788960399,
|
||||
"narHash": "sha256-SOr8P3nkyFfgnXtGPNamZ8BqWAdedG/K7PmFSmVBZi0=",
|
||||
"lastModified": 1792447276,
|
||||
"narHash": "sha256-Sle245RO67pPNFd7IdvGHluB3bFqoFZlbIgYxrG3AZ0=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlauncher",
|
||||
"rev": "339be04ba0fa8cde392dd0bae85cb23bf09212a5",
|
||||
"rev": "d08efd580c782fbf52ec299f77cd6c0fef7ee3d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1922,11 +1904,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789968180,
|
||||
"narHash": "sha256-YGRfhw+fJW7oKW3IspoceD34jeokN1KXNxKU6APlFH4=",
|
||||
"lastModified": 1792673440,
|
||||
"narHash": "sha256-7l2+xIZ7IU9r4h9ngSrGH7oQs8XZj0NR0V+96wkN8zk=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprutils",
|
||||
"rev": "95983ee836ff205e615bba67d1f67098e1231941",
|
||||
"rev": "0d13d5a624eb093b600d1b2cbe448fb613c86424",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2080,11 +2062,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786464294,
|
||||
"narHash": "sha256-ZQsZ2WvBdkboCIyh8LStDPdAIARmxzn0XMNxxoOhjPE=",
|
||||
"lastModified": 1792081530,
|
||||
"narHash": "sha256-SRs96bR3VbViiQ1vOhZOqy/HxczIWCoHaGKhncwr1js=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwire",
|
||||
"rev": "4ce7cd6b6128c1ac41caf23c58a30a26b327f9dd",
|
||||
"rev": "a546e42d45e161682f729ebf52375bd4800d7041",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2154,6 +2136,45 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"looprail": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1795206835,
|
||||
"narHash": "sha256-9MP7M7Ifw6nU+K+38rymjG+z6a1jSJSQxzvMzFNcwoM=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "d6b3a8eababef6389895e126814659476e2ae1ee",
|
||||
"revCount": 261,
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
||||
}
|
||||
},
|
||||
"looprail_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_11"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1795060300,
|
||||
"narHash": "sha256-T+k1mIiNGYPQFfvorraVlEy5qDIqMHtdprkbWFCOJ7k=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "70be15ae9d29264dd85c892b86209af486a92e6a",
|
||||
"revCount": 136,
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
||||
},
|
||||
"original": {
|
||||
"rev": "70be15ae9d29264dd85c892b86209af486a92e6a",
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/LoopRail.git"
|
||||
}
|
||||
},
|
||||
"mcp-servers-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -2215,22 +2236,43 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nbot": {
|
||||
"inputs": {
|
||||
"looprail": "looprail_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1795132051,
|
||||
"narHash": "sha256-xPfYpDSNbLda+oKo/MIKEua20dKh/XoB4Tx5uUbeF5Q=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "87839b5992e215f43e69833359b8c76e89027495",
|
||||
"revCount": 1702,
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/nBot.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/SkyG-Org/nBot.git"
|
||||
}
|
||||
},
|
||||
"nix": {
|
||||
"inputs": {
|
||||
"bdwgc": "bdwgc",
|
||||
"flake-parts": "flake-parts",
|
||||
"git-hooks-nix": "git-hooks-nix",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-23-11": "nixpkgs-23-11",
|
||||
"nixpkgs-regression": "nixpkgs-regression"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791922994,
|
||||
"narHash": "sha256-Ir2Kf9gGrXqh48My/k5xMzKbWS9JSthDPjdBOmhnzrE=",
|
||||
"rev": "b9ca37a0d89afc5a8cf4ee56c6702374aa9c9c87",
|
||||
"revCount": 27692,
|
||||
"lastModified": 1792188996,
|
||||
"narHash": "sha256-+wZuesAaCfqohENc3UCsKiNbdarDZp+8oyiLRPUfdj4=",
|
||||
"rev": "74d688aa7b83ee1894ac1881eb3421b4c3fe3677",
|
||||
"revCount": 27730,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.23.2/01a1373f-90c9-72d3-88dc-22c960d482fd/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.23.3/01a14714-69e8-7d01-ac2d-b090f90c9c0d/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -2244,11 +2286,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786845137,
|
||||
"narHash": "sha256-oQFip+v0luP8NIxJzmiW4Wu8bILsbFWom5l0zonl8hQ=",
|
||||
"lastModified": 1792366139,
|
||||
"narHash": "sha256-jto4pdsl0bgErQ5vaMc3gOyj//PILLRJuqX3I7fUk6s=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "4cff07de74b50e64bdd68cd4e722ab5b6b35ee48",
|
||||
"rev": "f0ec2b3fae4df92ea7788359aef9e07bb88d720f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2296,11 +2338,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791711434,
|
||||
"narHash": "sha256-LpIhxnuO0tYeZ4k7BbNMxsPs2zJpB4hWXO1jdhUuE7Q=",
|
||||
"lastModified": 1792309949,
|
||||
"narHash": "sha256-2DAEMk8YkV8OF6N2uw9jQ016cYoNkcgnq50AShwWxNw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "9a2dd40780eeab8543aa97c59c26f11267025616",
|
||||
"rev": "1b4d1758fa6053c5d6284254a793134fa602fbff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2335,7 +2377,7 @@
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks-nix": "git-hooks-nix_2",
|
||||
"nixpkgs": "nixpkgs_6",
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"nixpkgs-23-11": "nixpkgs-23-11_2",
|
||||
"nixpkgs-regression": "nixpkgs-regression_2"
|
||||
},
|
||||
@@ -2552,11 +2594,11 @@
|
||||
"nixpkgs": "nixpkgs_13"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791721963,
|
||||
"narHash": "sha256-BYhx89XJltnRyQeuDKHVL5eSqbbfAcOKuDts7QRsrxQ=",
|
||||
"lastModified": 1792491056,
|
||||
"narHash": "sha256-6n1Dn+WYtD8lprnSi+0k4FjbKfIVNG8lblpJ5MiiqXs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "60a624466c08787ee8303393b7d4752d1826f14f",
|
||||
"rev": "efb6d0d5e2394c3c5416a18652808aba206c0988",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -2646,6 +2688,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-slack": {
|
||||
"locked": {
|
||||
"lastModified": 1794707698,
|
||||
"narHash": "sha256-5KAH1e8u/12aNUz79IA8xUlrzrwHIaxISaGoxsB/MyA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "713bc1926b25ad17376e552e339faeea73cf86dc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "713bc1926b25ad17376e552e339faeea73cf86dc",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1789009968,
|
||||
@@ -2664,12 +2722,12 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1791956154,
|
||||
"narHash": "sha256-jBYGPi4udQ9uo4KQp9m2J0546nJVQitG15gvZSaVVAs=",
|
||||
"rev": "55bfb4d7437bd4e09ab7cba58a43bd68eb310044",
|
||||
"revCount": 1092090,
|
||||
"lastModified": 1793540411,
|
||||
"narHash": "sha256-fiPJ88izTVucjeo2EQ3jk4aWmLg03I1D4vxnX2QjEgE=",
|
||||
"rev": "0bb2eedc20e4739f29e8045034f2828ad7054f8f",
|
||||
"revCount": 1106360,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.1092090%2Brev-55bfb4d7437bd4e09ab7cba58a43bd68eb310044/01a13e8e-a023-7172-9d82-64cacaeab765/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.1106360%2Brev-0bb2eedc20e4739f29e8045034f2828ad7054f8f/01a19d56-7554-7803-a091-6a18d4aafdff/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -2677,22 +2735,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_10": {
|
||||
"locked": {
|
||||
"lastModified": 1791734076,
|
||||
"narHash": "sha256-i5qk1kLiit98rRbh1AXmWBNT9QXC/y4l5Wk/u5EdpDQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7fd4004d0511991fff3a0524856a9be09e28c5f0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_11": {
|
||||
"locked": {
|
||||
"lastModified": 1786247143,
|
||||
"narHash": "sha256-8S3Kcxs7D4UtxJxSJZz0m14CGhuW0MxfrIwJxeGWGnQ=",
|
||||
@@ -2708,6 +2750,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_11": {
|
||||
"locked": {
|
||||
"lastModified": 1794537146,
|
||||
"narHash": "sha256-Wpz/7x/YWnDIBu7yj6ixe8j6fIMsidd9Y+o1PqPF3iM=",
|
||||
"rev": "d5cc6833999746cffdfe0598f7bc801a57b887a9",
|
||||
"revCount": 1119549,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.1119549%2Brev-d5cc6833999746cffdfe0598f7bc801a57b887a9/01a1de0c-832c-7c20-8d39-1fe64a0165e2/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||
}
|
||||
},
|
||||
"nixpkgs_12": {
|
||||
"locked": {
|
||||
"lastModified": 1788404924,
|
||||
@@ -2739,12 +2795,12 @@
|
||||
},
|
||||
"nixpkgs_14": {
|
||||
"locked": {
|
||||
"lastModified": 1792030654,
|
||||
"narHash": "sha256-OaQwAtPMTjQiY2sT/2/62UbSPhzP/0aDnWzMm/NCiUw=",
|
||||
"rev": "26f4107e47e3ad0ffd0db220469ba83b6f6d96e8",
|
||||
"revCount": 1016276,
|
||||
"lastModified": 1792503283,
|
||||
"narHash": "sha256-vhe2jyvRCgufWPqDuDq1S3t3ypE+ka46IFutV02xKso=",
|
||||
"rev": "cd4ea8d57de16f4810bc5f14207bac45fbf19f67",
|
||||
"revCount": 1016588,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1016276%2Brev-26f4107e47e3ad0ffd0db220469ba83b6f6d96e8/01a1433c-549b-7ac2-81f6-cad5d560ff29/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1016588%2Brev-cd4ea8d57de16f4810bc5f14207bac45fbf19f67/01a15a66-c0c8-7d12-a22b-b520ae972e17/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -2752,22 +2808,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1787323337,
|
||||
"narHash": "sha256-PqomwlB2WugM9MC4tV1L2/yosMOfug3KBDjmqOqD1bU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6062ba1a1b8b6281b12533c9075a2dbeb38f7e49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-26.05-darwin",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1787962033,
|
||||
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
|
||||
@@ -2781,7 +2821,7 @@
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.2605"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1774386573,
|
||||
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
|
||||
@@ -2797,7 +2837,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1779911860,
|
||||
"narHash": "sha256-ubcLAcKBDCZjhxw/kH5DL5GdBZQdzLqpkTe7HonvJVs=",
|
||||
@@ -2813,7 +2853,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_6": {
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1787962033,
|
||||
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
|
||||
@@ -2827,7 +2867,7 @@
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.2605"
|
||||
}
|
||||
},
|
||||
"nixpkgs_7": {
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1787498568,
|
||||
"narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=",
|
||||
@@ -2841,7 +2881,7 @@
|
||||
"url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1"
|
||||
}
|
||||
},
|
||||
"nixpkgs_8": {
|
||||
"nixpkgs_7": {
|
||||
"locked": {
|
||||
"lastModified": 1789286504,
|
||||
"narHash": "sha256-eiEK7cKZORNEvX0GeF3RtNEF/JXhgf2RqSp3230q13E=",
|
||||
@@ -2855,7 +2895,7 @@
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"nixpkgs_8": {
|
||||
"locked": {
|
||||
"lastModified": 1785318670,
|
||||
"narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=",
|
||||
@@ -2871,6 +2911,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_9": {
|
||||
"locked": {
|
||||
"lastModified": 1792210252,
|
||||
"narHash": "sha256-Mh0PUaIv4nFY+8wAGonaEh8iBzwsmdNlwjVHmFg1Biw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "09063bd1f2b36fd9fd793c36dfade7bd40a93dfc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"noctalia": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -2878,11 +2934,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792113651,
|
||||
"narHash": "sha256-OAXcxtszGBk6CSHFnqT0bpH+AovFgBYsJBMHEh50UsA=",
|
||||
"lastModified": 1792545098,
|
||||
"narHash": "sha256-Lwn33HocHS15v8ymkwUFh5Y+OGOq7jdkESkPlRgalsk=",
|
||||
"owner": "noctalia-dev",
|
||||
"repo": "noctalia-shell",
|
||||
"rev": "eeea6ff75cd71f9dbcd3acea6035449fefe3c71a",
|
||||
"rev": "0c192f8ff162f9273b2abbce6a12403e1428811e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -3092,7 +3148,6 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"ai-usagebar": "ai-usagebar",
|
||||
"buildbot-nix": "buildbot-nix",
|
||||
"dank-greeter": "dank-greeter",
|
||||
"determinate": "determinate",
|
||||
@@ -3107,20 +3162,22 @@
|
||||
"home-manager": "home-manager_2",
|
||||
"hyprland": "hyprland",
|
||||
"hyprlauncher": "hyprlauncher",
|
||||
"looprail": "looprail",
|
||||
"my-nixpkgs": "my-nixpkgs",
|
||||
"nbot": "nbot",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-flatpak": "nix-flatpak",
|
||||
"nix-index-database": "nix-index-database",
|
||||
"nixarchy": "nixarchy",
|
||||
"nixos-hardware": "nixos-hardware_2",
|
||||
"nixpkgs": "nixpkgs_14",
|
||||
"nixpkgs-slack": "nixpkgs-slack",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"noctalia": "noctalia",
|
||||
"skyg-linux-tracker": "skyg-linux-tracker",
|
||||
"skygqts": "skygqts",
|
||||
"stylix": "stylix",
|
||||
"systems": "systems_6",
|
||||
"tether": "tether"
|
||||
"systems": "systems_6"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
@@ -3190,11 +3247,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792243194,
|
||||
"narHash": "sha256-GYgEoGZOoqJjebzMZ+SFr/i47QmQdp5/uUbDPjzzakU=",
|
||||
"lastModified": 1792555953,
|
||||
"narHash": "sha256-kwm88PW7ACkMail4EeIurkPBOEe7VhXHS+LJMpFDTho=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "81e99f86673a478be4b57c47f75db77a743ee7a1",
|
||||
"revCount": 66,
|
||||
"rev": "72fccc34f8557d80e2c0507bc762355fd6e88368",
|
||||
"revCount": 217,
|
||||
"type": "git",
|
||||
"url": "https://gitea.skyg.ca/ari/skyg-linux-tracker.git"
|
||||
},
|
||||
@@ -3210,11 +3267,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792178298,
|
||||
"narHash": "sha256-oMfBnDNFkGeX7hPKnj4brXh6uf2bDJGU2S2WLpRLx/0=",
|
||||
"lastModified": 1793122942,
|
||||
"narHash": "sha256-J7Jl1K9lAqHoBFffl0fVMwz9Dfe/uD3bduvqetpZlas=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "d42e24be81536210599729c2888bfdd8559fd84e",
|
||||
"revCount": 35,
|
||||
"rev": "3cb0d69d10511aba56ff1459615028309d628b79",
|
||||
"revCount": 40,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@gitea.app.internal:22/ari/skygqts.git"
|
||||
},
|
||||
@@ -3385,26 +3442,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tether": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1792117551,
|
||||
"narHash": "sha256-rBGYybDDl4z3PVDqcufcBpVlut7lUmJBT82gB4+Vxj0=",
|
||||
"owner": "zackb",
|
||||
"repo": "tether",
|
||||
"rev": "1ba845485358c6777fc5c12f8143488c5d524cb9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "zackb",
|
||||
"repo": "tether",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tinted-kitty": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -3477,11 +3514,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791490544,
|
||||
"narHash": "sha256-qScE7Wz6Zg7eg8ItUpnkmKgst8weWschGe0E8jM4rj4=",
|
||||
"lastModified": 1791885023,
|
||||
"narHash": "sha256-C3alQ2MEt0zVrUSho5NUDo3jmhbff72++bfwoqT9Omo=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "4cfe8d7065cc8ca91c0a50361b6dd74920eeb1f5",
|
||||
"rev": "0d6d739a833ba9a9c93034862e4a7b061a062a1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
skygqts.url = "git+ssh://gitea@gitea.app.internal:22/ari/skygqts.git";
|
||||
skygqts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
hermenix.url = "git+ssh://gitea@gitea.app.internal:22/ari/hermenix.git";
|
||||
nbot = {
|
||||
url = "git+ssh://git@github.com/SkyG-Org/nBot.git";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
looprail = {
|
||||
url = "git+ssh://git@github.com/SkyG-Org/LoopRail.git";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
# Read-only host monitor (systemd, journal, Docker) over REST + MCP.
|
||||
skyg-linux-tracker = {
|
||||
url = "git+https://gitea.skyg.ca/ari/skyg-linux-tracker.git";
|
||||
@@ -26,6 +34,8 @@
|
||||
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
|
||||
determinate.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0";
|
||||
# Slack 4.53.287, NixOS/nixpkgs#557737.
|
||||
nixpkgs-slack.url = "github:NixOS/nixpkgs/713bc1926b25ad17376e552e339faeea73cf86dc";
|
||||
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
||||
# my fork of nixpkgs
|
||||
my-nixpkgs.url = "github:asosnovsky/nixpkgs/ds4-init";
|
||||
@@ -81,19 +91,17 @@
|
||||
};
|
||||
# Hyprland
|
||||
hyprlauncher.url = "github:hyprwm/hyprlauncher";
|
||||
# Hyprland compositor via flake (latest git).
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
# Hyprland compositor via flake — pinned to the latest stable release tag
|
||||
# (was floating on main, 50 commits past v0.57.0, which caused a
|
||||
# compositor render-spin episode on fwbook: ~4-core spin, 100°C, no
|
||||
# suspend requested). Re-lock with: nix flake lock --update-input hyprland
|
||||
hyprland.url = "github:hyprwm/Hyprland/v0.57.0";
|
||||
|
||||
# Secrets management
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
|
||||
# Tether — iPhone ↔ Linux Wayland bridge
|
||||
tether = {
|
||||
url = "github:zackb/tether";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
herdr.url = "github:herdrdev/herdr";
|
||||
ai-usagebar.url = "github:akitaonrails/ai-usagebar";
|
||||
# Declarative disk partitioning (for nixos-anywhere installs)
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
@@ -110,8 +118,11 @@
|
||||
, skygqts
|
||||
, hermenix
|
||||
, skyg-linux-tracker
|
||||
, nbot
|
||||
, looprail
|
||||
, hhstream
|
||||
, nixpkgs-unstable
|
||||
, nixpkgs-slack
|
||||
, flox
|
||||
, determinate
|
||||
, nixos-hardware
|
||||
@@ -132,10 +143,8 @@
|
||||
, nix-index-database
|
||||
, agenix
|
||||
, hermes-agent
|
||||
, tether
|
||||
, herdr
|
||||
, disko
|
||||
, ai-usagebar
|
||||
, buildbot-nix
|
||||
}:
|
||||
let
|
||||
@@ -181,11 +190,25 @@
|
||||
buildbot-gitea-oauth-secret = ./secrets/buildbot-gitea-oauth-secret.age;
|
||||
immich-shared = ./secrets/immich-shared.age;
|
||||
grafana-secret-key = ./secrets/grafana-secret-key.age;
|
||||
umami-app-secret = ./secrets/umami-app-secret.age;
|
||||
linux-tracker-peer-minipc1 = ./secrets/linux-tracker-peer-minipc1.age;
|
||||
linux-tracker-peer-minipc2 = ./secrets/linux-tracker-peer-minipc2.age;
|
||||
linux-tracker-peer-minipc3 = ./secrets/linux-tracker-peer-minipc3.age;
|
||||
linux-tracker-peer-bigbox1 = ./secrets/linux-tracker-peer-bigbox1.age;
|
||||
linux-tracker-peer-bigbox2 = ./secrets/linux-tracker-peer-bigbox2.age;
|
||||
linux-tracker-peer-terra1 = ./secrets/linux-tracker-peer-terra1.age;
|
||||
scrypted-envs = ./secrets/scrypted-envs.age;
|
||||
nbot-slack = ./secrets/nbot-slack.age;
|
||||
nbot-goose = ./secrets/nbot-goose.age;
|
||||
nbot-cluster = ./secrets/nbot-cluster.age;
|
||||
nbot-cluster-hl-fws1 = ./secrets/nbot-cluster-hl-fws1.age;
|
||||
github-runner-token-fws1 = ./secrets/github-runner-token-fws1.age;
|
||||
};
|
||||
inherit
|
||||
hyprlauncher
|
||||
hyprland
|
||||
nixpkgs-unstable
|
||||
nixpkgs-slack
|
||||
my-nixpkgs
|
||||
dms
|
||||
dank-greeter
|
||||
@@ -196,12 +219,12 @@
|
||||
skygqts
|
||||
hermenix
|
||||
skyg-linux-tracker
|
||||
nbot
|
||||
looprail
|
||||
hhstream
|
||||
flox
|
||||
determinate
|
||||
tether
|
||||
herdr
|
||||
ai-usagebar
|
||||
;
|
||||
};
|
||||
}
|
||||
@@ -220,11 +243,40 @@
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
qtDocs = pkgs.qt6.qtdoc;
|
||||
# Hook: run skyg pkgs update --all at most once a week; fail if it bumped
|
||||
# anything under pkgs/ so bumps get reviewed and staged, never auto-committed.
|
||||
pkgs-update-script = pkgs.writeShellScriptBin "skyg-pkgs-update" ''
|
||||
set -euo pipefail
|
||||
export PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.curl}/bin:${pkgs.jq}/bin:${pkgs.git}/bin:${pkgs.gnused}/bin:${pkgs.gawk}/bin:$PATH
|
||||
root=$(${pkgs.git}/bin/git rev-parse --show-toplevel)
|
||||
cd "$root"
|
||||
stamp=$(${pkgs.git}/bin/git rev-parse --git-path pkgs-update-last-success)
|
||||
now=$(date +%s)
|
||||
last_run=$(date -r "$stamp" +%s 2>/dev/null || echo 0)
|
||||
if (( now - last_run < 604800 )); then
|
||||
exit 0
|
||||
fi
|
||||
${pkgs.nushell}/bin/nu --commands 'use ./bin/lib/cmds.nu *; skyg pkgs update --all'
|
||||
touch "$stamp"
|
||||
if ! ${pkgs.git}/bin/git diff --quiet -- pkgs/; then
|
||||
echo ""
|
||||
echo "pkgs-update: version bumps applied under pkgs/ — review 'git diff pkgs/',"
|
||||
echo "stage them ('git add pkgs/') and commit again."
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
pre-commit-check = git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
stylua.enable = true;
|
||||
pkgs-update = {
|
||||
enable = true;
|
||||
entry = "${pkgs-update-script}/bin/skyg-pkgs-update";
|
||||
language = "system";
|
||||
pass_filenames = false;
|
||||
always_run = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
@@ -244,6 +296,7 @@
|
||||
agenix.packages.${system}.default
|
||||
age
|
||||
yq
|
||||
nak
|
||||
home-manager.packages.${system}.home-manager
|
||||
rustc
|
||||
cargo
|
||||
@@ -302,9 +355,9 @@
|
||||
skyg-dns-records = dnsRecordsFile;
|
||||
ds4 = my-nixpkgs.legacyPackages.${system}.ds4;
|
||||
buzz-desktop = lib.pkgs.${system}.buzz-desktop;
|
||||
superset-desktop = lib.pkgs.${system}.superset-desktop;
|
||||
delta-editor = lib.pkgs.${system}.delta-editor;
|
||||
colibri = lib.pkgs.${system}.colibri;
|
||||
llama-cpp-halo = lib.pkgs.${system}.llama-cpp-halo;
|
||||
herdr = herdr.packages.${system}.default;
|
||||
}
|
||||
);
|
||||
@@ -334,6 +387,7 @@
|
||||
./hosts/hl-fws1.disko.nix
|
||||
nixos-hardware.nixosModules.framework-11th-gen-intel
|
||||
disko.nixosModules.disko
|
||||
nbot.nixosModules.host
|
||||
];
|
||||
};
|
||||
hl-fwdesk = lib.makeNixOs {
|
||||
@@ -344,6 +398,7 @@
|
||||
nixos-hardware.nixosModules.framework-desktop-amd-ai-max-300-series
|
||||
hermenix.nixosModules.default
|
||||
buildbot-nix.nixosModules.buildbot-worker
|
||||
nbot.nixosModules.host
|
||||
];
|
||||
};
|
||||
hl-bigbox1 = lib.makeNixOs {
|
||||
|
||||
+5
-5
@@ -31,13 +31,13 @@ hosts/
|
||||
| Folder | Host | Role |
|
||||
| ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `fwbook/` | fwbook | Framework 13 AMD — personal laptop / daily driver |
|
||||
| `hl-fwdesk/` | hl-fwdesk | Framework Desktop AI Max 300 — AI workstation; buildbot-nix CI worker (4 cores) |
|
||||
| `hl-fws1/` | hl-fws1 | Framework 11th Intel — K3s server node |
|
||||
| `hl-bigbox1/` | hl-bigbox1 | AI/compute server (NVIDIA + AMD); Immich machine-learning (CUDA) |
|
||||
| `hl-fwdesk/` | hl-fwdesk | Framework Desktop AI Max 300 — AI workstation; buildbot-nix CI worker (4 cores); nbot master |
|
||||
| `hl-fws1/` | hl-fws1 | Framework 11th Intel — K3s server node; nbot worker |
|
||||
| `hl-bigbox1/` | hl-bigbox1 | AI/compute server (NVIDIA + AMD); Immich machine-learning (CUDA); CPU idle capped at C1 (`processor.max_cstate=1`) against Ryzen idle freezes |
|
||||
| `hl-bigbox2/` | hl-bigbox2 | NFS storage server; Immich server/db (docker, `immich.home.sosnovsky.ca`) |
|
||||
| `hl-minipc1/` | hl-minipc1 | Core infra: Gitea (native or containerized), nix-serve, registry, Buzz (docker, `buzz-manage` CLI), monitoring (Grafana, Prometheus, Loki, OTel collector) |
|
||||
| `hl-minipc2/` | hl-minipc2 | Container/media server |
|
||||
| `hl-minipc3/` | hl-minipc3 | K3s worker node; central Caddy reverse-proxy (`*.home.sosnovsky.ca`, plus `gitea.skyg.ca` HTTP/SSH); buildbot-nix CI master + worker (2 cores) |
|
||||
| `hl-minipc2/` | hl-minipc2 | Container/media server; Umami for LoopRail telemetry (own nspawn container, `10.0.101.14`, reachable only from Caddy) |
|
||||
| `hl-minipc3/` | hl-minipc3 | K3s worker node; central Caddy reverse-proxy (`*.home.sosnovsky.ca`, plus `gitea.skyg.ca` HTTP/SSH); serves LoopRail docs at `looprails.skyg.ca`, plus its guarded telemetry route `/t/v1` → Umami and the LAN-only `umami.home.sosnovsky.ca`; buildbot-nix CI master + worker (2 cores) |
|
||||
| `hl-pi1/` | hl-pi1 | Raspberry Pi CM4 (aarch64) — headless server, SSH only |
|
||||
| `hl-pi2/` | hl-pi2 | Raspberry Pi 4 (aarch64) — headless server, SSH only |
|
||||
| `hl-terra1/` | hl-terra1 | NFS storage + Jellyfin backup |
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
imports = [
|
||||
./hardware-configuration
|
||||
./packages.nix
|
||||
./slack.nix
|
||||
./services.nix
|
||||
./networking.nix
|
||||
./hardware.nix
|
||||
./systemd.nix
|
||||
./omarchy.nix
|
||||
];
|
||||
|
||||
skyg = {
|
||||
@@ -28,6 +30,7 @@
|
||||
printers.enable = true;
|
||||
fixes = {
|
||||
airpod-bluetooth.enabled = true;
|
||||
fingerprint-autosuspend.enabled = true;
|
||||
};
|
||||
tiler = {
|
||||
enable = true;
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
"x-scheme-handler/mailto" = "chromium-browser.desktop";
|
||||
"x-scheme-handler/sgnl" = "signal.desktop";
|
||||
"x-scheme-handler/signalcaptcha" = "signal.desktop";
|
||||
"x-scheme-handler/slack" = "slack.desktop";
|
||||
"x-scheme-handler/slack" = "slack-link-picker.desktop";
|
||||
"x-scheme-handler/terminal" = "com.mitchellh.ghostty.desktop";
|
||||
"application/pdf" = "chromium-browser.desktop";
|
||||
"application/xhtml+xml" = "chromium-browser.desktop";
|
||||
|
||||
@@ -13,6 +13,7 @@ in
|
||||
};
|
||||
networking.firewall.allowedUDPPorts = openPorts;
|
||||
networking.firewall.allowedTCPPorts = openPorts;
|
||||
programs.mosh.enable = true;
|
||||
networking.hosts = {
|
||||
"0.0.0.0" = [
|
||||
"auth.me.internal"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{ pkgs, nixarchy, skygUtils, config, ... }:
|
||||
let
|
||||
# Omarchy shell build
|
||||
dedent = "${pkgs.gawk}/bin/awk 'BEGIN{m=9999} {l[NR]=$0; match($0,/^ */); if ($0 ~ /[^ ]/ && RLENGTH<m) m=RLENGTH} END{for(i=1;i<=NR;i++) print substr(l[i],m+1)}'";
|
||||
omarchy = ((pkgs.extend nixarchy.overlays.default).omarchy).overrideAttrs (old: {
|
||||
installPhase = builtins.replaceStrings
|
||||
[ "python3 -c '" "' $menu\n" ]
|
||||
[ "python3 -c \"$(printf '%s' '" "' | ${dedent})\" $menu\n" ]
|
||||
old.installPhase;
|
||||
});
|
||||
# The shell's runtime deps, minus hyprland (we keep the flake's Hyprland).
|
||||
# Omarchy runtime deps
|
||||
omarchyRuntime = builtins.filter
|
||||
(d: !(pkgs.lib.hasPrefix "hyprland-" (d.name or "")))
|
||||
omarchy.passthru.runtimeDeps;
|
||||
in
|
||||
{
|
||||
# Omarchy env vars (shell resolves paths via OMARCHY_PATH)
|
||||
environment.sessionVariables.OMARCHY_PATH = "${omarchy}/share/omarchy";
|
||||
environment.sessionVariables.OMARCHY_SCREENSHOT_EDITOR = "satty-edit";
|
||||
|
||||
# Omarchy config link: ~/.config/omarchy -> configs/fwbook/omarchy
|
||||
system.userActivationScripts.omarchyConfig.text =
|
||||
skygUtils.makeHyperlinkScriptToConfigs {
|
||||
filePath = "fwbook/omarchy";
|
||||
targetPath = "omarchy";
|
||||
configSource = "/home/${config.skyg.user.name}/nixos-setup/configs";
|
||||
};
|
||||
|
||||
# Packages
|
||||
environment.systemPackages =
|
||||
[ omarchy ]
|
||||
++ omarchyRuntime;
|
||||
}
|
||||
+81
-127
@@ -1,24 +1,5 @@
|
||||
{ pkgs, unstablePkgs, ai-usagebar, hermes-agent, nixarchy, skygUtils, config, ... }:
|
||||
{ pkgs, unstablePkgs, looprail, ... }:
|
||||
let
|
||||
# Omarchy (nixarchy) shell, hand-wired — no nixarchy modules. The shell is
|
||||
# launched from configs/fwbook/hypr/conf/autostart.lua (omarchy-launch-shell).
|
||||
#
|
||||
# Workaround for an upstream bug in nixarchy v4.0.4-1: the omarchy package's
|
||||
# installPhase is one '' string whose least-indented lines are the shell-quoted
|
||||
# omarchy-theme-set patterns (indent 4), so Nix dedents the whole string by 4
|
||||
# and the inline `python3 -c '...'` menu check stays indented -> IndentationError.
|
||||
# Wrap that one invocation so its code is dedented before Python sees it.
|
||||
dedent = "${pkgs.gawk}/bin/awk 'BEGIN{m=9999} {l[NR]=$0; match($0,/^ */); if ($0 ~ /[^ ]/ && RLENGTH<m) m=RLENGTH} END{for(i=1;i<=NR;i++) print substr(l[i],m+1)}'";
|
||||
omarchy = ((pkgs.extend nixarchy.overlays.default).omarchy).overrideAttrs (old: {
|
||||
installPhase = builtins.replaceStrings
|
||||
[ "python3 -c '" "' $menu\n" ]
|
||||
[ "python3 -c \"$(printf '%s' '" "' | ${dedent})\" $menu\n" ]
|
||||
old.installPhase;
|
||||
});
|
||||
# The shell's runtime deps, minus hyprland (we keep the flake's Hyprland).
|
||||
omarchyRuntime = builtins.filter
|
||||
(d: !(pkgs.lib.hasPrefix "hyprland-" (d.name or "")))
|
||||
omarchy.passthru.runtimeDeps;
|
||||
gdk = pkgs.google-cloud-sdk.withExtraComponents (
|
||||
with pkgs.google-cloud-sdk.components;
|
||||
[
|
||||
@@ -26,10 +7,6 @@ let
|
||||
kubectl
|
||||
]
|
||||
);
|
||||
# Resolve bundles its own Qt5, which has no wayland platform plugin. The
|
||||
# Hyprland session exports QT_QPA_PLATFORM=wayland globally
|
||||
# (configs/fwbook/hypr/conf/env.lua), so Resolve aborts at startup. Force
|
||||
# xcb — Resolve is X11-only and runs under XWayland anyway.
|
||||
davinci-resolve-wrapped = pkgs.symlinkJoin {
|
||||
name = "davinci-resolve";
|
||||
paths = [ pkgs.davinci-resolve ];
|
||||
@@ -40,144 +17,121 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
# The shell resolves everything through OMARCHY_PATH.
|
||||
environment.sessionVariables.OMARCHY_PATH = "${omarchy}/share/omarchy";
|
||||
environment.sessionVariables.OMARCHY_SCREENSHOT_EDITOR = "satty-edit";
|
||||
|
||||
# ~/.config/omarchy -> configs/fwbook/omarchy (same pattern as hypr/noctalia).
|
||||
system.userActivationScripts.omarchyConfig.text =
|
||||
skygUtils.makeHyperlinkScriptToConfigs {
|
||||
filePath = "fwbook/omarchy";
|
||||
targetPath = "omarchy";
|
||||
configSource = "/home/${config.skyg.user.name}/nixos-setup/configs";
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
[ omarchy ]
|
||||
++ omarchyRuntime
|
||||
# Theme application: omarchy-theme-set-gnome writes gsettings, and every
|
||||
# theme names a Yaru icon variant.
|
||||
++ (with pkgs; [
|
||||
(with pkgs; [
|
||||
# Desktop & theme
|
||||
glib
|
||||
gsettings-desktop-schemas
|
||||
gnome-themes-extra
|
||||
yaru-theme
|
||||
adwaita-icon-theme
|
||||
])
|
||||
++ (with pkgs; [
|
||||
oreo-cursors-plus
|
||||
|
||||
# Screen & images
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
tesseract
|
||||
wl-screenrec
|
||||
gpu-screen-recorder
|
||||
gifski
|
||||
imagemagick
|
||||
zbar
|
||||
curl
|
||||
translate-shell
|
||||
wl-screenrec
|
||||
tesseract
|
||||
|
||||
# Media & creative
|
||||
obs-studio
|
||||
davinci-resolve-wrapped
|
||||
shotcut
|
||||
ffmpeg
|
||||
gifski
|
||||
libusb1
|
||||
lshw
|
||||
jq
|
||||
parted
|
||||
gparted-full
|
||||
f3
|
||||
nixd
|
||||
kdePackages.qtdeclarative
|
||||
krita
|
||||
gimp-with-plugins
|
||||
simple-scan
|
||||
orca-slicer
|
||||
|
||||
# Chat & meetings
|
||||
zoom-us
|
||||
discord
|
||||
betterdiscordctl
|
||||
signal-desktop
|
||||
telegram-desktop
|
||||
|
||||
# Office
|
||||
onlyoffice-desktopeditors
|
||||
darling-dmg
|
||||
piper-tts
|
||||
ffmpeg
|
||||
oreo-cursors-plus
|
||||
|
||||
postgresql
|
||||
google-cloud-sdk
|
||||
awscli
|
||||
openfortivpn
|
||||
openfortivpn-webview
|
||||
openfortivpn-webview-qt
|
||||
nodejs
|
||||
|
||||
# Wine
|
||||
wineWow64Packages.stable
|
||||
winetricks
|
||||
wineWow64Packages.waylandFull
|
||||
|
||||
obs-studio
|
||||
davinci-resolve-wrapped
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
tesseract
|
||||
imagemagick
|
||||
zbar
|
||||
curl
|
||||
translate-shell
|
||||
wl-screenrec
|
||||
ffmpeg
|
||||
gifski
|
||||
jq
|
||||
# Cloud, VPN & data
|
||||
postgresql
|
||||
google-cloud-sdk
|
||||
gdk
|
||||
awscli
|
||||
openfortivpn
|
||||
openfortivpn-webview
|
||||
openfortivpn-webview-qt
|
||||
bitwarden-cli
|
||||
|
||||
krita
|
||||
gimp-with-plugins
|
||||
shotcut
|
||||
simple-scan
|
||||
|
||||
zoom-us
|
||||
betterdiscordctl
|
||||
discord
|
||||
signal-desktop
|
||||
telegram-desktop
|
||||
# Disks & hardware
|
||||
libusb1
|
||||
lshw
|
||||
parted
|
||||
gparted-full
|
||||
f3
|
||||
rpi-imager
|
||||
rpiboot
|
||||
libimobiledevice
|
||||
ifuse
|
||||
idevicerestore
|
||||
|
||||
# Languages & dev tools
|
||||
nodejs
|
||||
python313
|
||||
python314
|
||||
uv
|
||||
pipx
|
||||
cargo
|
||||
rustc
|
||||
go
|
||||
pipx
|
||||
rust-analyzer
|
||||
|
||||
vscode
|
||||
unstablePkgs.zed-editor-fhs
|
||||
unstablePkgs.devenv
|
||||
nixd
|
||||
kdePackages.qtdeclarative
|
||||
just
|
||||
rpi-imager
|
||||
rpiboot
|
||||
code-cursor-fhs
|
||||
nix-prefetch
|
||||
orca-slicer
|
||||
devcontainer
|
||||
gpu-screen-recorder
|
||||
unstablePkgs.devcontainer
|
||||
unstablePkgs.devenv
|
||||
flox_dev
|
||||
|
||||
darling-dmg
|
||||
|
||||
bitwarden-cli
|
||||
|
||||
onlyoffice-desktopeditors
|
||||
|
||||
nix-prefetch
|
||||
gh
|
||||
gdk
|
||||
unstablePkgs.slack
|
||||
bubblewrap
|
||||
delta-editor
|
||||
|
||||
libimobiledevice
|
||||
ifuse
|
||||
|
||||
idevicerestore
|
||||
# Editors
|
||||
unstablePkgs.vscode
|
||||
unstablePkgs.zed-editor-fhs
|
||||
code-cursor-fhs
|
||||
|
||||
# Agents & LLM tools
|
||||
unstablePkgs.claude-code
|
||||
unstablePkgs.claude-agent-acp
|
||||
unstablePkgs.grok-build
|
||||
unstablePkgs.pi-coding-agent
|
||||
unstablePkgs.goose-cli
|
||||
unstablePkgs.claude-agent-acp
|
||||
unstablePkgs.claude-code
|
||||
buzz-desktop
|
||||
bubblewrap
|
||||
delta-editor
|
||||
herdr
|
||||
superset-desktop
|
||||
ai-usagebar.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
hermes-agent.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
|
||||
skygqts
|
||||
unstablePkgs.herdr
|
||||
unstablePkgs.codex
|
||||
unstablePkgs.codex-acp
|
||||
looprail.packages.${pkgs.stdenv.hostPlatform.system}.looprail
|
||||
hermenix
|
||||
config.services.hyprland-headless-stream.package
|
||||
unstablePkgs.pi-coding-agent
|
||||
|
||||
# Remote & CLI tools
|
||||
unstablePkgs.et
|
||||
curl
|
||||
jq
|
||||
translate-shell
|
||||
buzz-desktop
|
||||
skygqts
|
||||
]);
|
||||
}
|
||||
@@ -1,20 +1,8 @@
|
||||
{ pkgs, unstablePkgs, config, hyprland, ... }:
|
||||
{ unstablePkgs, ... }:
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
services.tailscale.extraDaemonFlags = [ "--statedir=/var/lib/tailscale" ];
|
||||
|
||||
programs.tether = {
|
||||
enable = true;
|
||||
wifi = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
adapters = [ "hci0" ];
|
||||
};
|
||||
};
|
||||
|
||||
services.flatpak.enable = true;
|
||||
services.flatpak.packages = [
|
||||
"io.github.kolunmi.Bazaar"
|
||||
@@ -30,7 +18,7 @@
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
extest.enable = true;
|
||||
extest.enable = false;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
@@ -53,9 +41,4 @@
|
||||
"modesetting"
|
||||
"fbdev"
|
||||
];
|
||||
services.hyprland-headless-stream = {
|
||||
enable = true;
|
||||
hyprlandPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
sessions.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{ pkgs, nixpkgs-slack, ... }:
|
||||
let
|
||||
slack = (import nixpkgs-slack {
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
config.allowUnfreePredicate = pkg: pkgs.lib.getName pkg == "slack";
|
||||
}).slack;
|
||||
slackIcon = "${slack}/share/icons/hicolor/512x512/apps/slack.png";
|
||||
makeSlack =
|
||||
{ id, name, color }:
|
||||
let
|
||||
icon = pkgs.runCommand "slack-${id}-icon.png" { nativeBuildInputs = [ pkgs.imagemagick ]; } ''
|
||||
magick ${slackIcon} -modulate 100,0 -fill '${color}' -tint 100 $out
|
||||
'';
|
||||
bin = pkgs.writeShellScriptBin "slack-${id}" ''
|
||||
exec ${slack}/bin/slack --user-data-dir="''${XDG_CONFIG_HOME:-$HOME/.config}/Slack-${name}" "$@"
|
||||
'';
|
||||
desktop = pkgs.makeDesktopItem {
|
||||
name = "slack-${id}";
|
||||
desktopName = "Slack (${name})";
|
||||
exec = "${bin}/bin/slack-${id} -s %U";
|
||||
inherit icon;
|
||||
startupWMClass = "Slack";
|
||||
categories = [ "Network" "InstantMessaging" ];
|
||||
};
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "slack-${id}";
|
||||
paths = [ bin desktop ];
|
||||
};
|
||||
slack-sibli = makeSlack { id = "sibli"; name = "Sibli"; color = "#2EB67D"; };
|
||||
slack-personal = makeSlack { id = "personal"; name = "Personal"; color = "#4A154B"; };
|
||||
|
||||
# Opens slack:// links in the Slack you pick.
|
||||
slack-link-picker =
|
||||
let
|
||||
bin = pkgs.writeShellScriptBin "slack-link-picker" ''
|
||||
choice=$(printf '%s\n' "Slack" "Slack (Sibli)" "Slack (Personal)" \
|
||||
| ${pkgs.rofi}/bin/rofi -dmenu -i -p "Open Slack link in")
|
||||
case "$choice" in
|
||||
"Slack") exec ${slack}/bin/slack -s "$@" ;;
|
||||
"Slack (Sibli)") exec ${slack-sibli}/bin/slack-sibli -s "$@" ;;
|
||||
"Slack (Personal)") exec ${slack-personal}/bin/slack-personal -s "$@" ;;
|
||||
esac
|
||||
'';
|
||||
desktop = pkgs.makeDesktopItem {
|
||||
name = "slack-link-picker";
|
||||
desktopName = "Slack Link Picker";
|
||||
exec = "${bin}/bin/slack-link-picker %U";
|
||||
icon = "slack";
|
||||
noDisplay = true;
|
||||
mimeTypes = [ "x-scheme-handler/slack" ];
|
||||
};
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "slack-link-picker";
|
||||
paths = [ bin desktop ];
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
slack-sibli
|
||||
slack-personal
|
||||
slack-link-picker
|
||||
];
|
||||
}
|
||||
@@ -1,4 +1,10 @@
|
||||
{ ... }:
|
||||
{
|
||||
systemd.services.systemd-udev-settle.enable = false;
|
||||
|
||||
# Snapper needs a .snapshots subvolume in each snapshotted volume
|
||||
systemd.tmpfiles.rules = [
|
||||
"v /.snapshots 0750 root root -"
|
||||
"v /home/.snapshots 0750 root root -"
|
||||
];
|
||||
}
|
||||
@@ -17,7 +17,9 @@
|
||||
gnome.enable = false;
|
||||
};
|
||||
common.ssh-server.enable = true;
|
||||
common.diagnix.enable = true;
|
||||
|
||||
common.dns.enable = true;
|
||||
common.hardware = {
|
||||
nvidia.enable = true;
|
||||
amdgpu.enable = true;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
boot.kernelParams = [ "processor.max_cstate=1" ];
|
||||
networking.interfaces.enp4s0.wakeOnLan.enable = true;
|
||||
networking.interfaces.lo.wakeOnLan.enable = true;
|
||||
}
|
||||
@@ -5,5 +5,6 @@
|
||||
./portainer.nix
|
||||
./timers.nix
|
||||
./linux-tracker.nix
|
||||
./llama-cpp.nix
|
||||
];
|
||||
}
|
||||
@@ -6,6 +6,7 @@ in
|
||||
skyg.nixos.common.container-services.jellyfin = {
|
||||
enable = true;
|
||||
autoUpdate.enable = true;
|
||||
networks.lan = config.skyg.nixos.common.containers.networks.ipvlanLab.compose;
|
||||
services.jellyfin = {
|
||||
image = "jellyfin/jellyfin";
|
||||
deploy.resources.reservations.devices = [
|
||||
@@ -34,7 +35,7 @@ in
|
||||
JELLYFIN_CONFIG_DIR = "/mnt/apps/jellyfin/config";
|
||||
NVIDIA_VISIBLE_DEVICES = "all";
|
||||
};
|
||||
ports = [ "8096:8096" ];
|
||||
networks.lan.ipv4_address = app.ip;
|
||||
};
|
||||
volumes = {
|
||||
torrents = {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# llama.cpp with DFlash2 speculative decoding on RTX 3060 (12GB VRAM).
|
||||
#
|
||||
# Off by default: it needs ~19 GB of weights on disk. Fetch the files, then
|
||||
# flip enable:
|
||||
#
|
||||
# sudo install -d -o ari -g users /var/lib/llama-cpp
|
||||
# cd /var/lib/llama-cpp
|
||||
# curl -L -O https://huggingface.co/ggml-org/Qwen3.8-27B-GGUF/resolve/main/Qwen3.8-27B-Q4_K_M.gguf
|
||||
# curl -L -O https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2-GGUF/resolve/main/Qwen3.8-27B-DFlash2-Q8_0.gguf
|
||||
#
|
||||
# Measured expectation: ~15-25 tok/s (RTX 3060 has less bandwidth than Strix
|
||||
# Halo, but the dedicated VRAM is snappier for inference).
|
||||
skyg.nixos.server.services.llama-cpp = {
|
||||
enable = false;
|
||||
|
||||
package = "llama-cpp-cuda";
|
||||
model = "/var/lib/llama-cpp/Qwen3.8-27B-Q4_K_M.gguf";
|
||||
draftModel = "/var/lib/llama-cpp/Qwen3.8-27B-DFlash2-Q8_0.gguf";
|
||||
specType = "draft-dflash";
|
||||
specDraftNMax = 7;
|
||||
|
||||
ctx = 32768;
|
||||
kvCacheType = "q8_0";
|
||||
cacheReuse = 256;
|
||||
|
||||
# RTX 3060: 12GB VRAM, offload most layers but leave headroom for context.
|
||||
gpuLayers = 30;
|
||||
parallel = 2;
|
||||
|
||||
host = "0.0.0.0";
|
||||
port = 8081;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
@@ -13,12 +13,16 @@
|
||||
user.enable = true;
|
||||
nixos.common = {
|
||||
ssh-server.enable = true;
|
||||
diagnix.enable = true;
|
||||
|
||||
dns.enable = true;
|
||||
|
||||
containers.networks.ipvlanLab = {
|
||||
enable = true;
|
||||
parent = "enp3s0";
|
||||
};
|
||||
cachePush.enable = false;
|
||||
cacheReceive.enable = true;
|
||||
};
|
||||
|
||||
networkDrives = {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
|
||||
# Interim: the box loses power under load. Use less power and heat, log more.
|
||||
# Remove this block once the new board is in and stable.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, unstablePkgs, myPkgs, my-nixpkgs, ... }:
|
||||
{ pkgs, my-nixpkgs, ... }:
|
||||
let
|
||||
ports = {
|
||||
tabby = 11029;
|
||||
@@ -40,11 +40,18 @@ in
|
||||
|
||||
environment.sessionVariables.ELECTRON_OZONE_PLATFORM_HINT = "wayland";
|
||||
|
||||
programs.nh.clean = {
|
||||
dates = "daily";
|
||||
extraArgs = "--keep-since 2d --keep 5";
|
||||
};
|
||||
|
||||
skyg = {
|
||||
user.enable = true;
|
||||
core.qemu.enable = true;
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.diagnix.enable = true;
|
||||
common.dns.enable = true;
|
||||
common.cachePush.enable = true;
|
||||
common.hardware = {
|
||||
pipewire.enable = true;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
|
||||
systemd.network.wait-online.enable = false;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./ds4.nix
|
||||
./llama-cpp.nix
|
||||
./ollama.nix
|
||||
./libretranslate.nix
|
||||
./hermenix.nix
|
||||
@@ -8,5 +9,6 @@
|
||||
./steam.nix
|
||||
./buildbot.nix
|
||||
./linux-tracker.nix
|
||||
./nbot.nix
|
||||
];
|
||||
}
|
||||
@@ -4,7 +4,7 @@ let
|
||||
in
|
||||
{
|
||||
services.ds4 = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
package = (myPkgs.ds4-rocm.override { rocmArch = "gfx1151"; });
|
||||
user = "ari";
|
||||
group = "users";
|
||||
|
||||
@@ -8,6 +8,7 @@ let
|
||||
hermesCache = 5001;
|
||||
ollama = 11434;
|
||||
ds4 = 8000;
|
||||
tracker = 1984;
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -23,13 +24,14 @@ in
|
||||
hostLanAddress = "10.0.10.11";
|
||||
lanGateway = "10.0.0.1";
|
||||
};
|
||||
vcpu = 2;
|
||||
vcpu = 3;
|
||||
mem = 8000;
|
||||
hermesHome = "/var/lib/hermes/.hermes";
|
||||
hostCache.port = ports.hermesCache;
|
||||
hostAccess = [
|
||||
{ port = ports.ollama; }
|
||||
{ port = ports.ds4; }
|
||||
{ port = ports.tracker; }
|
||||
];
|
||||
lanAccess = [
|
||||
{ address = "10.0.12.1"; port = 80; }
|
||||
@@ -39,8 +41,8 @@ in
|
||||
{ address = "10.0.101.3"; port = 8080; }
|
||||
{ address = "10.0.101.3"; port = 9102; }
|
||||
{ address = "10.0.101.8"; port = 3000; }
|
||||
# skyg-linux-tracker (REST + MCP) on every lab host.
|
||||
{ address = "10.0.0.0/16"; port = 1984; }
|
||||
{ address = "10.0.10.0/24"; port = 22; }
|
||||
|
||||
];
|
||||
publish = [
|
||||
{ hostPort = ports.hermes; guestPort = 8642; }
|
||||
|
||||
@@ -1,12 +1,33 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, skyg-secrets, ... }:
|
||||
let
|
||||
# Hosts this primary tracker consolidates.
|
||||
peers = [ "minipc1" "minipc2" "minipc3" "bigbox1" "bigbox2" "terra1" ];
|
||||
secretName = peer: "linux-tracker-peer-${peer}";
|
||||
in
|
||||
{
|
||||
age.secrets = lib.genAttrs (map secretName peers) (name: {
|
||||
file = skyg-secrets.${name};
|
||||
owner = "root";
|
||||
mode = "0400";
|
||||
});
|
||||
|
||||
services.skyg-linux-tracker = {
|
||||
enable = true;
|
||||
bind = "0.0.0.0";
|
||||
openFirewall = true;
|
||||
docker.enable = config.virtualisation.docker.enable;
|
||||
# Reachable only by its lab FQDN; the short name does not resolve.
|
||||
allowedHosts = [ "fwdesk.lab.internal" ];
|
||||
# The Hermes VM reaches this host at 10.77.0.1.
|
||||
allowedHosts = [ "fwdesk.lab.internal" "10.77.0.1" ];
|
||||
# Primary: one endpoint for the whole lab (Hermes only talks to this one).
|
||||
peers = {
|
||||
enable = true;
|
||||
peers = lib.genAttrs peers (peer: {
|
||||
url = "http://${peer}.lab.internal:1984";
|
||||
tokenFile = config.age.secrets.${secretName peer}.path;
|
||||
# Trackers have no TLS; token travels in the clear on the lab LAN.
|
||||
allowPlainHttp = true;
|
||||
});
|
||||
};
|
||||
# OTLP out to the collector on minipc1.
|
||||
settings.otel = {
|
||||
enabled = true;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# llama.cpp with DFlash2 speculative decoding.
|
||||
#
|
||||
# Off by default: it needs ~19 GB of weights on disk and a first build of the
|
||||
# ROCm package. Fetch the files, then flip enable:
|
||||
#
|
||||
# sudo install -d -o ari -g users /var/lib/llama-cpp
|
||||
# cd /var/lib/llama-cpp
|
||||
# curl -L -O https://huggingface.co/ggml-org/Qwen3.8-27B-GGUF/resolve/main/Qwen3.8-27B-Q4_K_M.gguf
|
||||
# curl -L -O https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2-GGUF/resolve/main/Qwen3.8-27B-DFlash2-Q8_0.gguf
|
||||
#
|
||||
# Measured expectation for this box: ~25-40 tok/s, not the 380 tok/s in the
|
||||
# post that prompted this — that figure is a 3090 copying a document.
|
||||
skyg.nixos.server.services.llama-cpp = {
|
||||
enable = false;
|
||||
|
||||
model = "/var/lib/llama-cpp/Qwen3.8-27B-Q4_K_M.gguf";
|
||||
draftModel = "/var/lib/llama-cpp/Qwen3.8-27B-DFlash2-Q8_0.gguf";
|
||||
specType = "draft-dflash";
|
||||
specDraftNMax = 7;
|
||||
|
||||
ctx = 32768;
|
||||
kvCacheType = "q8_0";
|
||||
cacheReuse = 256;
|
||||
|
||||
host = "0.0.0.0";
|
||||
port = 8081;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
{ config, lib, pkgs, skyg-secrets, ... }:
|
||||
let
|
||||
ports = { cluster = 7946; };
|
||||
homes = "/data/nbot";
|
||||
goCache = "/data/nbot-cache/go";
|
||||
secrets = [ "nbot-slack" "nbot-goose" "nbot-cluster" ];
|
||||
settings = {
|
||||
# The system each container boots (nbot's agent + gh); updated on every rebuild.
|
||||
system = "${config.skyg.nixos.server.services.nbot-agent.system}";
|
||||
machines_dir = "/var/lib/machines";
|
||||
state_dir = "/var/lib/nbot";
|
||||
agent_cwd = "/root";
|
||||
|
||||
idle_timeout = "6h";
|
||||
max_idle_timeout = "0s";
|
||||
allow_indefinite = true;
|
||||
boot_timeout = "2m";
|
||||
|
||||
# Go caches shared by all containers on this node (see ABOUTME). Env vars are in agent_env.
|
||||
rw_binds = [
|
||||
"${goCache}/mod:/var/cache/go/mod:idmap"
|
||||
"${goCache}/build:/var/cache/go/build:idmap"
|
||||
];
|
||||
|
||||
summaries = {
|
||||
timeout = "10s";
|
||||
};
|
||||
|
||||
# Goose settings sent to every container (also on fws1).
|
||||
# Values come from the nbot-goose secret.
|
||||
agent_env = {
|
||||
COMMAND_CODE_API_KEY = "$COMMAND_CODE_API_KEY";
|
||||
GH_TOKEN = "$GH_TOKEN";
|
||||
DIAGNIX_KEY = "$DIAGNIX_KEY";
|
||||
GOMODCACHE = "/var/cache/go/mod";
|
||||
GOCACHE = "/var/cache/go/build";
|
||||
};
|
||||
|
||||
model_providers = [
|
||||
{
|
||||
id = "custom_commandcode";
|
||||
name = "Command Code";
|
||||
key_env = "COMMAND_CODE_API_KEY";
|
||||
models = [
|
||||
"deepseek/deepseek-v4-flash"
|
||||
"minimax/minimax-m3.1-flash"
|
||||
"minimaxai/minimax-m3"
|
||||
"anthropic/claude-opus-5-5"
|
||||
"anthropic/claude-sonnet-5-5"
|
||||
"anthropic/claude-haiku-5-5"
|
||||
"reflection/beam:free"
|
||||
"moonshotai/kimi-k3"
|
||||
"moonshotai/kimi-k2.7-code"
|
||||
"zai-org/glm-5.3"
|
||||
"z-ai/glm-5.3-flash"
|
||||
"xai/grok-4.7"
|
||||
"openai/gpt-6.1-sol"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
container = { memory_mb = 4096; cpus = 1.0; };
|
||||
max_container = { memory_mb = 16384; cpus = 4; };
|
||||
host_reserve = { memory_mb = 32768; cpus = 4.0; };
|
||||
storage = { min = "2G"; max = "5G"; limit = "20G"; };
|
||||
drives = [{ path = homes; reserve = "40G"; allow_subdir = true; }];
|
||||
|
||||
cluster = {
|
||||
node_secrets = { hl-fws1 = "$HL_FWS1_CLUSTER_SECRET"; };
|
||||
listen = ":${toString ports.cluster}";
|
||||
};
|
||||
|
||||
# Only read on first start; after that, manage permissions from Slack.
|
||||
permissions = {
|
||||
managers = [ "U0CBGSS4U6A" ];
|
||||
default.U0CBGSS4U6A = [ "all" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
age.secrets = lib.genAttrs secrets (name: {
|
||||
file = skyg-secrets.${name};
|
||||
owner = "root";
|
||||
mode = "0400";
|
||||
});
|
||||
|
||||
# nbot flake input; options and docs in its repo.
|
||||
services.nbot = {
|
||||
enable = true;
|
||||
mode = "master";
|
||||
clusterPort = ports.cluster;
|
||||
kvm = true;
|
||||
drives = [ homes ];
|
||||
stateDir = "/var/lib/nbot";
|
||||
configFile = (pkgs.formats.toml { }).generate "nbot.toml" settings;
|
||||
};
|
||||
|
||||
# The module takes one env file; these add to it.
|
||||
systemd.services.nbot.serviceConfig.EnvironmentFile =
|
||||
map (name: config.age.secrets.${name}.path) secrets;
|
||||
|
||||
# Container links belong to systemd-networkd.
|
||||
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
||||
networking.dhcpcd.denyInterfaces = [ "ve-*" ];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${homes} 0700 root root -"
|
||||
"d ${goCache}/mod 0700 root root -"
|
||||
"d ${goCache}/build 0700 root root -"
|
||||
];
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
extest.enable = true;
|
||||
extraPackages = [ pkgs.pulseaudio ];
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./services.nix
|
||||
./services
|
||||
./hardware-configuration
|
||||
./hardware.nix
|
||||
./systemd.nix
|
||||
@@ -11,6 +11,8 @@
|
||||
user.enable = true;
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.diagnix.enable = true;
|
||||
common.dns.enable = true;
|
||||
common.hardware.pipewire.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
@@ -53,6 +55,11 @@
|
||||
playerctl
|
||||
];
|
||||
|
||||
programs.nh.clean = {
|
||||
dates = "daily";
|
||||
extraArgs = "--keep-since 2d --keep 5";
|
||||
};
|
||||
|
||||
services.flatpak.enable = true;
|
||||
services.flatpak.packages = [ "com.spotify.Client" ];
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./nbot.nix ./github-runners.nix ];
|
||||
|
||||
services.pipewire = {
|
||||
extraConfig.pipewire-pulse."10-raop-discover" = {
|
||||
context.modules = [
|
||||
@@ -0,0 +1,78 @@
|
||||
{ config, lib, skyg-secrets, ... }:
|
||||
let
|
||||
concurrency = 4;
|
||||
runnerNames = map (i: "runner-${toString i}") (lib.range 1 concurrency);
|
||||
stateVersion = config.system.stateVersion;
|
||||
cache = "/var/cache/github-runners/go";
|
||||
credentials = "/run/github-runner-registration";
|
||||
|
||||
# The same numeric identity owns the bind-mounted caches on the host and in every container.
|
||||
runnerUser = {
|
||||
users.github-runner = {
|
||||
uid = 915;
|
||||
isSystemUser = true;
|
||||
group = "github-runner";
|
||||
};
|
||||
groups.github-runner.gid = 915;
|
||||
};
|
||||
in
|
||||
{
|
||||
age.secrets.github-runner-token-fws1 = {
|
||||
file = skyg-secrets.github-runner-token-fws1;
|
||||
path = "${credentials}/token";
|
||||
# The containers mount this directory and must see token rotations.
|
||||
symlink = false;
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
users = runnerUser;
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${credentials} 0700 root root -"
|
||||
"d ${cache} 0755 root root -"
|
||||
"d ${cache}/build 0700 github-runner github-runner -"
|
||||
"d ${cache}/mod 0700 github-runner github-runner -"
|
||||
];
|
||||
|
||||
systemd.services = lib.genAttrs (map (name: "container@${name}") runnerNames) (_: {
|
||||
serviceConfig = {
|
||||
MemoryLow = "4G";
|
||||
MemoryMax = "8G";
|
||||
CPUQuota = "200%";
|
||||
};
|
||||
});
|
||||
|
||||
containers = lib.genAttrs runnerNames (name: {
|
||||
autoStart = true;
|
||||
bindMounts = {
|
||||
"${credentials}".isReadOnly = true;
|
||||
"/var/cache/go" = {
|
||||
hostPath = cache;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = { pkgs, ... }: {
|
||||
system.stateVersion = stateVersion;
|
||||
users = runnerUser;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
services.github-runners.${name} = {
|
||||
enable = true;
|
||||
inherit name;
|
||||
replace = true;
|
||||
url = "https://github.com/SkyG-Org";
|
||||
tokenFile = "${credentials}/token";
|
||||
user = "github-runner";
|
||||
group = "github-runner";
|
||||
extraLabels = [ "fws1" "nixos" "go" ];
|
||||
extraPackages = [ pkgs.go ];
|
||||
extraEnvironment = {
|
||||
NIX_REMOTE = "daemon";
|
||||
GOCACHE = "/var/cache/go/build";
|
||||
GOMODCACHE = "/var/cache/go/mod";
|
||||
};
|
||||
serviceOverrides.ReadWritePaths = [ "/var/cache/go" ];
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{ config, pkgs, skyg-secrets, ... }:
|
||||
let
|
||||
homes = "/var/lib/nbot/homes";
|
||||
goCache = "/var/lib/nbot-cache/go";
|
||||
settings = {
|
||||
# The system each container boots (nbot's agent + gh); updated on every rebuild.
|
||||
system = "${config.skyg.nixos.server.services.nbot-agent.system}";
|
||||
machines_dir = "/var/lib/machines";
|
||||
state_dir = "/var/lib/nbot";
|
||||
agent_cwd = "/root";
|
||||
|
||||
idle_timeout = "6h";
|
||||
max_idle_timeout = "0s";
|
||||
allow_indefinite = true;
|
||||
boot_timeout = "2m";
|
||||
|
||||
# Go caches shared by all containers on this node (see ABOUTME). Env vars come from the master.
|
||||
rw_binds = [
|
||||
"${goCache}/mod:/var/cache/go/mod:idmap"
|
||||
"${goCache}/build:/var/cache/go/build:idmap"
|
||||
];
|
||||
|
||||
container = { memory_mb = 4096; cpus = 1.0; };
|
||||
max_container = { memory_mb = 51200; cpus = 6; };
|
||||
host_reserve = { memory_mb = 8192; cpus = 2.0; };
|
||||
storage = { min = "2G"; max = "10G"; limit = "50G"; };
|
||||
drives = [{ path = homes; reserve = "200G"; allow_subdir = true; }];
|
||||
|
||||
# Worker of the master on fwdesk. Slack tokens and goose settings come
|
||||
# from the master. Trusts the first certificate it sees (saved in
|
||||
# state_dir/master.fingerprint); pin it in master_fingerprint if wanted.
|
||||
cluster = {
|
||||
name = "hl-fws1";
|
||||
master = "wss://fwdesk.lab.internal:7946";
|
||||
master_fingerprint = [ "ce08c6b0f3aec855cc8b936d81449c1a34074d181089b26acbdddacfca60af1d" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
age.secrets.nbot-cluster = {
|
||||
file = skyg-secrets.nbot-cluster-hl-fws1;
|
||||
owner = "root";
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
# nbot flake input; options and docs in its repo.
|
||||
services.nbot = {
|
||||
enable = true;
|
||||
mode = "slave";
|
||||
kvm = true;
|
||||
drives = [ homes ];
|
||||
stateDir = "/var/lib/nbot";
|
||||
configFile = (pkgs.formats.toml { }).generate "nbot.toml" settings;
|
||||
environmentFile = config.age.secrets.nbot-cluster.path;
|
||||
};
|
||||
|
||||
# Container links belong to systemd-networkd.
|
||||
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
||||
networking.dhcpcd.denyInterfaces = [ "ve-*" ];
|
||||
# networkd only has the container links here (NetworkManager owns wlan),
|
||||
# so wait-online would always time out.
|
||||
systemd.network.wait-online.enable = false;
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${homes} 0700 root root -"
|
||||
"d ${goCache}/mod 0700 root root -"
|
||||
"d ${goCache}/build 0700 root root -"
|
||||
];
|
||||
}
|
||||
@@ -33,11 +33,12 @@ in
|
||||
imports = [
|
||||
./services
|
||||
./hardware-configuration
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.nixos.common.diagnix.enable = true;
|
||||
skyg.nixos.common.dns.enable = true;
|
||||
skyg.server.dns.routing = {
|
||||
enable = false;
|
||||
openFirewall = true;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ let
|
||||
domain = app.effectiveDns;
|
||||
publicDomain = builtins.elemAt app.aliases 0;
|
||||
port = 3000;
|
||||
pairPort = 5000;
|
||||
ip = app.ip;
|
||||
bucket = "buzz-media";
|
||||
images = {
|
||||
@@ -41,6 +42,7 @@ in
|
||||
redis.condition = "service_healthy";
|
||||
minio.condition = "service_healthy";
|
||||
minio-init.condition = "service_completed_successfully";
|
||||
relay-index-prebuild.condition = "service_completed_successfully";
|
||||
};
|
||||
networks = [ "internal" ];
|
||||
environmentFiles = [ config.age.secrets.buzz-env.path ];
|
||||
@@ -52,6 +54,7 @@ in
|
||||
BUZZ_MEDIA_BASE_URL = "https://${buzz.publicDomain}/media";
|
||||
BUZZ_MEDIA_SERVER_DOMAIN = buzz.publicDomain;
|
||||
BUZZ_CORS_ORIGINS = "https://${buzz.publicDomain}";
|
||||
BUZZ_PAIRING_RELAY_URL = "wss://${buzz.publicDomain}/pair";
|
||||
BUZZ_S3_ENDPOINT = "http://minio:9000";
|
||||
BUZZ_S3_REGION = "us-east-1";
|
||||
BUZZ_S3_ADDRESSING_STYLE = "path";
|
||||
@@ -70,9 +73,18 @@ in
|
||||
start_period = "30s";
|
||||
};
|
||||
};
|
||||
pair = {
|
||||
image = buzz.images.relay;
|
||||
networks = [ "internal" ];
|
||||
environment.BUZZ_PAIR_RELAY_BIND_ADDR = "0.0.0.0:${toString buzz.pairPort}";
|
||||
extraConfig.entrypoint = [ "/usr/local/bin/buzz-pair-relay" ];
|
||||
};
|
||||
caddy = {
|
||||
image = buzz.images.caddy;
|
||||
extraConfig.depends_on.relay.condition = "service_healthy";
|
||||
extraConfig.depends_on = {
|
||||
relay.condition = "service_healthy";
|
||||
pair.condition = "service_started";
|
||||
};
|
||||
networks = {
|
||||
internal = { };
|
||||
lan = { ipv4_address = buzz.ip; };
|
||||
@@ -81,7 +93,13 @@ in
|
||||
${buzz.publicDomain} {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
encode zstd gzip
|
||||
reverse_proxy relay:${toString buzz.port}
|
||||
# Only /pair goes to the pairing service
|
||||
handle /pair {
|
||||
reverse_proxy pair:${toString buzz.pairPort}
|
||||
}
|
||||
handle {
|
||||
reverse_proxy relay:${toString buzz.port}
|
||||
}
|
||||
}
|
||||
http://${buzz.domain} {
|
||||
redir https://${buzz.publicDomain}{uri} permanent
|
||||
@@ -173,6 +191,47 @@ in
|
||||
};
|
||||
restart = "no";
|
||||
};
|
||||
relay-index-prebuild = {
|
||||
image = buzz.images.posgres;
|
||||
networks = [ "internal" ];
|
||||
environmentFiles = [ config.age.secrets.buzz-env.path ];
|
||||
environment = {
|
||||
POSTGRES_DB = "buzz";
|
||||
POSTGRES_USER = "buzz";
|
||||
};
|
||||
files."/usr/local/bin/prebuild-indexes.sh" = ''
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
export PGPASSWORD="$POSTGRES_PASSWORD"
|
||||
|
||||
run_psql() {
|
||||
psql -v ON_ERROR_STOP=1 -h postgres -U "$POSTGRES_USER" -d "$POSTGRES_DB" "$@"
|
||||
}
|
||||
|
||||
ensure_index() {
|
||||
name="$1"
|
||||
sql="$2"
|
||||
state=$(run_psql -tAc "SELECT coalesce((SELECT CASE WHEN i.indisvalid AND i.indisready AND i.indislive THEN 'valid' ELSE 'invalid' END FROM pg_index i WHERE i.indexrelid = to_regclass('public.$name')), 'missing')")
|
||||
if [ "$state" = valid ]; then
|
||||
return 0
|
||||
fi
|
||||
if [ "$state" = invalid ]; then
|
||||
run_psql -c "DROP INDEX CONCURRENTLY IF EXISTS public.$name"
|
||||
fi
|
||||
run_psql -c "$sql"
|
||||
}
|
||||
|
||||
ensure_index artifact_heads_modified "CREATE INDEX CONCURRENTLY artifact_heads_modified ON public.artifact_heads (community_id, modified_at, artifact_id);"
|
||||
ensure_index artifact_heads_channel "CREATE INDEX CONCURRENTLY artifact_heads_channel ON public.artifact_heads (community_id, channel_id, artifact_id);"
|
||||
ensure_index channel_members_sync "CREATE INDEX CONCURRENTLY channel_members_sync ON public.channel_members (community_id, pubkey, sync_modified_at, channel_id);"
|
||||
ensure_index artifact_revisions_moves "CREATE INDEX CONCURRENTLY artifact_revisions_moves ON public.artifact_revisions (community_id, modified_at, event_id) WHERE source_channel_id IS NOT NULL;"
|
||||
'';
|
||||
extraConfig = {
|
||||
entrypoint = [ "/bin/sh" "/usr/local/bin/prebuild-indexes.sh" ];
|
||||
depends_on.postgres.condition = "service_healthy";
|
||||
};
|
||||
restart = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
staticIp = ip: {
|
||||
lan = { ipv4_address = ip; };
|
||||
};
|
||||
in
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./services
|
||||
./hardware-configuration
|
||||
./hardware.nix
|
||||
./systemd.nix
|
||||
];
|
||||
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.nixos.common.diagnix.enable = true;
|
||||
skyg.nixos.common.dns.enable = true;
|
||||
skyg.nixos.common.containers.networks.ipvlanLab = {
|
||||
enable = true;
|
||||
parent = "enp2s0";
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
@@ -7,5 +7,6 @@
|
||||
./stack2.nix
|
||||
./timers.nix
|
||||
./linux-tracker.nix
|
||||
./umami.nix
|
||||
];
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
{ config, ... }:
|
||||
{ config, skyg-secrets, ... }:
|
||||
let
|
||||
app = config.skyg.internalNetworkingMap.apps.nvr;
|
||||
in
|
||||
{
|
||||
age.secrets.scrypted-envs.file = skyg-secrets.scrypted-envs;
|
||||
skyg.nixos.common.container-services.scrypted = {
|
||||
enable = true;
|
||||
autoUpdate.enable = true;
|
||||
@@ -16,7 +17,11 @@ in
|
||||
"/opt/homelab/scrypted/db:/server/volume"
|
||||
"scrypted-nvr:/nvr"
|
||||
];
|
||||
devices = [ "/dev/dri:/dev/dri" ];
|
||||
environment.SCRYPTED_NVR_VOLUME = "/nvr";
|
||||
environmentFiles = [
|
||||
config.age.secrets.scrypted-envs.path
|
||||
];
|
||||
};
|
||||
volumes.scrypted-nvr = {
|
||||
driver = "local";
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
{ config, skyg-secrets, ... }:
|
||||
# Umami collects LoopRail's telemetry. Caddy on minipc3 sends it the public
|
||||
# POST looprails.skyg.ca/t/v1 and the LAN-only dashboard. It runs in its own
|
||||
# nspawn container with its own LAN address, and only Caddy can reach it.
|
||||
let
|
||||
app = config.skyg.internalNetworkingMap.apps.umami;
|
||||
caddy = config.skyg.internalNetworkingMap.apps.caddy;
|
||||
appNetwork = config.skyg.internalNetworkingMap.appNetwork;
|
||||
parent = config.skyg.nixos.common.containers.networks.ipvlanLab.parent;
|
||||
# nspawn names the ipvlan link iv-<parent>.
|
||||
lanIf = "iv-${parent}";
|
||||
port = 3000;
|
||||
secretPath = "/run/secrets/umami-app-secret";
|
||||
hostStateVersion = config.system.stateVersion;
|
||||
in
|
||||
{
|
||||
age.secrets.umami-app-secret.file = skyg-secrets.umami-app-secret;
|
||||
|
||||
containers.umami = {
|
||||
autoStart = true;
|
||||
# Own network: an ipvlan link on the LAN, like the docker apps get.
|
||||
privateNetwork = true;
|
||||
extraFlags = [ "--network-ipvlan=${parent}" ];
|
||||
bindMounts.${secretPath} = {
|
||||
hostPath = config.age.secrets.umami-app-secret.path;
|
||||
isReadOnly = true;
|
||||
};
|
||||
|
||||
config = { lib, ... }: {
|
||||
system.stateVersion = hostStateVersion;
|
||||
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
interfaces.${lanIf}.ipv4.addresses = [{
|
||||
address = app.ip;
|
||||
prefixLength = lib.toInt (lib.last (lib.splitString "/" appNetwork.subnet));
|
||||
}];
|
||||
defaultGateway = { address = appNetwork.gateway; interface = lanIf; };
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
# Only Caddy may reach Umami, at most ~20 new connections a second.
|
||||
# Caddy opens one connection per telemetry request, so this caps requests.
|
||||
extraInputRules = ''
|
||||
ip saddr ${caddy.ip} tcp dport ${toString port} ct state new limit rate 20/second burst 100 packets accept
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# Postgres only on its local socket.
|
||||
services.postgresql.settings.listen_addresses = lib.mkForce "";
|
||||
|
||||
services.umami = {
|
||||
enable = true;
|
||||
createPostgresqlDatabase = true;
|
||||
settings = {
|
||||
APP_SECRET_FILE = secretPath;
|
||||
HOSTNAME = "0.0.0.0";
|
||||
PORT = port;
|
||||
DISABLE_UPDATES = true;
|
||||
DISABLE_TELEMETRY = true;
|
||||
# looprail's User-Agent would look like a bot.
|
||||
DISABLE_BOT_CHECK = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# A flood can't starve the rest of the host.
|
||||
systemd.services."container@umami".serviceConfig = {
|
||||
MemoryMax = "1G";
|
||||
CPUQuota = "100%";
|
||||
};
|
||||
}
|
||||
@@ -2,4 +2,8 @@
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
services.journald.extraConfig = ''
|
||||
SystemMaxUse=1G
|
||||
'';
|
||||
}
|
||||
@@ -2,13 +2,14 @@
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration
|
||||
./hardware.nix
|
||||
./systemd.nix
|
||||
./services
|
||||
];
|
||||
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.nixos.common.diagnix.enable = true;
|
||||
skyg.nixos.common.dns.enable = true;
|
||||
skyg.server.dns.routing = {
|
||||
enable = false;
|
||||
openFirewall = true;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
{
|
||||
layer4 {
|
||||
:22 {
|
||||
route {
|
||||
proxy {$GITEA_IP}:22
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Common: the wildcard cert.
|
||||
(shared) {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
}
|
||||
|
||||
# Only LAN (10/8) + Tailscale clients. Others get dropped.
|
||||
(lan_only) {
|
||||
import shared
|
||||
@notlan not remote_ip 10.0.0.0/8 100.64.0.0/10
|
||||
abort @notlan
|
||||
}
|
||||
|
||||
# Open to anyone who can reach caddy.
|
||||
(public_access) {
|
||||
import shared
|
||||
}
|
||||
|
||||
nvr.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$NVR_IP}:11080
|
||||
}
|
||||
|
||||
jellyfin.home.sosnovsky.ca {
|
||||
import public_access
|
||||
reverse_proxy {$JELLYFIN_IP}:8096
|
||||
}
|
||||
|
||||
castle.home.sosnovsky.ca {
|
||||
import public_access
|
||||
reverse_proxy castle.hub.internal
|
||||
}
|
||||
|
||||
immich.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$IMMICH_IP}:2283
|
||||
}
|
||||
|
||||
portainer.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$PORTAINER_IP}:9000
|
||||
}
|
||||
|
||||
gitea.skyg.ca {
|
||||
tls /etc/caddy/tls/gitea/fullchain.pem /etc/caddy/tls/gitea/key.pem
|
||||
reverse_proxy {$GITEA_IP}:80
|
||||
}
|
||||
|
||||
looprails.skyg.ca {
|
||||
tls /etc/caddy/tls/gitea/fullchain.pem /etc/caddy/tls/gitea/key.pem
|
||||
|
||||
# Telemetry: only looprail's own requests reach Umami.
|
||||
@telemetry {
|
||||
method POST
|
||||
path /t/v1
|
||||
header Content-Type application/json*
|
||||
header User-Agent looprail/*
|
||||
header X-Looprail-Telemetry {$LOOPRAIL_TELEMETRY_KEY}
|
||||
}
|
||||
handle @telemetry {
|
||||
request_body {
|
||||
max_size 256KB
|
||||
}
|
||||
rewrite * /api/batch
|
||||
reverse_proxy {$UMAMI_IP}:3000 {
|
||||
# Umami never sees the sender's IP.
|
||||
header_up -X-Forwarded-For
|
||||
header_up -X-Real-IP
|
||||
header_up -Forwarded
|
||||
header_up -CF-Connecting-IP
|
||||
header_up -True-Client-IP
|
||||
header_up -X-Client-IP
|
||||
header_up -X-Looprail-Telemetry
|
||||
# One connection per request, so Umami's rate limit counts requests.
|
||||
transport http {
|
||||
keepalive off
|
||||
}
|
||||
}
|
||||
}
|
||||
handle /t/* {
|
||||
respond 404
|
||||
}
|
||||
|
||||
handle {
|
||||
root * /srv/looprails
|
||||
redir /looprail.html / permanent
|
||||
file_server
|
||||
}
|
||||
}
|
||||
|
||||
# Umami dashboard for LoopRail telemetry, LAN only.
|
||||
umami.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy {$UMAMI_IP}:3000
|
||||
}
|
||||
|
||||
# Buzz: straight to its own caddy, LAN only.
|
||||
buzz.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy https://{$BUZZ_IP}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Fallback: any other *.home.sosnovsky.ca host goes to the k8s Traefik.
|
||||
# Host + SNI are preserved so Traefik routes on the original hostname.
|
||||
*.home.sosnovsky.ca {
|
||||
import lan_only
|
||||
reverse_proxy https://{$K8S_INGRESS}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
orderBefore = [ "container-services-caddy" ];
|
||||
};
|
||||
certs."gitea.skyg.ca" = {
|
||||
extraDomains = [ "looprails.skyg.ca" ];
|
||||
postRun = "${pkgs.docker}/bin/docker restart caddy-caddy-1";
|
||||
orderBefore = [ "container-services-caddy" ];
|
||||
};
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
{ config, ... }:
|
||||
{ config, looprail, pkgs, ... }:
|
||||
let
|
||||
looprailPackages = looprail.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
app = config.skyg.internalNetworkingMap.apps.caddy;
|
||||
nvr = config.skyg.internalNetworkingMap.apps.nvr;
|
||||
jellyfin = config.skyg.internalNetworkingMap.apps.jellyfin;
|
||||
immich = config.skyg.internalNetworkingMap.apps.immich;
|
||||
portainer = config.skyg.internalNetworkingMap.apps.portainer;
|
||||
buzz = config.skyg.internalNetworkingMap.apps.buzz;
|
||||
publicGitea = config.skyg.internalNetworkingMap.apps.public-gitea;
|
||||
umami = config.skyg.internalNetworkingMap.apps.umami;
|
||||
# Sent by release looprail binaries on telemetry posts. It ships in the
|
||||
# binary, so it only filters out scanners; it is not a secret.
|
||||
looprailTelemetryKey = "70c685d238cc9ec7229e557a8de7b0d25527b1a402805251";
|
||||
certDomain = "home.sosnovsky.ca";
|
||||
giteaCertDomain = "gitea.skyg.ca";
|
||||
# k8s Traefik ingress — fallback for hosts caddy doesn't handle itself.
|
||||
@@ -24,50 +30,24 @@ in
|
||||
};
|
||||
command = [ "run" "--config" "/etc/caddy/Caddyfile" "--adapter" "caddyfile" ];
|
||||
networks.lan.ipv4_address = app.ip;
|
||||
files."/etc/caddy/Caddyfile" = ''
|
||||
{
|
||||
layer4 {
|
||||
:22 {
|
||||
route {
|
||||
proxy ${publicGitea.ip}:22
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
nvr.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy ${nvr.ip}:11080
|
||||
}
|
||||
jellyfin.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy bigbox1.lab.internal:8096
|
||||
}
|
||||
immich.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy ${immich.ip}:2283
|
||||
}
|
||||
portainer.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy ${portainer.ip}:9000
|
||||
}
|
||||
gitea.skyg.ca {
|
||||
tls /etc/caddy/tls/gitea/fullchain.pem /etc/caddy/tls/gitea/key.pem
|
||||
reverse_proxy ${publicGitea.ip}:80
|
||||
}
|
||||
# Fallback: any other *.home.sosnovsky.ca host goes to the k8s Traefik.
|
||||
# Host + SNI are preserved so Traefik routes on the original hostname.
|
||||
*.home.sosnovsky.ca {
|
||||
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/key.pem
|
||||
reverse_proxy https://${k8sIngress}:443 {
|
||||
header_up Host {http.request.host}
|
||||
transport http {
|
||||
tls
|
||||
tls_server_name {http.request.host}
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
# Routes live in ./Caddyfile; IPs come in as env vars.
|
||||
files."/etc/caddy/Caddyfile" = builtins.readFile ./Caddyfile;
|
||||
environment = {
|
||||
GITEA_IP = publicGitea.ip;
|
||||
NVR_IP = nvr.ip;
|
||||
IMMICH_IP = immich.ip;
|
||||
PORTAINER_IP = portainer.ip;
|
||||
JELLYFIN_IP = jellyfin.ip;
|
||||
BUZZ_IP = buzz.ip;
|
||||
UMAMI_IP = umami.ip;
|
||||
LOOPRAIL_TELEMETRY_KEY = looprailTelemetryKey;
|
||||
K8S_INGRESS = k8sIngress;
|
||||
};
|
||||
volumes = [
|
||||
(if looprailPackages ? looprail-site then
|
||||
"${looprailPackages.looprail-site}:/srv/looprails:ro"
|
||||
else
|
||||
"${looprail}/docs/looprail.html:/srv/looprails/index.html:ro")
|
||||
"/var/lib/acme/${certDomain}/fullchain.pem:/etc/caddy/tls/fullchain.pem:ro"
|
||||
"/var/lib/acme/${certDomain}/key.pem:/etc/caddy/tls/key.pem:ro"
|
||||
"/var/lib/acme/${giteaCertDomain}/fullchain.pem:/etc/caddy/tls/gitea/fullchain.pem:ro"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
minimal = true;
|
||||
fonts.minimal = true;
|
||||
ssh-server.enable = true;
|
||||
diagnix.enable = true;
|
||||
containers.enable = false;
|
||||
networking.nfsServer.enable = false;
|
||||
hardware.pipewire.enable = true;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
user.enable = true;
|
||||
nixos = {
|
||||
common.ssh-server.enable = true;
|
||||
common.diagnix.enable = true;
|
||||
common.hardware.pipewire.enable = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
|
||||
@@ -15,12 +15,12 @@ in
|
||||
imports = [
|
||||
./services.nix
|
||||
./hardware-configuration
|
||||
./hardware.nix
|
||||
./systemd.nix
|
||||
];
|
||||
|
||||
skyg.user.enable = true;
|
||||
skyg.nixos.common.ssh-server.enable = true;
|
||||
skyg.nixos.common.diagnix.enable = true;
|
||||
skyg.server.dns.routing = {
|
||||
enable = false;
|
||||
openFirewall = true;
|
||||
@@ -28,8 +28,6 @@ in
|
||||
};
|
||||
skyg.nixos.desktop.enable = false;
|
||||
skyg.server.admin.enable = true;
|
||||
|
||||
|
||||
environment.systemPackages = with pkgs; [ btrfs-progs ];
|
||||
|
||||
networking.firewall.allowedUDPPorts = openPorts;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
+2
-2
@@ -8,7 +8,7 @@ All reusable NixOS and Home Manager modules. Every host gets the full module tre
|
||||
```
|
||||
modules/
|
||||
├── lib.nix # makeNixOs / makeIso / makeHomeManagerUsers / makeDarwinModule / eachSystem
|
||||
│ # (registers flake-input NixOS modules: tether → programs.tether.*,
|
||||
│ # (registers flake-input NixOS modules:
|
||||
│ # hhstream → services.hyprland-headless-stream)
|
||||
├── main.nix # Base module imported by every host: core/ + nixos/ + network-drives.nix
|
||||
│ # + skyg.internalNetworkingMap (global app registry + appNetwork)
|
||||
@@ -23,7 +23,7 @@ modules/
|
||||
│ ├── common/ # Core system settings, networking, SSH, QEMU, fonts, hardware
|
||||
│ ├── server/ # Server services: K3s/K8s, DNS, AI stack, ARRs, media…
|
||||
│ └── desktop/ # Desktop: tiler (niri/hyprland), packages, theming, crypto
|
||||
└── openwrt/ # OpenWrt router config generator
|
||||
├── openwrt/ # OpenWrt router config generator
|
||||
```
|
||||
|
||||
## Option Namespace
|
||||
|
||||
@@ -28,7 +28,8 @@ core/
|
||||
- **Substituters** (`nix-substituters.nix`): the standing list of caches (local `minipc1`
|
||||
and `bigbox2` caches, cache.nixos.org, cachix caches for cuda/cosmic/ai/noctalia/nixarchy,
|
||||
flox, devenv) and the trusted public keys. Extra entries can be appended per-host via
|
||||
`skyg.core.substituters.{urls,keys}`.
|
||||
`skyg.core.substituters.{urls,keys}`. Also sets `http-connections = 8` and
|
||||
`download-attempts = 10` so flaky links (Wi-Fi) don't disable cache.nixos.org mid-build.
|
||||
- **Lab CA trust** (`lab-ca.nix`): adds `configs/pki/lab-ca.crt` to
|
||||
`security.pki.certificateFiles` so every machine trusts the lab internal CA
|
||||
(created by `skyg ca init`, see `configs/pki/ABOUTME.md`). Eval fails if the
|
||||
|
||||
@@ -22,12 +22,16 @@
|
||||
# colibrì (JustVugg/colibri) — GLM-5.2/OLMoE local inference, see pkgs/colibri.
|
||||
colibri = final.callPackage ../../pkgs/colibri { };
|
||||
colibri-rocm = final.callPackage ../../pkgs/colibri { backend = "rocm"; };
|
||||
# llama.cpp v0.8.0 with DFlash2 speculative decoding, see pkgs/llama-cpp.
|
||||
llama-cpp-halo = final.callPackage ../../pkgs/llama-cpp { };
|
||||
llama-cpp-halo-cpu = final.callPackage ../../pkgs/llama-cpp { backend = "cpu"; };
|
||||
llama-cpp-cuda = final.callPackage ../../pkgs/llama-cpp { backend = "cuda"; };
|
||||
# Touchscreen gesture bridge for niri, see pkgs/niri-touchscreen-gestures.
|
||||
niri-touchscreen-gestures = final.callPackage ../../pkgs/niri-touchscreen-gestures { };
|
||||
# Buzz Desktop AppImage wrapper, see pkgs/buzz-desktop.
|
||||
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
||||
# Superset Desktop AppImage wrapper, see pkgs/superset-desktop.
|
||||
superset-desktop = final.callPackage ../../pkgs/superset-desktop { };
|
||||
# Buzz CLI (`buzz`), built from source, see pkgs/buzz-cli.
|
||||
buzz-cli = final.callPackage ../../pkgs/buzz-cli { };
|
||||
# Delta Editor (Zed Industries) prebuilt tarball, see pkgs/delta-editor.
|
||||
delta-editor = final.callPackage ../../pkgs/delta-editor { };
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ in
|
||||
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
|
||||
] ++ cfg.keys;
|
||||
nix.settings.trusted-users = [ "root" skygUser.name ];
|
||||
nix.settings.http-connections = 8;
|
||||
nix.settings.download-attempts = 10;
|
||||
nix.extraOptions = ''
|
||||
# Ensure we can still build when missing-server is not accessible
|
||||
fallback = true
|
||||
|
||||
+1
-2
@@ -32,7 +32,7 @@ let
|
||||
colibri = final.callPackage ../pkgs/colibri { };
|
||||
niri-touchscreen-gestures = final.callPackage ../pkgs/niri-touchscreen-gestures { };
|
||||
buzz-desktop = final.callPackage ../pkgs/buzz-desktop { };
|
||||
superset-desktop = final.callPackage ../pkgs/superset-desktop { };
|
||||
buzz-cli = final.callPackage ../pkgs/buzz-cli { };
|
||||
delta-editor = final.callPackage ../pkgs/delta-editor { };
|
||||
})
|
||||
];
|
||||
@@ -49,7 +49,6 @@ let
|
||||
specialArgs.dank-greeter.nixosModules.default
|
||||
specialArgs.nix-index-database.nixosModules.nix-index
|
||||
specialArgs.hermes-agent.nixosModules.default
|
||||
specialArgs.tether.nixosModules.default
|
||||
specialArgs.hhstream.nixosModules.default
|
||||
specialArgs.skyg-linux-tracker.nixosModules.default
|
||||
{ programs.nix-index-database.comma.enable = true; }
|
||||
|
||||
@@ -111,6 +111,8 @@ in
|
||||
public-gitea = { ip = "10.0.101.9"; };
|
||||
immich = { ip = "10.0.101.10"; };
|
||||
immich-ml = { ip = "10.0.101.11"; };
|
||||
gilix = { ip = "10.0.101.13"; };
|
||||
umami = { ip = "10.0.101.14"; };
|
||||
jellyfin = { ip = "10.0.101.5"; };
|
||||
nvr = { ip = "10.0.101.6"; };
|
||||
portainer = { ip = "10.0.101.241"; };
|
||||
@@ -122,6 +124,8 @@ in
|
||||
"portainer.home.sosnovsky.ca"
|
||||
"immich.home.sosnovsky.ca"
|
||||
"gitea.skyg.ca"
|
||||
"looprails.skyg.ca"
|
||||
"umami.home.sosnovsky.ca"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ common/
|
||||
├── user.nix # skyg.user.createSystemUser — creates the system user/groups + zsh shell
|
||||
├── fonts.nix # System font packages + fontconfig defaults (Fira Code, Noto, …); skyg.nixos.common.fonts.minimal
|
||||
├── ssh-server.nix # skyg.nixos.common.ssh-server — hardened sshd + master public keys (list)
|
||||
├── diagnix/ # skyg.nixos.common.diagnix — read-only user nbot uses to diagnose hosts
|
||||
|
||||
├── qemu.nix # skyg.core.qemu — QEMU/quickemu + SPICE guest tooling
|
||||
├── binary-cache.nix # skyg.nixos.common.cachePush — push finished builds to the bigbox2 cache
|
||||
@@ -38,6 +39,23 @@ common/
|
||||
- **`ssh-server.nix`** ships the master public keys (`masterPubKeys`, a list so a key can be
|
||||
rotated by adding the new one before dropping the old) and a hardened sshd config
|
||||
(key-only auth, long keepalives). Disabled by default.
|
||||
- **`diagnix/`** adds a read-only `diagnix` user (uid 2950) that nbot uses over SSH, via
|
||||
`lab-ssh` in the agent system (`server/services/nbot-agent.nix`). It reads logs
|
||||
(`systemd-journal` group), units, `/proc` and the store, and can't change anything. It
|
||||
can't read root-only files. Through sudo it can run only the fixed `diag-*` scripts
|
||||
(docker ps/logs, smart, ports, firewall, btrfs, io, pstore). The key is `restrict,pty` and only
|
||||
works from the nbot hosts (`hosts.nix`). `diag-pstore` prints the kernel's saved crash
|
||||
records from `/sys/fs/pstore` (root-only), the one trace a hard freeze can leave behind.
|
||||
The hermenix VM has its own key (`hosts.nix` → `hermenix`), with the same limits, accepted
|
||||
only from hl-fwdesk's addresses (the VM is NAT'ed out of fwdesk). Turn it off per host
|
||||
with `skyg.nixos.common.diagnix.hermenix.enable = false`. fwdesk's `hermenix.nix` lets
|
||||
the VM reach port 22 on `10.0.10.0/24`. Hosts running nbot also let their own containers
|
||||
reach port 22 and accept them from private IPs outside the LAN. Their IPs are random, so
|
||||
they can't be listed. Resources are capped (1G memory, 1 CPU, 256 tasks). The Nix daemon
|
||||
is left open on purpose: an allow-list would break nix-serve/buildbot.
|
||||
The private key (base64) is `DIAGNIX_KEY` in the `nbot-goose` secret; fwdesk passes it to
|
||||
every container via `agent_env`.
|
||||
`hosts.nix` also holds each host's address and host key; the agent pins those keys.
|
||||
|
||||
## Option Namespace
|
||||
|
||||
@@ -46,6 +64,7 @@ skyg.core.hostName → networking.nix
|
||||
skyg.user.createSystemUser → user.nix
|
||||
skyg.core.qemu.* → qemu.nix
|
||||
skyg.nixos.common.ssh-server.* → ssh-server.nix
|
||||
skyg.nixos.common.diagnix.* → diagnix/
|
||||
|
||||
skyg.nixos.common.cachePush.* → binary-cache.nix
|
||||
skyg.nixos.common.minimal → core.nix (skip heavy always-on system packages)
|
||||
|
||||
@@ -1,35 +1,129 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.common.cachePush;
|
||||
recv = config.skyg.nixos.common.cacheReceive;
|
||||
lab = import ./diagnix/hosts.nix;
|
||||
|
||||
# The hook writes into tmp and moves into queue, which the path unit watches.
|
||||
# A push that fails moves its files to retry, for the timer.
|
||||
state = "/var/lib/nix-cache-push";
|
||||
queue = "${state}/queue";
|
||||
retry = "${state}/retry";
|
||||
|
||||
# nix-serve on bigbox2 only serves its own store and can't take uploads, so
|
||||
# pushes go over ssh-ng into that store, as the host's root key.
|
||||
sshOpts = "-i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=yes -o BatchMode=yes -o ConnectTimeout=10";
|
||||
|
||||
drain = pkgs.writeShellScript "nix-cache-push-drain" ''
|
||||
set -u
|
||||
shopt -s nullglob
|
||||
new=(${queue}/*)
|
||||
old=(${retry}/*)
|
||||
files=("''${new[@]}" "''${old[@]}")
|
||||
[ ''${#files[@]} -eq 0 ] && exit 0
|
||||
paths=()
|
||||
for f in "''${files[@]}"; do
|
||||
for p in $(cat "$f"); do
|
||||
[ -e "$p" ] && paths+=("$p")
|
||||
done
|
||||
done
|
||||
if [ ''${#paths[@]} -gt 0 ]; then
|
||||
if ! NIX_SSHOPTS="${sshOpts}" ${config.nix.package}/bin/nix copy --to "${cfg.url}" "''${paths[@]}"; then
|
||||
[ ''${#new[@]} -gt 0 ] && mv "''${new[@]}" ${retry}/
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
rm -f "''${files[@]}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.cachePush = {
|
||||
enable = lib.mkEnableOption "push finished builds to the bigbox2 binary cache";
|
||||
url = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "http://bigbox2.lab.internal:5000";
|
||||
default = "ssh-ng://nix-ssh@bigbox2.lab.internal";
|
||||
};
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "bigbox2.lab.internal";
|
||||
description = "The cache's ssh host, whose host key is pinned from diagnix/hosts.nix.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Push every finished build to the cache right after it finishes.
|
||||
nix.settings.post-build-hook = pkgs.writeShellScript "nix-post-build-hook" ''
|
||||
set -u
|
||||
if [ -n "''${OUT_PATHS:-}" ]; then
|
||||
nix copy --to "${cfg.url}" $OUT_PATHS \
|
||||
|| echo "post-build-hook: failed to push to ${cfg.url}" >&2
|
||||
fi
|
||||
'';
|
||||
|
||||
# Manual/backstop push command, available on every host's PATH.
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "push-cache" ''
|
||||
set -eu
|
||||
if [ "''$#" -eq 0 ]; then
|
||||
set -- /run/current-system
|
||||
fi
|
||||
exec nix copy --to "${cfg.url}" "''$@"
|
||||
'')
|
||||
];
|
||||
options.skyg.nixos.common.cacheReceive = {
|
||||
enable = lib.mkEnableOption "accept pushes into this host's store over ssh-ng (nix-ssh)";
|
||||
pushers = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ "hl-fwdesk" ];
|
||||
description = "Hosts in diagnix/hosts.nix whose ssh host key may push.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.enable {
|
||||
# The hook only queues the paths: Nix waits for a post-build-hook before it
|
||||
# goes on, so copying here held up every build for the whole upload.
|
||||
nix.settings.post-build-hook = pkgs.writeShellScript "nix-post-build-hook" ''
|
||||
set -u
|
||||
if [ -n "''${OUT_PATHS:-}" ]; then
|
||||
tmp=$(mktemp -p ${state}/tmp) || exit 0
|
||||
echo "$OUT_PATHS" > "$tmp" && mv "$tmp" "${queue}/$(date +%s%N)-$$"
|
||||
fi
|
||||
'';
|
||||
|
||||
systemd.tmpfiles.rules = map (d: "d ${d} 0700 root root -") [ state "${state}/tmp" queue retry ];
|
||||
|
||||
programs.ssh.knownHosts.nix-cache-push = {
|
||||
hostNames = [ cfg.host ];
|
||||
publicKey = (lib.findFirst (h: h.address == cfg.host) null (lib.attrValues lab.hosts)).hostKey;
|
||||
};
|
||||
|
||||
systemd.services.nix-cache-push = {
|
||||
description = "Push queued builds to ${cfg.url}";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
path = [ config.programs.ssh.package ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = drain;
|
||||
Nice = 10;
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
};
|
||||
|
||||
# Runs when the hook queues a build, and every 10 minutes for the retries.
|
||||
systemd.paths.nix-cache-push = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
pathConfig.DirectoryNotEmpty = queue;
|
||||
};
|
||||
systemd.timers.nix-cache-push = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig.OnUnitInactiveSec = "10min";
|
||||
timerConfig.OnBootSec = "5min";
|
||||
};
|
||||
|
||||
# Manual/backstop push command, available on every host's PATH.
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "push-cache" ''
|
||||
set -eu
|
||||
if [ "''$#" -eq 0 ]; then
|
||||
set -- /run/current-system
|
||||
fi
|
||||
NIX_SSHOPTS="${sshOpts}" exec nix copy --to "${cfg.url}" "''$@"
|
||||
'')
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf recv.enable {
|
||||
nix.sshServe = {
|
||||
enable = true;
|
||||
write = true;
|
||||
protocol = "ssh-ng";
|
||||
# Pushed paths aren't signed; nix-serve signs them with this host's key
|
||||
# when it serves them.
|
||||
trusted = true;
|
||||
keys = map (h: lab.hosts.${h}.hostKey) recv.pushers;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -52,5 +52,7 @@ If adding a new per-service option:
|
||||
- The group's unit sets `restartTriggers` to the files-write script, so editing any
|
||||
`files` entry restarts the stack on the next switch (services that read files at
|
||||
startup, like Gitea templates, otherwise keep serving the old content)
|
||||
- Env file changes trigger a path unit that restarts the stack (`container-services-<group>-env-reload.*`)
|
||||
- Env file changes trigger a path unit that restarts the stack (`container-services-<group>-env-reload.*`);
|
||||
the restart is queued with `systemctl restart --no-block`, so the reload unit does not wait for or
|
||||
inherit the health of the stack it restarted
|
||||
- Compose files are rendered to the store and staged to `/var/lib/container-services/<group>/compose.yml`
|
||||
@@ -22,6 +22,7 @@
|
||||
"network-online.target"
|
||||
"agenix.service"
|
||||
"remote-fs.target"
|
||||
"dns-boot-check.service"
|
||||
]
|
||||
++ lib.optional hasFiles fileServiceDep;
|
||||
requires = [ runtimeService ]
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
./qemu.nix
|
||||
./binary-cache.nix
|
||||
./pritunl
|
||||
./diagnix
|
||||
./dns
|
||||
];
|
||||
config = {
|
||||
environment.sessionVariables.EDITOR = "vi";
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
# diagnix: a read-only user nbot logs in as to diagnose a host.
|
||||
# Sees logs, units, /proc and /nix/store; can't change the system.
|
||||
{ config, lib, pkgs, options, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.common.diagnix;
|
||||
data = import ./hosts.nix;
|
||||
uid = 2950;
|
||||
|
||||
# This host runs nbot, so its own containers connect from random private IPs.
|
||||
hasNbot = options.services ? nbot && config.services.nbot.enable;
|
||||
|
||||
keyLine = from: key: ''restrict,pty,from="${from}" ${key}'';
|
||||
|
||||
runtime =
|
||||
if config.virtualisation.docker.enable then "${config.virtualisation.docker.package}/bin/docker"
|
||||
else if config.virtualisation.podman.enable then "${config.virtualisation.podman.package}/bin/podman"
|
||||
else null;
|
||||
rt = toString runtime;
|
||||
|
||||
# Fixed root scripts diagnix may run with sudo. Anything taking input checks it.
|
||||
script = name: inputs: text: pkgs.writeShellApplication {
|
||||
inherit name text;
|
||||
runtimeInputs = inputs;
|
||||
};
|
||||
scripts = [
|
||||
(script "diag-smart" [ pkgs.smartmontools pkgs.nvme-cli ] ''
|
||||
smartctl --scan | while read -r dev _; do
|
||||
echo "=== $dev"; smartctl -a "$dev" || true
|
||||
done
|
||||
for dev in /dev/nvme[0-9]; do
|
||||
[ -e "$dev" ] || continue
|
||||
echo "=== $dev"; nvme smart-log "$dev" || true
|
||||
done
|
||||
'')
|
||||
(script "diag-ports" [ pkgs.iproute2 ] "ss -tulpn")
|
||||
(script "diag-firewall" [ pkgs.iptables pkgs.nftables ] ''
|
||||
iptables -S || true; iptables -t nat -S || true; ip6tables -S || true
|
||||
nft list ruleset || true
|
||||
'')
|
||||
(script "diag-btrfs" [ pkgs.btrfs-progs pkgs.util-linux ] ''
|
||||
findmnt -rn -t btrfs -o TARGET | sort -u | while read -r mnt; do
|
||||
echo "=== $mnt"; btrfs filesystem usage "$mnt" || true; btrfs device stats "$mnt" || true
|
||||
done
|
||||
'')
|
||||
(script "diag-io" [ pkgs.iotop ] "iotop -b -o -n 3 -d 1")
|
||||
(script "diag-pstore" [ ] ''
|
||||
shopt -s nullglob
|
||||
files=(/sys/fs/pstore/*)
|
||||
if [ ''${#files[@]} -eq 0 ]; then echo "pstore is empty"; exit 0; fi
|
||||
for f in "''${files[@]}"; do
|
||||
echo "=== $f"; cat "$f" || true
|
||||
done
|
||||
'')
|
||||
] ++ lib.optionals (runtime != null) [
|
||||
(script "diag-docker-ps" [ ] ''
|
||||
${rt} ps -a; ${rt} stats --no-stream; ${rt} system df
|
||||
'')
|
||||
(script "diag-docker-logs" [ ] ''
|
||||
if [ $# -ne 1 ] || ! [[ "$1" =~ ^[A-Za-z0-9][A-Za-z0-9_.-]*$ ]]; then
|
||||
echo "usage: diag-docker-logs <container-name>" >&2; exit 2
|
||||
fi
|
||||
${rt} logs --tail 500 "$1" 2>&1
|
||||
'')
|
||||
];
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.diagnix = {
|
||||
enable = lib.mkEnableOption "the read-only diagnix user for nbot";
|
||||
publicKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = data.publicKey;
|
||||
description = "nbot's client public key for diagnix.";
|
||||
};
|
||||
hermenix.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Let the hermenix VM log in as diagnix too.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.groups.diagnix.gid = uid;
|
||||
users.users.diagnix = {
|
||||
inherit uid;
|
||||
isNormalUser = true;
|
||||
group = "diagnix";
|
||||
description = "nbot read-only diagnostics";
|
||||
shell = pkgs.bash;
|
||||
extraGroups = [ "systemd-journal" ];
|
||||
openssh.authorizedKeys.keys =
|
||||
[ (keyLine (lib.concatStringsSep "," data.nbotHosts) cfg.publicKey) ]
|
||||
# Containers on this host: any private IP outside the LAN.
|
||||
++ lib.optional hasNbot (keyLine "!${data.lanSubnet},10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" cfg.publicKey)
|
||||
++ lib.optional cfg.hermenix.enable (keyLine (lib.concatStringsSep "," data.hermenix.from) data.hermenix.publicKey);
|
||||
};
|
||||
|
||||
# A runaway command can't starve the host.
|
||||
systemd.slices."user-${toString uid}" = {
|
||||
overrideStrategy = "asDropin";
|
||||
sliceConfig = { MemoryMax = "1G"; CPUQuota = "100%"; TasksMax = 256; };
|
||||
};
|
||||
|
||||
security.sudo.extraRules = [{
|
||||
users = [ "diagnix" ];
|
||||
commands = map (s: { command = lib.getExe s; options = [ "NOPASSWD" ]; }) scripts;
|
||||
}];
|
||||
|
||||
programs.mtr.enable = true;
|
||||
environment.systemPackages = scripts ++ (with pkgs; [
|
||||
lsof
|
||||
pciutils
|
||||
usbutils
|
||||
dnsutils
|
||||
sysstat
|
||||
ethtool
|
||||
lm_sensors
|
||||
htop
|
||||
]);
|
||||
|
||||
# nbot drops all container traffic to the host except a few ports; let SSH in too.
|
||||
networking.firewall = lib.mkIf (hasNbot && !config.networking.nftables.enable) {
|
||||
extraCommands = lib.mkAfter ''
|
||||
iptables -C INPUT -i ve-+ -p tcp --dport 22 -j ACCEPT 2>/dev/null || iptables -I INPUT 1 -i ve-+ -p tcp --dport 22 -j ACCEPT
|
||||
'';
|
||||
extraStopCommands = ''
|
||||
iptables -D INPUT -i ve-+ -p tcp --dport 22 -j ACCEPT 2>/dev/null || true
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
# Lab hosts diagnix lives on, shared by the host module and nbot's agent system.
|
||||
# hostKey is the host's ssh_host_ed25519 public key (from secrets.nix);
|
||||
# null means the agent saves it on first connect.
|
||||
{
|
||||
# LAN addresses of the hosts that run nbot. The key only works from these.
|
||||
nbotHosts = [ "10.0.10.11" "10.0.10.13" ]; # hl-fwdesk, hl-fws1
|
||||
lanSubnet = "10.0.0.0/16";
|
||||
|
||||
# The nbot client public key. Private half (base64) is DIAGNIX_KEY in the
|
||||
# nbot-goose secret, sent to containers via agent_env on fwdesk.
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKsgkysVa3BiJQkUjiyESwjoi9ZMmUiWEB66JlbgIrO nbot-diagnix";
|
||||
|
||||
hermenix = {
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKSYYLaAYJKifV3oOwnF7taNV4ko+A+A/r4oHgpKBwRW hermenix-diagnix";
|
||||
from = [ "10.0.10.11" "10.0.101.101" "10.77.0.2" ];
|
||||
};
|
||||
|
||||
hosts = {
|
||||
hl-bigbox1 = { address = "bigbox1.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFl5xiH4aFlmDWdoU+KmERLYOeOQK2aKP7jenY2G3rFb"; };
|
||||
hl-bigbox2 = { address = "bigbox2.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL6l6VqQ23PkGkWVABBoLp1KA6PzkX5oKTy5RBHbQXet"; };
|
||||
hl-fwdesk = { address = "fwdesk.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHbBcdMpNPaELUzHRIoRkTUQde+mBQ87Ra2R+974FuUy"; };
|
||||
hl-fws1 = { address = "fws1.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM6r0AIJyTlE+U6K97GijzAP4jNaAueVlwXbeMpEMcpe"; };
|
||||
hl-minipc1 = { address = "minipc1.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP42vtV9Qo7q5F9M/rCGD/TIZG3d0mm1uP6lMvy3zF/a"; };
|
||||
hl-minipc2 = { address = "minipc2.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqi2WT0pa8m+kZNN2Rrg1F01zwTvkCwD3wjSOBNvSjz"; };
|
||||
hl-minipc3 = { address = "minipc3.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEbvoe/UvhpRSWVXMCyj/qzuR7WnJdNF7CYRmmJE3yYu"; };
|
||||
hl-pi1 = { address = "pi1.lab.internal"; hostKey = null; };
|
||||
hl-pi2 = { address = "pi2.lab.internal"; hostKey = null; };
|
||||
hl-terra1 = { address = "terra1.lab.internal"; hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHBKI8gqd7DDubShle4D3JGq61BP1NBKCZ81V3C9uyym"; };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
# Boot-time DNS check
|
||||
|
||||
Six hosts opt into this module, including hl-bigbox1. It was introduced after the reported 79-minute DNS outage on that host on 2026-11-16. The incident account suspected journal corruption after an unclean shutdown. This module keeps logs for investigation.
|
||||
|
||||
## Configuration
|
||||
|
||||
```nix
|
||||
skyg.nixos.common.dns.enable = true;
|
||||
```
|
||||
|
||||
| Option under `skyg.nixos.common.dns` | Default | Purpose |
|
||||
| --- | --- | --- |
|
||||
| `enable` | `false` | Enable resolved, persistent journal storage, and the boot check. |
|
||||
| `bootCheckName` | `"portainer.app.internal"` | Name expected to resolve to an IPv4 address on this host's network. |
|
||||
| `bootCheckRetries` | `5` | Maximum lookup attempts, spaced one second apart after each failure. |
|
||||
| `watchdogEnabled` | `true` | Configure systemd to feed a hardware watchdog when available. |
|
||||
| `watchdogTimeout` | `30` | Runtime watchdog timeout in seconds if systemd stops feeding it. |
|
||||
|
||||
## Boot behavior
|
||||
|
||||
After network-online.target and systemd-resolved start, dns-boot-check queries the host stub at 127.0.0.53 for the configured name. A returned IPv4 address passes the check. A cached answer can pass. Choose a record available independently of containers starting on the same host.
|
||||
|
||||
The container service groups are ordered after the check. An exhausted retry budget leaves the diagnostic unit failed and allows the groups to start. A DNS failure alone does not trigger a reboot. The probe runs once per boot and can be rerun manually.
|
||||
|
||||
The journal persists across boots. The module sets a 500M persistent storage limit, a 100M runtime limit and a 30-day retention limit. Host configuration can override these limits.
|
||||
|
||||
## Investigating a failure
|
||||
|
||||
```bash
|
||||
journalctl -b -u dns-boot-check -u systemd-resolved
|
||||
resolvectl status
|
||||
dig +time=2 +tries=1 @127.0.0.53 portainer.app.internal A
|
||||
```
|
||||
|
||||
Use the configured name if the host overrides the default. Check the DNS status and answer section, and compare the upstream servers and routing domains in `resolvectl status` with the intended network. After correcting the problem, run `systemctl restart dns-boot-check` and check `systemctl status dns-boot-check`. For a failure on the previous boot, use `journalctl -b -1` with the same unit filters.
|
||||
@@ -0,0 +1,89 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.common.dns;
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.dns = {
|
||||
enable = lib.mkEnableOption "systemd-resolved with a boot-time DNS diagnostic";
|
||||
|
||||
bootCheckName = lib.mkOption {
|
||||
type = lib.types.strMatching "[a-zA-Z0-9][a-zA-Z0-9.-]*";
|
||||
default = "portainer.app.internal";
|
||||
description = "Internal DNS name expected to have an IPv4 address at boot.";
|
||||
};
|
||||
|
||||
bootCheckRetries = lib.mkOption {
|
||||
type = lib.types.ints.positive;
|
||||
default = 5;
|
||||
description = "Maximum number of DNS lookup attempts at boot.";
|
||||
};
|
||||
|
||||
watchdogEnabled = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable the system manager's hardware watchdog.";
|
||||
};
|
||||
|
||||
watchdogTimeout = lib.mkOption {
|
||||
type = lib.types.ints.positive;
|
||||
default = 30;
|
||||
description = "Runtime hardware watchdog timeout in seconds.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
settings.Resolve = {
|
||||
LLMNR = "yes";
|
||||
DNSSEC = "allow-downgrade";
|
||||
DNSOverTLS = false;
|
||||
Domains = config.networking.search ++ [ "~." ];
|
||||
};
|
||||
};
|
||||
|
||||
services.journald = {
|
||||
storage = "persistent";
|
||||
extraConfig = lib.mkBefore ''
|
||||
SystemMaxUse=500M
|
||||
SystemMaxFileSize=50M
|
||||
RuntimeMaxUse=100M
|
||||
RuntimeMaxFileSize=10M
|
||||
MaxRetentionSec=30day
|
||||
MaxFileSec=7day
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.settings.Manager = lib.mkIf cfg.watchdogEnabled {
|
||||
RuntimeWatchdogSec = "${toString cfg.watchdogTimeout}s";
|
||||
RebootWatchdogSec = "${toString (cfg.watchdogTimeout + 10)}s";
|
||||
};
|
||||
|
||||
systemd.services.dns-boot-check = {
|
||||
description = "Check internal DNS resolution at boot";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" "systemd-resolved.service" ];
|
||||
requires = [ "systemd-resolved.service" ];
|
||||
path = [ pkgs.dnsutils pkgs.gnugrep pkgs.coreutils ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
script = ''
|
||||
name=${lib.escapeShellArg cfg.bootCheckName}
|
||||
attempts=${toString cfg.bootCheckRetries}
|
||||
for ((attempt=1; attempt<=attempts; attempt++)); do
|
||||
if answer=$(dig +short +time=2 +tries=1 @127.0.0.53 -q "$name" -t A) &&
|
||||
grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' <<< "$answer"; then
|
||||
echo "$name resolved through 127.0.0.53"
|
||||
exit 0
|
||||
fi
|
||||
echo "No IPv4 answer for $name (attempt $attempt/$attempts)" >&2
|
||||
if ((attempt < attempts)); then sleep 1; fi
|
||||
done
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -10,8 +10,6 @@
|
||||
./amdgpu.nix
|
||||
./coral-tpu-udev.nix
|
||||
];
|
||||
# Firmware Updater
|
||||
services.fwupd.enable = true;
|
||||
# Enable all license firmware
|
||||
hardware.enableAllFirmware = true;
|
||||
}
|
||||
@@ -136,6 +136,7 @@ let
|
||||
print("Lid event monitor stopped", file=sys.stderr, flush=True)
|
||||
EOFPYTHON
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.hardware.laptop-power-mgr = with lib; {
|
||||
@@ -300,5 +301,6 @@ in
|
||||
StandardError = "journal";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -72,12 +72,8 @@ let
|
||||
"x-scheme-handler/http" = "chromium-browser.desktop";
|
||||
"x-scheme-handler/https" = "chromium-browser.desktop";
|
||||
};
|
||||
portal = {
|
||||
enable = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal
|
||||
];
|
||||
};
|
||||
# Backends come from each desktop module (niri, hyprland, kde, ...)
|
||||
portal.enable = true;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -6,7 +6,9 @@ Various workarounds and fixes for desktop/workstation issues.
|
||||
|
||||
```
|
||||
fixes/
|
||||
└── default.nix # skyg.nixos.desktop.fixes.airpod-bluetooth.enabled — AirPods HFP mic
|
||||
├── default.nix # skyg.nixos.desktop.fixes.airpod-bluetooth.enabled — AirPods HFP mic
|
||||
└── fingerprint-autosuspend.nix
|
||||
# skyg.nixos.desktop.fixes.fingerprint-autosuspend.enabled — keep fingerprint reader awake
|
||||
```
|
||||
|
||||
## Behaviour
|
||||
@@ -18,3 +20,13 @@ When `skyg.nixos.desktop.fixes.airpod-bluetooth.enabled` is set to `true`:
|
||||
- WirePlumber auto-switches AirPods from A2DP to HFP when an app opens a mic.
|
||||
- Enables native HFP plus mSBC so the AirPods mic shows as an input.
|
||||
- Call audio is headset quality (mSBC if the buds support it), not A2DP.
|
||||
|
||||
### Fingerprint Reader Autosuspend Fix
|
||||
|
||||
When `skyg.nixos.desktop.fixes.fingerprint-autosuspend.enabled` is set to `true`:
|
||||
|
||||
- Adds a udev rule keeping the Goodix MOC fingerprint reader (`27c6:609c`)
|
||||
out of USB autosuspend (`power/control=on`, `autosuspend_delay_ms=-1`).
|
||||
- Prevents the recurring `usb 1-4: reset full-speed USB device` resets and the
|
||||
intermittent fprintd failure `Device reported an error during identify:
|
||||
Cannot run while suspended` caused by probing the reader while it is asleep.
|
||||
@@ -0,0 +1,36 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.desktop.fixes.airpod-bluetooth;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
skyg.nixos.desktop.fixes.airpod-bluetooth = {
|
||||
enabled = lib.mkEnableOption "AirPods Bluetooth mic via HFP (lower call quality)";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.enabled && config.skyg.nixos.desktop.enable) {
|
||||
# Switch AirPods to HFP when a mic is needed so the AirPods mic
|
||||
# shows as an input. Call audio is HFP (mSBC if supported), not A2DP.
|
||||
services.pipewire.wireplumber.extraConfig = {
|
||||
"51-airpods-bluetooth" = {
|
||||
"monitor.bluez.properties" = {
|
||||
"bluez5.enable-msbc" = true;
|
||||
"bluez5.msbc-support" = true;
|
||||
"bluez5.hfphsp-backend" = "native";
|
||||
"bluez5.roles" = [
|
||||
"a2dp_sink"
|
||||
"a2dp_source"
|
||||
"hsp_hs"
|
||||
"hsp_ag"
|
||||
"hfp_hf"
|
||||
"hfp_ag"
|
||||
];
|
||||
};
|
||||
"wireplumber.settings" = {
|
||||
"bluetooth.autoswitch-to-headset-profile" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,36 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.desktop.fixes.airpod-bluetooth;
|
||||
in
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
skyg.nixos.desktop.fixes.airpod-bluetooth = {
|
||||
enabled = lib.mkEnableOption "AirPods Bluetooth mic via HFP (lower call quality)";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.enabled && config.skyg.nixos.desktop.enable) {
|
||||
# Switch AirPods to HFP when a mic is needed so the AirPods mic
|
||||
# shows as an input. Call audio is HFP (mSBC if supported), not A2DP.
|
||||
services.pipewire.wireplumber.extraConfig = {
|
||||
"51-airpods-bluetooth" = {
|
||||
"monitor.bluez.properties" = {
|
||||
"bluez5.enable-msbc" = true;
|
||||
"bluez5.msbc-support" = true;
|
||||
"bluez5.hfphsp-backend" = "native";
|
||||
"bluez5.roles" = [
|
||||
"a2dp_sink"
|
||||
"a2dp_source"
|
||||
"hsp_hs"
|
||||
"hsp_ag"
|
||||
"hfp_hf"
|
||||
"hfp_ag"
|
||||
];
|
||||
};
|
||||
"wireplumber.settings" = {
|
||||
"bluetooth.autoswitch-to-headset-profile" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
./airpod-bluetooth.nix
|
||||
./fingerprint-autosuspend.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.skyg.nixos.desktop.fixes.fingerprint-autosuspend;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
skyg.nixos.desktop.fixes.fingerprint-autosuspend = {
|
||||
enabled = lib.mkEnableOption "Keep the Goodix MOC fingerprint reader out of USB autosuspend";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.enabled && config.skyg.nixos.desktop.enable) {
|
||||
# Framework Goodix MOC fingerprint reader (27c6:609c) resets whenever it is
|
||||
# probed while in USB autosuspend ("usb 1-4: reset full-speed USB device"),
|
||||
# and fprintd intermittently fails with "Cannot run while suspended".
|
||||
# Keep it powered so it responds reliably and stops the reset churn.
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="27c6", ATTRS{idProduct}=="609c", ATTR{power/control}="on", ATTR{power/autosuspend_delay_ms}="-1"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -33,6 +33,10 @@ server/
|
||||
(admin/timers/arrs/dns) and `skyg.nixos.server.*` for the K3s/K8s roles and the
|
||||
service modules under `services/`.
|
||||
|
||||
| Structure | Namespace | Notes |
|
||||
| ------------ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `timers.nix` | `skyg.server.timers` | Generic attrset → timer + oneshot service |
|
||||
|
||||
## Option Namespace
|
||||
|
||||
```
|
||||
|
||||
@@ -216,6 +216,8 @@ in
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "15s";
|
||||
RemainAfterExit = true;
|
||||
Environment = "KUBECONFIG=/etc/rancher/k3s/k3s.yaml";
|
||||
ExecStart = "${pkgs.kubectl}/bin/kubectl apply -f ${agentManifest}";
|
||||
@@ -230,6 +232,8 @@ in
|
||||
wantedBy = [ "portainer-agent-k3s.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "15s";
|
||||
RemainAfterExit = true;
|
||||
Environment = "KUBECONFIG=/etc/rancher/k3s/k3s.yaml";
|
||||
};
|
||||
|
||||
@@ -13,8 +13,10 @@ services/
|
||||
├── ai-services.nix # skyg.nixos.server.services.ai — Wyoming (whisper/piper/wake)
|
||||
├── audiobookshelf.nix # skyg.nixos.server.services.audiobookshelf — audiobook/podcast server
|
||||
├── jellyfin.nix # skyg.nixos.server.services.jellyfin — media server (uid/gid 7777)
|
||||
├── nbot-agent.nix # skyg.nixos.server.services.nbot-agent — nbot's agent system + gh, for nbot's `system`
|
||||
├── signal-cli.nix # skyg.nixos.server.services.signal-cli — signal-cli HTTP daemon (Hermes Signal bridge)
|
||||
├── colibri.nix # skyg.nixos.server.services.colibri — coli serve HTTP API (GLM-5.2/OLMoE local inference)
|
||||
├── llama-cpp.nix # skyg.nixos.server.services.llama-cpp — llama-server (GGUF, DFlash2 speculative decoding)
|
||||
└── comfyui/ # skyg.nixos.server.services.comfyui — ComfyUI with ROCm/CUDA GPU support
|
||||
```
|
||||
|
||||
@@ -22,10 +24,25 @@ services/
|
||||
|
||||
- **`ai-services.nix`** openwakeword as containers and
|
||||
enables NixOS-native Wyoming faster-whisper + piper. Opens 11434/10200/10300/10400.
|
||||
- **`nbot-agent.nix`** adds `gh` to nbot's agent system from this repo, leaving the nbot
|
||||
repo unchanged. `gh` reads `GH_TOKEN` from `agent_env`, and git over HTTPS to github.com
|
||||
uses it through `gh`. Every container gets that token (chosen on purpose, 2026-11-03),
|
||||
so anyone who can prompt an agent can use it or ask it to print the token.
|
||||
- **Shared Go caches** (2026-11-11, set in `hosts/hl-{fwdesk,fws1}/services/nbot.nix`, not
|
||||
here): each node bind-mounts one `GOMODCACHE` and `GOCACHE` into every container under
|
||||
`/var/cache/go/`, with the env vars in the master's `agent_env`. Go locks these, so sharing
|
||||
is safe. Only Go caches are shared, not all of `~/.cache`: other tools break or leak logins
|
||||
when shared, and it would skip each home's size limit. Trade-off: any container can change
|
||||
build results the others use. The caches have no size limit; clear with `go clean -cache`.
|
||||
- **`colibri.nix`** runs `coli serve` (colibrì's OpenAI-compatible API) as a native systemd
|
||||
service. `package` picks the backend (`pkgs.colibri`
|
||||
cpu / `pkgs.colibri-rocm`); `environmentFile` supplies `COLI_API_KEY` via agenix instead of
|
||||
a CLI flag.
|
||||
- **`llama-cpp.nix`** runs `llama-server` as a native systemd service. `draftModel` plus
|
||||
`specType = "draft-dflash"` turns on DFlash2 speculative decoding; `cacheReuse` turns on
|
||||
prefix reuse for repeated prompts (agents). Model files are read from disk, never packaged —
|
||||
the unit refuses to start with a clear message when one is missing. Enabled on fwdesk
|
||||
(off by default: ~19 GB of weights, first build is the ROCm package).
|
||||
|
||||
## Option Namespace
|
||||
|
||||
@@ -33,8 +50,10 @@ services/
|
||||
skyg.nixos.server.services.ai.enable
|
||||
skyg.nixos.server.services.audiobookshelf.{enable,package,configDir,dataDir}
|
||||
skyg.nixos.server.services.jellyfin.enable
|
||||
skyg.nixos.server.services.nbot-agent.system
|
||||
skyg.nixos.server.services.signal-cli.{enable,host,port,configDir,account,environmentFile,openFirewall}
|
||||
skyg.nixos.server.services.colibri.{enable,package,model,host,port,environmentFile,openFirewall,...}
|
||||
skyg.nixos.server.services.llama-cpp.{enable,package,model,draftModel,specType,specDraftNMax,cacheReuse,ctx,host,port,openFirewall,...}
|
||||
skyg.nixos.server.services.comfyui.{enable,mode,port,openFirewall}
|
||||
```
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
./audiobookshelf.nix
|
||||
./ai-services.nix
|
||||
./colibri.nix
|
||||
./llama-cpp.nix
|
||||
./comfyui
|
||||
./jellyfin.nix
|
||||
./nbot-agent.nix
|
||||
./signal-cli.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.skyg.nixos.server.services.llama-cpp;
|
||||
skygUser = config.skyg.user;
|
||||
|
||||
# Target model plus optional drafter. The drafter is only useful for a
|
||||
# strategy that matches its architecture: DFlash2 sidecars want
|
||||
# `--spec-type draft-dflash`.
|
||||
modelFiles = [ cfg.model ] ++ optional (cfg.draftModel != null) cfg.draftModel;
|
||||
|
||||
serverArgs =
|
||||
[
|
||||
"--model"
|
||||
cfg.model
|
||||
"--host"
|
||||
cfg.host
|
||||
"--port"
|
||||
(toString cfg.port)
|
||||
"--ctx-size"
|
||||
(toString cfg.ctx)
|
||||
"--n-gpu-layers"
|
||||
(toString cfg.gpuLayers)
|
||||
"--parallel"
|
||||
(toString cfg.parallel)
|
||||
"--flash-attn"
|
||||
cfg.flashAttention
|
||||
"--cache-type-k"
|
||||
cfg.kvCacheType
|
||||
"--cache-type-v"
|
||||
cfg.kvCacheType
|
||||
# Qwen-style tool calls arrive as Jinja templates.
|
||||
"--jinja"
|
||||
]
|
||||
++ optionals (cfg.draftModel != null) [
|
||||
"--model-draft"
|
||||
cfg.draftModel
|
||||
]
|
||||
++ optionals (cfg.specType != null) [
|
||||
"--spec-type"
|
||||
cfg.specType
|
||||
]
|
||||
++ optionals (cfg.specDraftNMax != null) [
|
||||
"--spec-draft-n-max"
|
||||
(toString cfg.specDraftNMax)
|
||||
]
|
||||
# Reuse the longest matching prefix of the previous prompt instead of
|
||||
# reprocessing it. This is the "prefix caching" half of the speedup, and it
|
||||
# works with any model.
|
||||
++ optionals (cfg.cacheReuse != null) [
|
||||
"--cache-reuse"
|
||||
(toString cfg.cacheReuse)
|
||||
]
|
||||
++ cfg.extraArgs;
|
||||
|
||||
checkModels = pkgs.writeShellScript "llama-cpp-check-models" ''
|
||||
set -eu
|
||||
${concatMapStringsSep "\n" (
|
||||
f: ''
|
||||
if [ ! -f ${escapeShellArg f} ]; then
|
||||
echo "llama-cpp: missing model file: ${f}" >&2
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
) modelFiles}
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.server.services.llama-cpp = {
|
||||
enable = mkEnableOption "the llama.cpp HTTP API (llama-server)";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.llama-cpp-halo;
|
||||
defaultText = literalExpression "pkgs.llama-cpp-halo";
|
||||
description = ''
|
||||
Server package. `pkgs.llama-cpp-halo` is the ROCm build for gfx1151;
|
||||
`pkgs.llama-cpp-halo-cpu` is the same tree without the GPU backend.
|
||||
'';
|
||||
};
|
||||
|
||||
model = mkOption {
|
||||
type = types.str;
|
||||
example = "/var/lib/llama-cpp/Qwen3.8-27B-Q4_K_M.gguf";
|
||||
description = "Path to the target model (GGUF).";
|
||||
};
|
||||
|
||||
draftModel = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "/var/lib/llama-cpp/Qwen3.8-27B-DFlash2-Q8_0.gguf";
|
||||
description = ''
|
||||
Optional draft model (GGUF). A drafter must be trained for the exact
|
||||
target model — a mismatch loads and then drafts nothing useful.
|
||||
'';
|
||||
};
|
||||
|
||||
specType = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "draft-dflash";
|
||||
description = ''
|
||||
Speculative decoding strategy passed to `--spec-type`. Use
|
||||
`draft-dflash` for a DFlash/DFlash2 drafter, `draft-mtp` for a model's
|
||||
own MTP heads, or `ngram-simple` for prompt-copying workloads (code
|
||||
edits, document rewriting) where no drafter is needed at all.
|
||||
'';
|
||||
};
|
||||
|
||||
specDraftNMax = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
example = 7;
|
||||
description = ''
|
||||
Tokens drafted per verification step. Clamped by the drafter's trained
|
||||
block size; 7 is the value upstream uses for DFlash2.
|
||||
'';
|
||||
};
|
||||
|
||||
cacheReuse = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
example = 256;
|
||||
description = ''
|
||||
`--cache-reuse`: minimum run of tokens to reuse from a matching prompt
|
||||
prefix. 256 is a reasonable default for coding agents.
|
||||
'';
|
||||
};
|
||||
|
||||
ctx = mkOption {
|
||||
type = types.int;
|
||||
default = 32768;
|
||||
description = "Context size in tokens.";
|
||||
};
|
||||
|
||||
kvCacheType = mkOption {
|
||||
type = types.enum [
|
||||
"f16"
|
||||
"bf16"
|
||||
"q8_0"
|
||||
"q4_0"
|
||||
];
|
||||
default = "q8_0";
|
||||
description = "KV cache type for both K and V (q8_0 halves KV memory).";
|
||||
};
|
||||
|
||||
flashAttention = mkOption {
|
||||
type = types.enum [
|
||||
"on"
|
||||
"off"
|
||||
"auto"
|
||||
];
|
||||
default = "auto";
|
||||
description = "`--flash-attn` value.";
|
||||
};
|
||||
|
||||
gpuLayers = mkOption {
|
||||
type = types.int;
|
||||
default = 99;
|
||||
description = ''
|
||||
Layers offloaded to the GPU. On Strix Halo the GPU shares system RAM,
|
||||
so all layers fit and 99 is the right value.
|
||||
'';
|
||||
};
|
||||
|
||||
parallel = mkOption {
|
||||
type = types.int;
|
||||
default = 1;
|
||||
description = "Parallel request slots.";
|
||||
};
|
||||
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "127.0.0.1";
|
||||
example = "0.0.0.0";
|
||||
description = "Address llama-server binds to.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8081;
|
||||
description = "TCP port for the HTTP API.";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = skygUser.name;
|
||||
description = "User to run the server as. Needs the render/video groups for GPU access.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "users";
|
||||
description = "Group to run the server as.";
|
||||
};
|
||||
|
||||
environment = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {
|
||||
# Same workaround the box's Ollama and ds4 units use.
|
||||
HSA_ENABLE_SDMA = "0";
|
||||
};
|
||||
description = "Environment variables for the service.";
|
||||
};
|
||||
|
||||
extraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [
|
||||
"--metrics"
|
||||
"--no-mmap"
|
||||
];
|
||||
description = "Extra arguments appended to the llama-server command line.";
|
||||
};
|
||||
|
||||
openFirewall = mkEnableOption "the llama-server port in the firewall";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.specType == null || cfg.draftModel != null || cfg.specType != "draft-dflash";
|
||||
message = "services.llama-cpp: specType = \"draft-dflash\" needs a draftModel.";
|
||||
}
|
||||
];
|
||||
|
||||
systemd.services.llama-cpp = {
|
||||
description = "llama.cpp server (local LLM inference)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
environment = cfg.environment;
|
||||
serviceConfig = {
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
ExecStartPre = checkModels;
|
||||
ExecStart = "${lib.getExe' cfg.package "llama-server"} ${escapeShellArgs serverArgs}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
# Model files live here; the unit may create it, weights are downloaded
|
||||
# by hand (they are tens of GB and not part of the system closure).
|
||||
StateDirectory = "llama-cpp";
|
||||
WorkingDirectory = "/var/lib/llama-cpp";
|
||||
LimitNOFILE = 65536;
|
||||
TimeoutStopSec = 120;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
# nbot's agent system with our additions (gh, lab-ssh). Use it for nbot's `system`.
|
||||
{ lib, nbot, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
lab = import ../../common/diagnix/hosts.nix;
|
||||
|
||||
# lab-ssh <host> [cmd...]: log in to a lab host as the read-only diagnix user.
|
||||
# The key comes base64-encoded in $DIAGNIX_KEY (agent_env, from the nbot-goose secret).
|
||||
labSsh = pkgs: pkgs.writeShellApplication {
|
||||
name = "lab-ssh";
|
||||
runtimeInputs = [ pkgs.openssh pkgs.coreutils ];
|
||||
text = ''
|
||||
host="''${1:-}"
|
||||
case "$host" in
|
||||
${concatStrings (mapAttrsToList (name: h: ''
|
||||
${name}|${removePrefix "hl-" name}) addr=${h.address}; check=${if h.hostKey == null then "accept-new" else "yes"} ;;
|
||||
'') lab.hosts)}
|
||||
*) echo "usage: lab-ssh <host> [command...]; hosts: ${concatStringsSep " " (attrNames lab.hosts)}" >&2; exit 2 ;;
|
||||
esac
|
||||
shift
|
||||
: "''${DIAGNIX_KEY:?DIAGNIX_KEY missing from agent_env}"
|
||||
key="$HOME/.ssh/diagnix"
|
||||
mkdir -p "$HOME/.ssh" && chmod 700 "$HOME/.ssh"
|
||||
(umask 077; base64 -d <<<"$DIAGNIX_KEY" > "$key")
|
||||
exec ssh -i "$key" -o IdentitiesOnly=yes -o StrictHostKeyChecking="$check" "diagnix@$addr" "$@"
|
||||
'';
|
||||
};
|
||||
|
||||
agentModule = { pkgs, ... }: {
|
||||
environment.systemPackages = [ pkgs.gh (labSsh pkgs) ];
|
||||
programs.ssh.knownHosts = mapAttrs
|
||||
(name: h: { hostNames = [ name h.address ]; publicKey = h.hostKey; })
|
||||
(filterAttrs (_: h: h.hostKey != null) lab.hosts);
|
||||
# gh reads GH_TOKEN (from agent_env); git over HTTPS uses it through gh.
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config.credential."https://github.com".helper = "!${pkgs.gh}/bin/gh auth git-credential";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.server.services.nbot-agent.system = mkOption {
|
||||
description = "nbot's agent system with gh and lab-ssh added. Use for nbot's `system`.";
|
||||
readOnly = true;
|
||||
type = types.package;
|
||||
default = (nbot.nixosConfigurations.agent.extendModules {
|
||||
modules = [ agentModule ];
|
||||
}).config.system.build.toplevel;
|
||||
# Keeps the manual from building it on every host.
|
||||
defaultText = literalExpression "nbot agent + gh + lab-ssh";
|
||||
};
|
||||
}
|
||||
+3
-1
@@ -10,8 +10,9 @@ Packages here are exposed via an overlay defined in `modules/core/default.nix`.
|
||||
| `colibri/` | colibrì (`JustVugg/colibri`) — GLM-5.2/OLMoE local inference engine, built from source, pinned to a tagged release. Backend-parameterized (`backend = "cpu" \| "rocm"`). Exposed as `pkgs.colibri` (cpu, default), `pkgs.colibri-rocm` (Strix Halo / gfx1151). Installs the `coli` CLI (wrapped with the Python env its converter/bench subcommands need) plus the bundled `colibri`/`olmoe` engine binaries. Model weights are a runtime concern and not packaged. |
|
||||
| `niri-touchscreen-gestures/` | Python daemon that reads multi-touch events from a touchscreen via `evdev`, detects 2/3/4-finger swipes (up/down/left/right), and dispatches configurable `niri msg action` commands. Configured via TOML; exposed as `pkgs.niri-touchscreen-gestures`. |
|
||||
| `buzz-desktop/` | Block Buzz desktop (Type-2 AppImage from `block/buzz`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.buzz-desktop` (`buzz-desktop` binary + desktop entry / icons). |
|
||||
| `superset-desktop/` | Superset Desktop (Type-2 AppImage from `superset-sh/superset`). Wrapped with `appimageTools.wrapType2` plus extra FHS libs (`elfutils`, `zstd`, WebKit/tray, GStreamer good/bad) so it runs on NixOS. Exposed as `pkgs.superset-desktop` (`superset-desktop` binary + desktop entry / icons). |
|
||||
| `buzz-cli/` | Buzz CLI (`buzz`, `crates/buzz-cli` of `block/buzz`), built with `rustPlatform.buildRustPackage` from the same tag as `buzz-desktop`. Hermes's Buzz platform shells out to it. Bump with `update.sh` (sets the source hash, resets `cargoHash` to `lib.fakeHash`; build once and paste the `got:` hash). Robots call it with `pkgs.callPackage` (their nixpkgs has no host overlay). |
|
||||
| `delta-editor/` | Delta Editor (Zed Industries' AI-native editor, `delta.dev`) prebuilt tarball. No stable URL exists — the release API returns a short-lived signed R2 link — so `src` is a fixed-output derivation that resolves the API at build time. Interpreter/RPATH patched (`--force-rpath`, `dontPatchELF`), dlopen'd graphics libs (`libglvnd`, `vulkan-loader`, `wayland`) added via wrapper, `XKB_CONFIG_ROOT` set for the bundled libxkbcommon. Exposed as `pkgs.delta-editor` (`delta-editor` binary + desktop entry / icons); named `-editor` to avoid clashing with the `delta` git diff pager. |
|
||||
| `llama-cpp/` | llama.cpp pinned to v0.8.0, the first release with DFlash2 drafters (`--spec-type draft-dflash`). nixpkgs only carries v0.6.0 in the unstable input and an older tree in the stable one, so the server is built here. HIP build for Strix Halo (`CMAKE_HIP_ARCHITECTURES=gfx1151`, ROCm clang++, `autoPatchelfHook`). Backend-parameterized: `pkgs.llama-cpp-halo` (rocm, default) and `pkgs.llama-cpp-halo-cpu` (same tree, no GPU backend). Web UI is off — it downloads prebuilt assets at build time, which the sandbox cannot do. Model weights are not packaged. |
|
||||
|
||||
## Adding a New Package
|
||||
|
||||
@@ -32,6 +33,7 @@ Each package can have an `update.sh` script that automates version bumps.
|
||||
- **`skyg pkgs update --all`** — auto-detect the latest version for all packages that have `update.sh`.
|
||||
- **`skyg pkgs update <pkg-name>`** — auto-detect the latest version for a single package.
|
||||
- **`skyg pkgs update <pkg-name> <version>`** — bump a specific package to a specific version.
|
||||
- **Pre-commit hook** — a `pkgs-update` hook (defined in `flake.nix`) runs `skyg pkgs update --all` on the first commit attempt and then at most once every seven days. It records successful runs in Git's local metadata; failed updates are retried on the next commit. If it changed anything under `pkgs/`, it blocks the commit (review + `git add pkgs/`, then commit again without rerunning the update).
|
||||
|
||||
Each `update.sh` supports two modes:
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
|
||||
# Buzz CLI (`buzz`, crates/buzz-cli in block/buzz). Hermes's Buzz platform
|
||||
# runs it, so a robot with a Buzz identity needs it. Upstream ships no binary.
|
||||
# Pinned to the same tag as pkgs/buzz-desktop. The relay image tracks `main`,
|
||||
# so bump both together if the CLI and relay stop agreeing.
|
||||
#
|
||||
# To bump: run ./update.sh [<version>] (sets the source hash, resets
|
||||
# cargoHash), then build once and paste the cargoHash from the "got:" line.
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "buzz-cli";
|
||||
version = "0.5.30";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "block";
|
||||
repo = "buzz";
|
||||
rev = "desktop-v${version}";
|
||||
hash = "sha256-Ay6zUeHHYO92/Fs4FGHm1+QQUoUEQjYyOC3dDg5+7Ss=";
|
||||
};
|
||||
|
||||
# The workspace has git deps in [patch.crates-io]; cargoHash covers them.
|
||||
cargoHash = lib.fakeHash;
|
||||
|
||||
# Only this crate; the workspace has 30+ others (relay, db, ...).
|
||||
cargoBuildFlags = [ "-p" "buzz-cli" ];
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Buzz CLI, the agent-facing command line for a Buzz relay";
|
||||
homepage = "https://github.com/block/buzz";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.linux;
|
||||
mainProgram = "buzz";
|
||||
};
|
||||
}
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bump buzz-cli to a new version.
|
||||
# Usage: ./update.sh [<version>]
|
||||
# With version: bump to that version.
|
||||
# Without args: auto-detect latest from GitHub releases.
|
||||
# Uses the same desktop-v* tag as buzz-desktop. cargoHash needs a build,
|
||||
# so it is reset to lib.fakeHash; build once and paste the "got:" hash.
|
||||
set -euo pipefail
|
||||
|
||||
PKG="buzz-cli"
|
||||
REPO="block/buzz"
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
VERSION="$1"
|
||||
else
|
||||
echo "Auto-detecting latest buzz-cli version..."
|
||||
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases" \
|
||||
| jq -r '[.[] | select(.tag_name | startswith("desktop-v")) | .tag_name | sub("^desktop-v"; "")] | .[0]')
|
||||
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
|
||||
echo "Could not auto-detect latest version from GitHub."
|
||||
echo "Usage: $0 [<version>]"
|
||||
exit 1
|
||||
fi
|
||||
echo "Latest: $VERSION"
|
||||
fi
|
||||
|
||||
CURRENT=$(sed -n 's/^ *version = "\(.*\)";/\1/p' default.nix | head -n1)
|
||||
if [ "$CURRENT" = "$VERSION" ]; then
|
||||
echo "✅ ${PKG} already at ${VERSION}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
HASH=$(nix flake prefetch "github:${REPO}/desktop-v${VERSION}" --json | jq -r '.hash')
|
||||
if [ -z "$HASH" ] || [ "$HASH" = "null" ]; then
|
||||
echo "Could not prefetch tag desktop-v${VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i "s/version = \".*\";/version = \"${VERSION}\";/" default.nix
|
||||
sed -i "s|hash = .*;|hash = \"${HASH}\";|" default.nix
|
||||
sed -i "s|cargoHash = .*;|cargoHash = lib.fakeHash;|" default.nix
|
||||
|
||||
echo "✅ ${PKG} bumped to ${VERSION}"
|
||||
echo " Next: build once, then paste the cargoHash from the \"got:\" line."
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
let
|
||||
pname = "buzz-desktop";
|
||||
version = "0.5.28";
|
||||
version = "0.5.30";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/block/buzz/releases/download/desktop-v${version}/Buzz_${version}_amd64.AppImage";
|
||||
hash = "sha256-YCI6wn2HQiJqC149teH5dEGyZ/9jq7kFeTsz/mVoh0w=";
|
||||
hash = "sha256-AAZc110TQPDucGamgOUgimlXw4mjquzBgvTwc6oWzZo=";
|
||||
};
|
||||
|
||||
extracted = appimageTools.extractType2 {
|
||||
|
||||
Loaded 100 of 148 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user