summary refs log tree commit diff stats
path: root/modules/by-name/ba/back/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/ba/back/module.nix')
-rw-r--r--modules/by-name/ba/back/module.nix9
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;