updated wiring for hub feature enable
This commit is contained in:
@@ -444,11 +444,11 @@ def _read_hub_overrides() -> tuple[dict, str | None]:
|
||||
with open(HUB_OVERRIDES_NIX, "r") as f:
|
||||
content = f.read()
|
||||
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,
|
||||
):
|
||||
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:
|
||||
nostr_npub = m2.group(1)
|
||||
except FileNotFoundError:
|
||||
@@ -461,13 +461,13 @@ def _write_hub_overrides(features: dict, nostr_npub: str | None) -> None:
|
||||
lines = []
|
||||
for feat_id, enabled in features.items():
|
||||
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:
|
||||
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 ""
|
||||
content = (
|
||||
"# Auto-generated by Sovran Hub — do not edit manually\n"
|
||||
"{ ... }:\n"
|
||||
"{ lib, ... }:\n"
|
||||
"{\n"
|
||||
+ body
|
||||
+ "}\n"
|
||||
|
||||
@@ -294,7 +294,7 @@ in
|
||||
script = ''
|
||||
cat > /etc/nixos/hub-overrides.nix <<'EOF'
|
||||
# Auto-generated by Sovran Hub — do not edit manually
|
||||
{ ... }:
|
||||
{ lib, ... }:
|
||||
{
|
||||
}
|
||||
EOF
|
||||
@@ -303,4 +303,4 @@ EOF
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 8937 ];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user