From a17c9c5dcb9c958683ab571ec1261ce459217569 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 23 Sep 2016 15:41:05 +0200 Subject: move scripting to own derivation --- users/gkleen@hel.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/users/gkleen@hel.nix b/users/gkleen@hel.nix index fa4989e2..fb65e343 100644 --- a/users/gkleen@hel.nix +++ b/users/gkleen@hel.nix @@ -10,16 +10,18 @@ ''; }; gnupg = pkgs.lib.overrideDerivation pkgs.gnupg (oldAttrs: { - buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/gpg \ - --run "while ! systemctl --user show-environment | grep -qE '^DISPLAY='; do sleep 1; done" \ - --run "systemctl --user import-environment DISPLAY" - ''; postInstall = '' ln -s $out/bin/gpg2 $out/bin/gpg ''; }); + gnupg-script = with pkgs; writeScript "gnupg-script" '' + #!${stdenv.shell} + + while ! systemctl --user show-environment | grep -qE '^DISPLAY='; do sleep 1; done + + systemctl --user import-environment DISPLAY + exec ${gnupg}/bin/gpg2 --daemon + ''; } // (import ../utils/nix/default.nix) {}; allowUnfree = true; -- cgit v1.2.3