From 1b526ec1a597882b7629e992c7579ee109282aa7 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 8 Feb 2019 17:46:32 +0100 Subject: flameshot-once: add config --- krebs/5pkgs/simple/flameshot-once/default.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 krebs/5pkgs/simple/flameshot-once/default.nix (limited to 'krebs/5pkgs/simple/flameshot-once/default.nix') diff --git a/krebs/5pkgs/simple/flameshot-once/default.nix b/krebs/5pkgs/simple/flameshot-once/default.nix new file mode 100644 index 000000000..344c5b90a --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once/default.nix @@ -0,0 +1,26 @@ +with import ; +{ 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 + ]} + ${optionalString (config != null) /* sh */ '' + . ${import ./profile.nix { inherit config pkgs; }} + ''} + exec ${pkgs.haskellPackages.flameshot-once}/bin/flameshot-once "$@" + '') + pkgs.haskellPackages.flameshot-once + ]; + } -- cgit v1.2.3