From 2cd168467ea4f9840dde53bd80bfe5affdf7c21c Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 10 Mar 2020 22:28:48 +0000 Subject: [PATCH] keynav: add module PR #1082 --- modules/misc/news.nix | 8 ++++++++ modules/modules.nix | 1 + modules/services/keynav.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 modules/services/keynav.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 9fe4f59a..8495e956 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1407,6 +1407,14 @@ in [1] https://blog.mozilla.org/addons/2019/10/31/firefox-to-discontinue-sideloaded-extensions/ ''; } + + { + time = "2020-03-17T21:56:26+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.keynav'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index bca1e8ed..d46a7d30 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -128,6 +128,7 @@ let (loadModule ./services/kdeconnect.nix { }) (loadModule ./services/keepassx.nix { }) (loadModule ./services/keybase.nix { }) + (loadModule ./services/keynav.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/lieer.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/mbsync.nix { }) diff --git a/modules/services/keynav.nix b/modules/services/keynav.nix new file mode 100644 index 00000000..11cc051c --- /dev/null +++ b/modules/services/keynav.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.keynav; + +in { + options.services.keynav = { enable = mkEnableOption "keynav"; }; + + config = mkIf cfg.enable { + systemd.user.services.keynav = { + Unit = { + Description = "keynav"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = "${cfg.package}/bin/keynav"; + RestartSec = 3; + Restart = "always"; + }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + }; +}