From e055e4a092e0920cc2f8dc7f6b665bf6dbba6a4b Mon Sep 17 00:00:00 2001 From: Hamish Hutchings Date: Thu, 3 May 2018 14:29:03 +0200 Subject: [PATCH] flameshot: add module --- modules/misc/news.nix | 6 +++++ modules/modules.nix | 1 + modules/services/flameshot.nix | 41 ++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 modules/services/flameshot.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 1ece1114..99a7cb3e 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -641,6 +641,12 @@ in A new module is available: 'services.mbsync'. ''; } + { + time = "2018-05-03T12:34:47+00:00"; + message = '' + A new module is available: 'services.flameshot'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 897fd6a1..b36ad4f4 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -51,6 +51,7 @@ let ./services/blueman-applet.nix ./services/compton.nix ./services/dunst.nix + ./services/flameshot.nix ./services/gnome-keyring.nix ./services/gpg-agent.nix ./services/kbfs.nix diff --git a/modules/services/flameshot.nix b/modules/services/flameshot.nix new file mode 100644 index 00000000..d5e8309d --- /dev/null +++ b/modules/services/flameshot.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.flameshot; + package = pkgs.flameshot; + +in + +{ + meta.maintainers = [ maintainers.hamhut1066 ]; + + options = { + services.flameshot = { + enable = mkEnableOption "Flameshot"; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ package ]; + + systemd.user.services.flameshot = { + Unit = { + Description = "Powerful yet simple to use screenshot software"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = "${package}/bin/flameshot"; + Restart = "on-abort"; + }; + }; + }; +}