nixos/gitDaemon: add package option

This commit is contained in:
Nikolay Korotkiy 2024-05-27 18:50:15 +04:00
parent 3f99d04a16
commit ecddd99c6a
No known key found for this signature in database
GPG Key ID: D1DE6D7F693663A5

View File

@ -27,6 +27,8 @@ in
'';
};
package = mkPackageOption pkgs "git" { };
basePath = mkOption {
type = types.str;
default = "";
@ -119,7 +121,7 @@ in
systemd.services.git-daemon = {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
script = "${pkgs.git}/bin/git daemon --reuseaddr "
script = "${getExe cfg.package} daemon --reuseaddr "
+ (optionalString (cfg.basePath != "") "--base-path=${cfg.basePath} ")
+ (optionalString (cfg.listenAddress != "") "--listen=${cfg.listenAddress} ")
+ "--port=${toString cfg.port} --user=${cfg.user} --group=${cfg.group} ${cfg.options} "