nixos/shairport-sync: add package option

This commit is contained in:
Jordan Williams 2024-11-14 13:54:53 -06:00
parent 5c6590d4e6
commit 697fa78c9a
No known key found for this signature in database
GPG Key ID: 9FB42B0E7F657D8C

View File

@ -27,6 +27,8 @@ in
''; '';
}; };
package = lib.options.mkPackageOption pkgs "shairport-sync" { };
arguments = mkOption { arguments = mkOption {
type = types.str; type = types.str;
default = "-v -o pa"; default = "-v -o pa";
@ -100,12 +102,12 @@ in
serviceConfig = { serviceConfig = {
User = cfg.user; User = cfg.user;
Group = cfg.group; Group = cfg.group;
ExecStart = "${pkgs.shairport-sync}/bin/shairport-sync ${cfg.arguments}"; ExecStart = "${lib.getExe cfg.package} ${cfg.arguments}";
RuntimeDirectory = "shairport-sync"; RuntimeDirectory = "shairport-sync";
}; };
}; };
environment.systemPackages = [ pkgs.shairport-sync ]; environment.systemPackages = [ cfg.package ];
}; };