From a9dd00105d6fad9153251b937c18e7e90a714d66 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 27 Dec 2024 22:46:32 +0100 Subject: fix(modules/back): add root_url to back config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Silas Schöffel --- modules/by-name/ba/back/module.nix | 9 +++++---- 1 file 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; -- cgit 1.4.1