nix-config/modules/home-manager/snapclient/default.nix

34 lines
800 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.snapclient;
in
{
options.snapclient = {
enable = lib.mkEnableOption "snapclient";
snapserver-host = lib.mkOption {
type = lib.types.str;
default = "localhost";
description = "host running snapserver to connect to";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.snapcast;
defaultText = "pkgs.snapcast";
description = "package for snapcast";
};
};
config = lib.mkIf cfg.enable {
systemd.user.services.snapclient = {
Service = {
Type = "simple";
ExecStart = "${cfg.package}/bin/snapclient --host ${cfg.snapserver-host}";
};
Unit.After = [ "pipewire.service" ];
Install.WantedBy = [ "pipewire.service" ];
};
};
}