nixos/shairport-sync: add package option (#355985)

This commit is contained in:
jopejoe1 2024-11-16 03:12:02 +01:00 committed by GitHub
commit 95b30da133
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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