fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
914 B43 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.services.volnoti;
8
9in {
10  meta.maintainers = [ maintainers.imalison ];
11
12  options = {
13    services.volnoti = {
14      enable = mkEnableOption "Volnoti volume HUD daemon";
15
16      package = mkOption {
17        type = types.package;
18        default = pkgs.volnoti;
19        defaultText = literalExpression "pkgs.volnoti";
20        description = ''
21          Package containing the {command}`volnoti` program.
22        '';
23      };
24    };
25  };
26
27  config = mkIf cfg.enable {
28    assertions = [
29      (lib.hm.assertions.assertPlatform "services.volnoti" pkgs
30        lib.platforms.linux)
31    ];
32
33    home.packages = [ cfg.package ];
34
35    systemd.user.services.volnoti = {
36      Unit = { Description = "volnoti"; };
37
38      Install = { WantedBy = [ "graphical-session.target" ]; };
39
40      Service = { ExecStart = "${pkgs.volnoti}/bin/volnoti -v -n"; };
41    };
42  };
43}