From 0d52f2058d76aba769a5d6b67daebd3e33508475 Mon Sep 17 00:00:00 2001 From: oqyude Date: Sat, 24 Oct 2026 02:25:38 +0300 Subject: [PATCH] refactor(modules): drop the duplicated WSL nix-serve module (T45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modules/wsl/nix-serve.nix was a byte-identical copy of modules/server/nix-serve.nix — md5 0aca1128f12f975d2376db21fbd92e40 for both. Two live hosts, two copies of the same 25 lines: any fix to one silently missed the other. The WSL module now imports ../server/nix-serve.nix. Equivalence is established by content, not by a run: the module body is identical, and its `sopsFile = ./secrets/nix-serve.yaml` resolves relative to the importing file — so WSL now reads modules/server/secrets/nix-serve.yaml, which is itself byte-identical to the copy it used to read (md5 af6e04419e8b3dd467c8cb693f374782 for both). The evaluated configuration is therefore unchanged; only the paths differ. `services.nix-serve` is now declared by exactly one file in the repo. Verified: import-graph check green (119 .nix files, 119 references), and `bash .ci/checks.sh --no-build` -> PASS 3 / FAIL 0. Note: modules/wsl/secrets/nix-serve.yaml is now unreferenced. It is NOT deleted here — secrets need explicit owner sign-off, see .agent/tasks/manifest.md T53. Not pushed. --- modules/wsl/default.nix | 8 +++++++- modules/wsl/nix-serve.nix | 25 ------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 modules/wsl/nix-serve.nix diff --git a/modules/wsl/default.nix b/modules/wsl/default.nix index 1334f6e..8f03d2c 100644 --- a/modules/wsl/default.nix +++ b/modules/wsl/default.nix @@ -7,7 +7,13 @@ { imports = [ ../pkgs/beets.nix - ./nix-serve.nix + # The WSL nix-serve module used to be a byte-identical copy of the server + # one (md5 0aca1128...). Importing the server module directly keeps a + # single source; its `sopsFile = ./secrets/nix-serve.yaml` then resolves + # to modules/server/secrets/nix-serve.yaml, which is itself byte-identical + # to the copy that used to live in modules/wsl/secrets/ (md5 af6e0441...), + # so the evaluated configuration is unchanged. + ../server/nix-serve.nix ./builder.nix # ./tools # ./containers removed 2026-10-10: contained only kokoro-tts.nix diff --git a/modules/wsl/nix-serve.nix b/modules/wsl/nix-serve.nix deleted file mode 100644 index 7ec7161..0000000 --- a/modules/wsl/nix-serve.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - services = { - nix-serve = { - enable = true; - package = pkgs.nix-serve-ng; - openFirewall = true; - port = 5000; - bindAddress = "0.0.0.0"; - secretKeyFile = config.sops.secrets.private-key.path; - }; - }; - sops.secrets = { - private-key = { - key = "private-key"; - sopsFile = ./secrets/nix-serve.yaml; - mode = "0600"; - }; - }; -}