mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 13:01:28 +00:00
32 lines
691 B
Python
32 lines
691 B
Python
FLAKE_CONFIG_PATH = "/etc/nixos/sp-modules/flake.nix"
|
|
|
|
|
|
class FlakeServiceManager:
|
|
def __enter__(self):
|
|
self.services = {}
|
|
return self
|
|
|
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
with open(FLAKE_CONFIG_PATH, "w") as file:
|
|
file.write(
|
|
"""
|
|
{
|
|
description = "SelfPrivacy NixOS PoC modules/extensions/bundles/packages/etc";\n
|
|
"""
|
|
)
|
|
|
|
for key, value in self.services.items():
|
|
file.write(
|
|
f"""
|
|
inputs.{key}.url = {value};
|
|
"""
|
|
)
|
|
|
|
file.write(
|
|
"""
|
|
inputs.my.url = path:./my;
|
|
outputs = _: { };
|
|
}
|
|
"""
|
|
)
|