From 41101d0e62fe3cdb76e8e64349a2650da1433dd4 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 20 Jul 2021 22:17:27 -0600 Subject: [PATCH] volnoti: add module (#2183) --- .github/CODEOWNERS | 4 +++- modules/misc/news.nix | 8 ++++++++ modules/modules.nix | 1 + modules/services/volnoti.nix | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 modules/services/volnoti.nix diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 91760b703..ef3c2d674 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,7 +4,7 @@ /modules/home-environment.nix @rycee -/modules/i18n/input-method @Kranzes +/modules/i18n/input-method @Kranzes /tests/modules/i18n/input-method @Kranzes /modules/misc/dconf.nix @gnidorah @rycee @@ -339,3 +339,5 @@ /modules/xresources.nix @rycee /modules/xsession.nix @rycee + +/modules/services/volnoti.nix @IvanMalison diff --git a/modules/misc/news.nix b/modules/misc/news.nix index c55483796..02286d2f3 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -2133,6 +2133,14 @@ in A new module is available: 'services.xsettingsd'. ''; } + + { + time = "2021-07-14T20:06:18+00:00"; + message = '' + A new module is available: 'services.volnoti'. + ''; + } + ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 2f16ae801..e92cc6fdc 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -211,6 +211,7 @@ let ./services/udiskie.nix ./services/unclutter.nix ./services/unison.nix + ./services/volnoti.nix ./services/window-managers/awesome.nix ./services/window-managers/bspwm/default.nix ./services/window-managers/i3-sway/i3.nix diff --git a/modules/services/volnoti.nix b/modules/services/volnoti.nix new file mode 100644 index 000000000..c788a5db3 --- /dev/null +++ b/modules/services/volnoti.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.volnoti; + +in { + meta.maintainers = [ maintainers.imalison ]; + + options = { + services.volnoti = { enable = mkEnableOption "Volnoti volume HUD daemon"; }; + + package = mkOption { + type = types.package; + default = pkgs.volnoti; + defaultText = literalExample "pkgs.volnoti"; + description = '' + Package containing the volnoti program. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + systemd.user.services.volnoti = { + Unit = { Description = "volnoti"; }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + + Service = { ExecStart = "${pkgs.volnoti}/bin/volnoti -v -n"; }; + }; + }; +}