stockholm/krebs/5pkgs/simple/flameshot-once/default.nix
2019-02-09 13:43:27 +01:00

28 lines
756 B
Nix

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
]}
${optionalString (config != null) /* sh */ ''
. ${import ./profile.nix { inherit config pkgs; }}
''}
exec ${pkgs.haskellPackages.flameshot-once}/bin/flameshot-once "$@"
'')
pkgs.haskellPackages.flameshot-once
];
}