aboutsummaryrefslogtreecommitdiff
path: root/modules/home/apps/flameshot/default.nix
blob: 9a916048a90b54179a6423eee3b51e726faa0357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ options, config, lib, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.apps.flameshot;
  desktop = config.${namespace}.desktop;
in {
  options.${namespace}.apps.flameshot = with types; {
    enable = mkEnableOption "flameshot";
  };

  config = mkIf cfg.enable {
    services.flameshot = {
      enable = true;

      settings = let c = desktop.theme.colors; in {
        General = {
          savePath = "Pictures/Screenshots";
          filenamePattern = "%F_%T";

          saveAfterCopy = true;

          uiColor = "#${c.bg}";
          contrastUiColor = "#${c.accent}";

          startupLaunch = false;
        };
      };
    };

    #TODO: relocate. target.tray required for flameshot
    systemd.user.targets.tray = {
      Unit = {
        Description = "Home Manager System Tray";
        Requires = [ "graphical-session-pre.target" ];
      };
    };
  };
}