diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-27 22:46:32 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-28 00:31:10 +0100 |
commit | a9dd00105d6fad9153251b937c18e7e90a714d66 (patch) | |
tree | 3b8006fb28cd337a51c809e8e68edb94e3149a8c | |
parent | fix(back): add correct links to rss feed (diff) | |
download | nixos-server-a9dd00105d6fad9153251b937c18e7e90a714d66.zip |
fix(modules/back): add root_url to back config
Co-authored-by: Silas Schöffel <sils@sils.li>
-rw-r--r-- | modules/by-name/ba/back/module.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/by-name/ba/back/module.nix b/modules/by-name/ba/back/module.nix index 2ff0768..520acdb 100644 --- a/modules/by-name/ba/back/module.nix +++ b/modules/by-name/ba/back/module.nix @@ -7,14 +7,15 @@ }: let cfg = config.vhack.back; - mkConfigFile = repoPath: + mkConfigFile = repoPath: domain: (pkgs.formats.json {}).generate "config.json" { inherit (cfg) source_code_repository_url; repository_path = repoPath; + root_url = "https://${domain}"; }; - mkUnit = repoPath: port: { + mkUnit = repoPath: port: domain: { description = "Back service for ${repoPath}"; wants = ["network-online.target"]; after = ["network-online.target"]; @@ -25,7 +26,7 @@ }; serviceConfig = { - ExecStart = "${lib.getExe vhackPackages.back} ${mkConfigFile repoPath}"; + ExecStart = "${lib.getExe vhackPackages.back} ${mkConfigFile repoPath domain}"; # Ensure that the service can read the repository # FIXME(@bpeetz): This has the implied assumption, that all the exposed git @@ -71,7 +72,7 @@ services = lib.mapAttrs' (gitPath: config: { name = builtins.replaceStrings ["/"] ["_"] "back-${config.domain}"; - value = mkUnit gitPath config.port; + value = mkUnit gitPath config.port config.domain; }) cfg.repositories; |