diff --git a/nixos/modules/services/misc/radicle.nix b/nixos/modules/services/misc/radicle.nix index b85d4f5aacb7..60fccc094236 100644 --- a/nixos/modules/services/misc/radicle.nix +++ b/nixos/modules/services/misc/radicle.nix @@ -227,6 +227,16 @@ in default = 8080; description = "The port on which `radicle-httpd` listens."; }; + aliases = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + description = "Alias and RID pairs to shorten git clone commands for repositories."; + default = { }; + example = lib.literalExpression '' + { + heartwood = "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"; + } + ''; + }; nginx = lib.mkOption { # Type of a single virtual host, or null. type = lib.types.nullOr ( @@ -342,7 +352,20 @@ in description = "Radicle HTTP gateway to radicle-node"; documentation = [ "man:radicle-httpd(1)" ]; serviceConfig = { - ExecStart = "${lib.getExe' cfg.httpd.package "radicle-httpd"} --listen ${cfg.httpd.listenAddress}:${toString cfg.httpd.listenPort} ${lib.escapeShellArgs cfg.httpd.extraArgs}"; + ExecStart = lib.escapeShellArgs ( + [ + (lib.getExe' cfg.httpd.package "radicle-httpd") + "--listen=${cfg.httpd.listenAddress}:${toString cfg.httpd.listenPort}" + ] + ++ lib.flatten ( + lib.mapAttrsToList (alias: rid: [ + "--alias" + alias + rid + ]) cfg.httpd.aliases + ) + ++ cfg.httpd.extraArgs + ); Restart = lib.mkDefault "on-failure"; RestartSec = "10"; SocketBindAllow = [ "tcp:${toString cfg.httpd.listenPort}" ];