summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/flameshot-once/default.nix
blob: 20c709fb5bd39a763669bf9fcae0641b58006913 (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
with import <stockholm/lib>;
{ pkgs, ... }@args:

let
  # config cannot be declared in the input attribute set because that would
  # cause callPackage to inject the wrong config.  Instead, get it from ...
  # via args.
  config = args.config or {};
in

  pkgs.symlinkJoin {
    name = "flameshot-once-wrapper";
    paths = [
      (pkgs.writeDashBin "flameshot-once" ''
        export PATH=${makeBinPath [
          pkgs.flameshot
          pkgs.qt5.qtbase
          pkgs.xclip
          pkgs.xwaitforwindow
        ]}
        ${optionalString (config != null) /* sh */ ''
          . ${import ./profile.nix { inherit config pkgs; }}
        ''}
        exec ${pkgs.haskellPackages.flameshot-once}/bin/flameshot-once "$@"
      '')
      pkgs.haskellPackages.flameshot-once
    ];
  }