From 697fa78c9a24e8272549a9767de45cec28093b20 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Thu, 14 Nov 2024 13:54:53 -0600 Subject: [PATCH] nixos/shairport-sync: add package option --- nixos/modules/services/networking/shairport-sync.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/shairport-sync.nix b/nixos/modules/services/networking/shairport-sync.nix index df7e143bb41f..43363185469d 100644 --- a/nixos/modules/services/networking/shairport-sync.nix +++ b/nixos/modules/services/networking/shairport-sync.nix @@ -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 ]; };