updated wiring for hub feature enable

This commit is contained in:
2026-04-03 08:37:21 -05:00
parent 304df327e3
commit f3d75b9ba5
2 changed files with 7 additions and 7 deletions

View File

@@ -444,11 +444,11 @@ def _read_hub_overrides() -> tuple[dict, str | None]:
with open(HUB_OVERRIDES_NIX, "r") as f: with open(HUB_OVERRIDES_NIX, "r") as f:
content = f.read() content = f.read()
for m in re.finditer( for m in re.finditer(
r'sovran_systemsOS\.features\.([a-zA-Z0-9_-]+)\s*=\s*(true|false)\s*;', r'sovran_systemsOS\.features\.([a-zA-Z0-9_-]+)\s*=\s*(?:lib\.mkForce\s+)?(true|false)\s*;',
content, content,
): ):
features[m.group(1)] = m.group(2) == "true" features[m.group(1)] = m.group(2) == "true"
m2 = re.search(r'sovran_systemsOS\.nostr_npub\s*=\s*"([^"]*)"', content) m2 = re.search(r'sovran_systemsOS\.nostr_npub\s*=\s*(?:lib\.mkForce\s+)?"([^"]*)"', content)
if m2: if m2:
nostr_npub = m2.group(1) nostr_npub = m2.group(1)
except FileNotFoundError: except FileNotFoundError:
@@ -461,13 +461,13 @@ def _write_hub_overrides(features: dict, nostr_npub: str | None) -> None:
lines = [] lines = []
for feat_id, enabled in features.items(): for feat_id, enabled in features.items():
val = "true" if enabled else "false" val = "true" if enabled else "false"
lines.append(f" sovran_systemsOS.features.{feat_id} = {val};") lines.append(f" sovran_systemsOS.features.{feat_id} = lib.mkForce {val};")
if nostr_npub: if nostr_npub:
lines.append(f' sovran_systemsOS.nostr_npub = "{nostr_npub}";') lines.append(f' sovran_systemsOS.nostr_npub = lib.mkForce "{nostr_npub}";')
body = "\n".join(lines) + "\n" if lines else "" body = "\n".join(lines) + "\n" if lines else ""
content = ( content = (
"# Auto-generated by Sovran Hub — do not edit manually\n" "# Auto-generated by Sovran Hub — do not edit manually\n"
"{ ... }:\n" "{ lib, ... }:\n"
"{\n" "{\n"
+ body + body
+ "}\n" + "}\n"

View File

@@ -294,7 +294,7 @@ in
script = '' script = ''
cat > /etc/nixos/hub-overrides.nix <<'EOF' cat > /etc/nixos/hub-overrides.nix <<'EOF'
# Auto-generated by Sovran Hub do not edit manually # Auto-generated by Sovran Hub do not edit manually
{ ... }: { lib, ... }:
{ {
} }
EOF EOF