diff --git a/README.md b/README.md index 0ab0fbe..edf0438 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ missing it generates new ones and saves them back to the stick. | `faumaray-password.age` | hashed login password (`mkpasswd -m yescrypt`; `set-password`) | the user account (`modules/core/users.nix`) | | `ssh-id_ed25519.age`, `ssh-id_ed25519_work.age` | private SSH keys (+ optional plain `.pub` files) | linked to `~/.ssh/` (`modules/security/ssh.nix`) | | `gitea-runner-token.age` | one line `TOKEN=` | Gitea runner `performance`, `tokenFile` (`modules/dev/gitea-runner.nix`) | -| `tg-ws-proxy-secret.age` | the hex secret (`openssl rand -hex 16`) | Telegram proxy, `secretFile` (`modules/network/proxy-suite.nix`) | +| `tg-ws-proxy-secret.age` | the hex secret (32 hex digits, generated below) | Telegram proxy, `secretFile` (`modules/network/proxy-suite.nix`) | The last two are new: the runner token and the Telegram secret used to be plaintext in the Nix files. Create them the same way as the others (the @@ -248,8 +248,8 @@ printf 'TOKEN=%s\n' '' \ | nix run .#secret-from-file -- gitea-runner-token.age - -i ~/.ssh/id_ed25519 # Telegram proxy: a new secret; note it, the Telegram clients need it in the proxy link -s=$(openssl rand -hex 16) && echo "$s" -printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519 +s=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n') && [ "${#s}" -eq 32 ] && echo "$s" \ + && printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519 unset s git add secrets/gitea-runner-token.age secrets/tg-ws-proxy-secret.age # agenix -e does not @@ -441,7 +441,7 @@ in `host.nix`). It installs, for the owner (user scope): |---|---| | `claude` | Claude Code from nixpkgs (unfree, allowed in `core`) | | MCP `codememory` | codebase-memory-mcp (DeusData), a code knowledge graph; the CLI is on PATH, indexes live in `~/.cache/codebase-memory-mcp`. To use another server, replace this one `mcpServers` entry | -| MCP `serena` | Serena, semantic code retrieval and editing; the `serena` flake input pinned to a release tag, started per project (`--project-from-cwd`, no browser dashboard) | +| MCP `serena` | Serena, semantic code retrieval and editing; the `serena` flake input pinned to a release tag, started per project (`--project-from-cwd`; the dashboard is started but not opened in a browser, and listens only on 127.0.0.1) | | MCP `rea` | REA (Reverse Engineer Anything), `npx --yes rea-agents@ mcp`; wrapper `rea` on PATH, plus REA's skill `reverse-engineer-anything` from the same npm release | | plugin `caveman` | skills, commands, agents and hooks (JuliusBrussee/caveman at a pinned tag); its default mode is off, `/caveman` turns it on per session | @@ -464,19 +464,25 @@ What is not hermetic or worth knowing: - **REA runs from npm**: the first start downloads the pinned version and its dependencies into `~/.npm` (needs network; the dependency tree is not pinned). - Its prebuilt native binaries rely on the `nix-ld` aspect. REA's skill - and caveman are fetched with fixed hashes. + Standalone executables shipped by npm packages rely on the `nix-ld` aspect; + `.node` add-ons loaded by the Nix-built `node` do not. REA's skill and + caveman are fetched with fixed hashes. - **Serena writes `.serena/` into every project it activates** (it is in this repository's `.gitignore`). It is built locally from its lock file, not downloaded from a binary cache, so the first switch takes longer. - Plugins run code: caveman's hooks run `node` scripts in every session. - The first switch moves existing files at these paths to `*.hm-backup` (not - `settings.json`, which is merged). + `settings.json`, which is merged). `home-manager.overwriteBackup = true` + (`modules/core/home-manager.nix`) lets later switches replace an older + `*.hm-backup` instead of stopping. Bump a pin: - Serena: change the tag of the `serena` input in `flake.nix`, then - `nix flake update serena`. + `nix flake update serena`. Serena v1.7.0's own flake uses the deprecated + `stdenv.isLinux` / `stdenv.isDarwin` (the two warnings seen at every + evaluation); a future nixpkgs update may remove them and require bumping the + `serena` input. - REA: change `reaVersion` in `modules/ai/claude-code.nix`, then `nix store prefetch-file --unpack --hash-type sha256 https://registry.npmjs.org/rea-agents/-/rea-agents-.tgz` and put the printed hash into `hash`. @@ -575,8 +581,13 @@ Telegram proxy. `flake.nix` (`nixConfig`) must be accepted; use `--accept-flake-config`. Serena is always built locally. - **A switch stops at an existing `*.hm-backup` file.** Home-manager moves files - it now manages (GTK/Qt/Kvantum configs, `~/.claude/skills/*`) to `*.hm-backup` - and refuses to overwrite an older backup: look at it, then delete it. + it now manages (GTK/Qt/Kvantum configs, `~/.claude/skills/*`) to `*.hm-backup`. + `home-manager.overwriteBackup = true` (`modules/core/home-manager.nix`) + replaces an older backup, so this should only happen if that setting was + removed: look at the backup, then delete it. Files such as + `~/.config/gtk-3.0/gtk.css` or `~/.config/qt6ct/qt6ct.conf` can be rewritten + by Noctalia's GTK template or the qt*ct tools; the next switch backs the + rewritten file up again. - **WezTerm starts with default colours or fonts after an update.** WezTerm drops its whole config silently when a value does not parse (Stylix writes the palette). `WEZTERM_LOG=debug wezterm show-keys` must log `Reloaded configuration`. diff --git a/modules/core/home-manager.nix b/modules/core/home-manager.nix index 18b19fa..61531ab 100644 --- a/modules/core/home-manager.nix +++ b/modules/core/home-manager.nix @@ -10,6 +10,9 @@ useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "hm-backup"; + # gtk.css and qt6ct.conf may be rewritten by Noctalia's GTK template or qt*ct; + # without this a later switch fails ("would be clobbered") on the old .hm-backup. + overwriteBackup = true; extraSpecialArgs = { inherit inputs; }; }; }; diff --git a/modules/network/proxy-suite.nix b/modules/network/proxy-suite.nix index 48d83de..dd7ce40 100644 --- a/modules/network/proxy-suite.nix +++ b/modules/network/proxy-suite.nix @@ -1,6 +1,6 @@ # proxy-suite (github:FUFSoB/proxy-suite-flake): zapret DPI bypass, the # Telegram WebSocket proxy and the GUI. The MTProto secret is an agenix secret: -# secrets/tg-ws-proxy-secret.age the secret (`openssl rand -hex 16`) +# secrets/tg-ws-proxy-secret.age the secret (32 hex digits) # (nix run .#secret-from-file -- tg-ws-proxy-secret.age ) # proxy-suite reads it through systemd LoadCredential, so root ownership is # enough. Without the file the Telegram proxy stays off and a warning says so. @@ -59,9 +59,8 @@ in warnings = lib.optional (!hasTgSecret) '' The Telegram WebSocket proxy (services.proxy-suite.tgWsProxy) is off: - secrets/tg-ws-proxy-secret.age is missing. Create a new secret with - `openssl rand -hex 16`, then `nix run .#secret-from-file -- tg-ws-proxy-secret.age ` - and `git add` it. + secrets/tg-ws-proxy-secret.age is missing. Create it with the command in + secrets/README.md (32 random hex digits) and `git add` it. ''; }; } diff --git a/secrets/README.md b/secrets/README.md index c917877..f59f3ba 100644 --- a/secrets/README.md +++ b/secrets/README.md @@ -23,7 +23,7 @@ switched off, and the build prints a warning that names the missing file. | File | Content | Used by | Without the file | | ------------------------ | --------------------------------------- | ------------------------------------------------ | ------------------------------------------ | | `gitea-runner-token.age` | One line `TOKEN=` | `modules/dev/gitea-runner.nix` (`tokenFile`) | The runner "performance" is not configured | -| `tg-ws-proxy-secret.age` | The hex secret (`openssl rand -hex 16`) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off | +| `tg-ws-proxy-secret.age` | The hex secret (32 hex digits) | `modules/network/proxy-suite.nix` (`secretFile`) | `services.proxy-suite.tgWsProxy` stays off | Both are decrypted to `/run/agenix/` (root, mode `0400`) and read by the service units. No `.nix` file contains a secret value. @@ -39,7 +39,9 @@ printf 'TOKEN=%s\n' "$t" | nix run .#secret-from-file -- gitea-runner-token.age unset t # Telegram proxy secret: a fresh random value. -openssl rand -hex 16 | tee /dev/stderr | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519 +s=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n') && [ "${#s}" -eq 32 ] && echo "$s" >&2 \ + && printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - -i ~/.ssh/id_ed25519 +unset s ``` The second command also prints the secret once, because the Telegram clients @@ -55,5 +57,7 @@ new Telegram secret, and store the new values with the commands above. To replace an existing file later, add `--force`: ```sh -openssl rand -hex 16 | nix run .#secret-from-file -- tg-ws-proxy-secret.age - --force -i ~/.ssh/id_ed25519 +s=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n') && [ "${#s}" -eq 32 ] \ + && printf '%s\n' "$s" | nix run .#secret-from-file -- tg-ws-proxy-secret.age - --force -i ~/.ssh/id_ed25519 +unset s ```