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

34 lines
800 B
Nix
Raw Normal View History

2023-08-19 18:36:21 +02:00
{ 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" ];
};
};
}