This repository has been archived on 2024-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-dotfiles/user/modules/mpd-notification/default.nix

30 lines
900 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.services.mpd-notification;
in {
meta.maintainers = [ "Varris" ];
options.services.mpd-notification = {
package = lib.mkPackageOption pkgs "mpd-notification" { };
enable = lib.mkEnableOption "the mpd-notification service";
};
config = lib.mkIf cfg.enable {
systemd.user.services.mpd-notification = {
Unit = {
Description = "A notification daemon for MPD";
Documentation = "https://github.com/eworm-de/mpd-notification";
After = [ "mpd.service" "network.target" "network-online.target" ];
Requires = [ "dbus.socket" ];
};
Service = {
Type = "simple";
Restart = "on-failure";
ExecStart = "${cfg.package}/bin/mpd-notification";
};
};
};
}