git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "Merge pull request #71095 from flokli/pinentry-cleanup"

This reverts commit 823da4d492b8b4ad46bf812db8421d99ff17a8fc, reversing changes made to b75c8ee3bc1b9734c29740e9d17ac2175fe207fd.

commit2fbccbc7288a72bea649d035cdb7a772d10baf3a authorworldofpeace <worldofpeace@protonmail.ch> dateWed 16 Oct 2019, 20:28 (7 years ago) parent823da4d
15 files changed+89−142
nixos/doc/manual/release-notes/rl-2003.xml+1−8 nixos/modules/config/no-x-libs.nix+1 nixos/modules/installer/tools/tools.nix+1−5 nixos/modules/profiles/installation-device.nix+3 nixos/modules/programs/gnupg.nix+1−38 nixos/modules/services/hardware/udisks2.nix+4−1 nixos/tests/installer.nix+4 nixos/tests/os-prober.nix+2−1 pkgs/development/libraries/gcr/default.nix+5−1 pkgs/tools/security/gnupg/20.nix+1−1 pkgs/tools/security/gnupg/22.nix+1−1 pkgs/tools/security/kwalletcli/default.nix+2−2 pkgs/tools/security/pinentry/default.nix+36−69 pkgs/top-level/aliases.nix−5 pkgs/top-level/all-packages.nix+27−10
nixos/doc/manual/release-notes/rl-2003.xml+1−8
@@ -85,14 +85,7 @@
8585
8686 <itemizedlist>
8787 <listitem>
88− <para>
89− GnuPG is now built without support for a graphical passphrase entry
90− by default. Please enable the <literal>gpg-agent</literal> user service
91− via the NixOS option <literal>programs.gnupg.agent.enable</literal>.
92− Note that upstream recommends using <literal>gpg-agent</literal> and
93− will spawn a <literal>gpg-agent</literal> on the first invocation of
94− GnuPG anyway.
95− </para>
88+ <para />
9689 </listitem>
9790 </itemizedlist>
9891 </section>
nixos/modules/config/no-x-libs.nix+1
@@ -34,6 +34,7 @@ with lib;
3434 networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; };
3535 networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
3636 networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
37+ pinentry = super.pinentry.override { gtk2 = null; gcr = null; qt4 = null; qt5 = null; };
3738 gobject-introspection = super.gobject-introspection.override { x11Support = false; };
3839 }));
3940 };
nixos/modules/installer/tools/tools.nix+1−5
@@ -120,11 +120,7 @@ in
120120 # Some programs need SUID wrappers, can be configured further or are
121121 # started in user sessions.
122122 # programs.mtr.enable = true;
123− # programs.gnupg.agent = {
124− # enable = true;
125− # enableSSHSupport = true;
126− # flavour = "gnome3";
127− # };
123+ # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
128124
129125 # List services that you want to enable:
130126
nixos/modules/profiles/installation-device.nix+3
@@ -31,6 +31,9 @@ with lib;
3131 # Let the user play Rogue on TTY 8 during the installation.
3232 #services.rogue.enable = true;
3333
34+ # Disable some other stuff we don't need.
35+ services.udisks2.enable = mkDefault false;
36+
3437 # Use less privileged nixos user
3538 users.users.nixos = {
3639 isNormalUser = true;
nixos/modules/programs/gnupg.nix+1−38
@@ -6,19 +6,6 @@ let
66
77 cfg = config.programs.gnupg;
88
9− xserverCfg = config.services.xserver;
10−
11− defaultPinentryFlavor =
12− if xserverCfg.desktopManager.lxqt.enable
13− || xserverCfg.desktopManager.plasma5.enable then
14− "qt"
15− else if xserverCfg.desktopManager.xfce.enable then
16− "gtk2"
17− else if xserverCfg.enable then
18− "gnome3"
19− else
20− null;
21−
229in
2310
2411{
@@ -67,20 +54,6 @@ in
6754 '';
6855 };
6956
70− agent.pinentryFlavor = mkOption {
71− type = types.nullOr (types.enum pkgs.pinentry.flavors);
72− example = "gnome3";
73− description = ''
74− Which pinentry interface to use. If not null, the path to the
75− pinentry binary will be passed to gpg-agent via commandline and
76− thus overrides the pinentry option in gpg-agent.conf in the user's
77− home directory.
78− If not set at all, it'll pick an appropriate flavor depending on the
79− system configuration (qt flavor for lxqt and plasma5, gtk2 for xfce
80− 4.12, gnome3 on all other systems with X enabled, ncurses otherwise).
81− '';
82− };
83−
8457 dirmngr.enable = mkOption {
8558 type = types.bool;
8659 default = false;
@@ -91,16 +64,6 @@ in
9164 };
9265
9366 config = mkIf cfg.agent.enable {
94− programs.gnupg.agent.pinentryFlavor = mkDefault defaultPinentryFlavor;
95−
96− # This overrides the systemd user unit shipped with the gnupg package
97− systemd.user.services.gpg-agent = mkIf (cfg.agent.pinentryFlavor != null) {
98− serviceConfig.ExecStart = [ "" ''
99− ${pkgs.gnupg}/bin/gpg-agent --supervised \
100− --pinentry-program ${pkgs.pinentry.${cfg.agent.pinentryFlavor}}/bin/pinentry
101− '' ];
102− };
103−
10467 systemd.user.sockets.gpg-agent = {
10568 wantedBy = [ "sockets.target" ];
10669 };
@@ -120,7 +83,7 @@ in
12083 systemd.user.sockets.dirmngr = mkIf cfg.dirmngr.enable {
12184 wantedBy = [ "sockets.target" ];
12285 };
123−
86+
12487 environment.systemPackages = with pkgs; [ cfg.package ];
12588 systemd.packages = [ cfg.package ];
12689
nixos/modules/services/hardware/udisks2.nix+4−1
@@ -34,7 +34,10 @@ with lib;
3434
3535 services.dbus.packages = [ pkgs.udisks2 ];
3636
37− systemd.tmpfiles.rules = [ "d /var/lib/udisks2 0755 root root -" ];
37+ system.activationScripts.udisks2 =
38+ ''
39+ mkdir -m 0755 -p /var/lib/udisks2
40+ '';
3841
3942 services.udev.packages = [ pkgs.udisks2 ];
4043
nixos/tests/installer.nix+4
@@ -54,6 +54,8 @@ let
5454
5555 hardware.enableAllFirmware = lib.mkForce false;
5656
57+ services.udisks2.enable = lib.mkDefault false;
58+
5759 ${replaceChars ["\n"] ["\n "] extraConfig}
5860 }
5961 '';
@@ -293,6 +295,8 @@ let
293295 ++ optional (bootLoader == "grub" && grubVersion == 1) pkgs.grub
294296 ++ optionals (bootLoader == "grub" && grubVersion == 2) [ pkgs.grub2 pkgs.grub2_efi ];
295297
298+ services.udisks2.enable = mkDefault false;
299+
296300 nix.binaryCaches = mkForce [ ];
297301 nix.extraOptions =
298302 ''
nixos/tests/os-prober.nix+2−1
@@ -51,11 +51,12 @@ let
5151 hashed-mirrors =
5252 connect-timeout = 1
5353 '';
54+ services.udisks2.enable = lib.mkForce false;
5455 };
5556 # /etc/nixos/configuration.nix for the vm
5657 configFile = pkgs.writeText "configuration.nix" ''
5758 {config, pkgs, ...}: ({
58− imports =
59+ imports =
5960 [ ./hardware-configuration.nix
6061 <nixpkgs/nixos/modules/testing/test-instrumentation.nix>
6162 ];
pkgs/development/libraries/gcr/default.nix+5−1
@@ -24,7 +24,11 @@ stdenv.mkDerivation rec {
2424
2525 nativeBuildInputs = [ pkgconfig gettext gobject-introspection libxslt makeWrapper vala ];
2626
27− buildInputs = [ gnupg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk ];
27+ buildInputs = let
28+ gpg = gnupg.override { guiSupport = false; }; # prevent build cycle with pinentry_gnome
29+ in [
30+ gpg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk
31+ ];
2832
2933 propagatedBuildInputs = [ glib gtk3 p11-kit ];
3034
pkgs/tools/security/gnupg/20.nix+1−1
@@ -3,7 +3,7 @@
33
44# Each of the dependencies below are optional.
55# Gnupg can be built without them at the cost of reduced functionality.
6−, pinentry ? null, guiSupport ? false
6+, pinentry ? null, guiSupport ? true
77, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
88}:
99
pkgs/tools/security/gnupg/22.nix+1−1
@@ -4,7 +4,7 @@
44
55# Each of the dependencies below are optional.
66# Gnupg can be built without them at the cost of reduced functionality.
7−, pinentry ? null, guiSupport ? false
7+, pinentry ? null, guiSupport ? true
88, adns ? null, gnutls ? null, libusb ? null, openldap ? null
99, readline ? null, zlib ? null, bzip2 ? null
1010}:
pkgs/tools/security/kwalletcli/default.nix+2−2
@@ -1,5 +1,5 @@
11{ mkDerivation, fetchFromGitHub, lib, makeWrapper, pkgconfig
2−, kcoreaddons, ki18n, kwallet, mksh, pinentry-qt }:
2+, kcoreaddons, ki18n, kwallet, mksh, pinentry_qt5 }:
33
44mkDerivation rec {
55 pname = "kwalletcli";
@@ -36,7 +36,7 @@ mkDerivation rec {
3636
3737 postInstall = ''
3838 wrapProgram $out/bin/pinentry-kwallet \
39− --prefix PATH : $out/bin:${lib.makeBinPath [ pinentry-qt ]} \
39+ --prefix PATH : $out/bin:${lib.makeBinPath [ pinentry_qt5 ]} \
4040 --set-default PINENTRY pinentry-qt
4141 '';
4242
pkgs/tools/security/pinentry/default.nix+36−69
@@ -1,93 +1,60 @@
1−{ fetchurl, mkDerivation, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook, wrapGAppsHook
2−, libgpgerror, libassuan, qtbase, wrapQtAppsHook
3−, ncurses, gtk2, gcr
4−, libcap ? null, libsecret ? null
5−, enabledFlavors ? [ "curses" "tty" "gtk2" "qt" "gnome3" "emacs" ]
1+{ fetchurl, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook
2+, libgpgerror, libassuan
3+, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null
4+, qt4 ? null, qt5 ? null
5+, enableEmacs ? false
66}:
77
8−with stdenv.lib;
9−
10−assert isList enabledFlavors && enabledFlavors != [];
8+assert qt5 != null -> qt4 == null;
9+assert qt4 != null -> qt5 == null;
1110
1211let
13− pinentryMkDerivation =
14− if (builtins.elem "qt" enabledFlavors)
15− then mkDerivation
12+ mkDerivation =
13+ if qt5 != null
14+ then qt5.mkDerivation
1615 else stdenv.mkDerivation;
17−
18− mkFlag = pfxTrue: pfxFalse: cond: name:
19− "--${if cond then pfxTrue else pfxFalse}-${name}";
20− mkEnable = mkFlag "enable" "disable";
21− mkWith = mkFlag "with" "without";
22−
23− mkEnablePinentry = f:
24− let
25− info = flavorInfo.${f};
26− flag = flavorInfo.${f}.flag or null;
27− in
28− optionalString (flag != null)
29− (mkEnable (elem f enabledFlavors) ("pinentry-" + flag));
30−
31− flavorInfo = {
32− curses = { bin = "curses"; flag = "curses"; buildInputs = [ ncurses ]; };
33− tty = { bin = "tty"; flag = "tty"; };
34− gtk2 = { bin = "gtk-2"; flag = "gtk2"; buildInputs = [ gtk2 ]; };
35− gnome3 = { bin = "gnome3"; flag = "gnome3"; buildInputs = [ gcr ]; nativeBuildInputs = [ wrapGAppsHook ]; };
36− qt = { bin = "qt"; flag = "qt"; buildInputs = [ qtbase ]; nativeBuildInputs = [ wrapQtAppsHook ]; };
37− emacs = { bin = "emacs"; flag = "emacs"; buildInputs = []; };
38− };
39−
4016in
4117
42−pinentryMkDerivation rec {
43− pname = "pinentry";
44− version = "1.1.0";
18+mkDerivation rec {
19+ name = "pinentry-1.1.0";
4520
4621 src = fetchurl {
47− url = "mirror://gnupg/pinentry/${pname}-${version}.tar.bz2";
22+ url = "mirror://gnupg/pinentry/${name}.tar.bz2";
4823 sha256 = "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8";
4924 };
5025
51− nativeBuildInputs = [ pkgconfig autoreconfHook ]
52− ++ concatMap(f: flavorInfo.${f}.nativeBuildInputs or []) enabledFlavors;
53− buildInputs = [ libgpgerror libassuan libcap libsecret ]
54− ++ concatMap(f: flavorInfo.${f}.buildInputs or []) enabledFlavors;
26+ nativeBuildInputs = [ pkgconfig autoreconfHook ];
27+ buildInputs =
28+ [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt4 ]
29+ ++ stdenv.lib.optional (qt5 != null) qt5.qtbase;
5530
56− dontWrapGApps = true;
57− dontWrapQtApps = true;
31+ prePatch = ''
32+ substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses
33+ '';
5834
5935 patches = [
6036 ./autoconf-ar.patch
61− ] ++ optionals (elem "gtk2" enabledFlavors) [
37+ ] ++ lib.optionals (gtk2 != null) [
6238 (fetchpatch {
63− url = "https://salsa.debian.org/debian/pinentry/raw/debian/1.1.0-1/debian/patches/0007-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch";
39+ url = "https://salsa.debian.org/debian/pinentry/raw/debian/1.1.0-1/debian/patches/"
40+ + "0007-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch";
6441 sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd";
6542 })
6643 ];
6744
6845 configureFlags = [
69− (mkWith (libcap != null) "libcap")
70− (mkEnable (libsecret != null) "libsecret")
71− ] ++ (map mkEnablePinentry (attrNames flavorInfo));
72−
73− postInstall =
74− concatStrings (flip map enabledFlavors (f:
75− let
76− binary = "pinentry-" + flavorInfo.${f}.bin;
77− in ''
78− moveToOutput bin/${binary} ${placeholder f}
79− ln -sf ${placeholder f}/bin/${binary} ${placeholder f}/bin/pinentry
80− '' + optionalString (f == "gnome3") ''
81− wrapGApp ${placeholder f}/bin/${binary}
82− '' + optionalString (f == "qt") ''
83− wrapQtApp ${placeholder f}/bin/${binary}
84− '')) + ''
85− ln -sf ${placeholder (head enabledFlavors)}/bin/pinentry-${flavorInfo.${head enabledFlavors}.bin} $out/bin/pinentry
86− '';
87−
88− outputs = [ "out" ] ++ enabledFlavors;
89−
90− passthru = { flavors = enabledFlavors; };
46+ (stdenv.lib.withFeature (libcap != null) "libcap")
47+ (stdenv.lib.enableFeature (libsecret != null) "libsecret")
48+ (stdenv.lib.enableFeature (ncurses != null) "pinentry-curses")
49+ (stdenv.lib.enableFeature true "pinentry-tty")
50+ (stdenv.lib.enableFeature enableEmacs "pinentry-emacs")
51+ (stdenv.lib.enableFeature (gtk2 != null) "pinentry-gtk2")
52+ (stdenv.lib.enableFeature (gcr != null) "pinentry-gnome3")
53+ (stdenv.lib.enableFeature (qt4 != null || qt5 != null) "pinentry-qt")
54+
55+ "--with-libassuan-prefix=${libassuan.dev}"
56+ "--with-libgpg-error-prefix=${libgpgerror.dev}"
57+ ];
9158
9259 meta = with stdenv.lib; {
9360 homepage = http://gnupg.org/aegypten2/;
@@ -98,6 +65,6 @@ pinentryMkDerivation rec {
9865 Pinentry provides a console and (optional) GTK and Qt GUIs allowing users
9966 to enter a passphrase when `gpg' or `gpg2' is run and needs it.
10067 '';
101− maintainers = with maintainers; [ ttuegel fpletz ];
68+ maintainers = [ maintainers.ttuegel ];
10269 };
10370}
pkgs/top-level/aliases.nix−5
@@ -290,11 +290,6 @@ mapAliases ({
290290 pg_hll = postgresqlPackages.pg_hll;
291291 pg_cron = postgresqlPackages.pg_cron;
292292 pg_topn = postgresqlPackages.pg_topn;
293− pinentry_curses = pinentry-curses; # added 2019-10-14
294− pinentry_emacs = pinentry-emacs; # added 2019-10-14
295− pinentry_gtk2 = pinentry-gtk2; # added 2019-10-14
296− pinentry_qt = pinentry-qt; # added 2019-10-14
297− pinentry_gnome = pinentry-gnome; # added 2019-10-14
298293 postgis = postgresqlPackages.postgis;
299294 # end
300295 ppl-address-book = throw "deprecated in 2019-05-02: abandoned by upstream.";
pkgs/top-level/all-packages.nix+27−10
@@ -3497,12 +3497,10 @@ in
34973497 gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { };
34983498 gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1
34993499 gnupg20 = callPackage ../tools/security/gnupg/20.nix {
3500− guiSupport = stdenv.isDarwin;
3501− pinentry = if stdenv.isDarwin then pinentry_mac else pinentry_gtk2;
3500+ pinentry = if stdenv.isDarwin then pinentry_mac else pinentry;
35023501 };
35033502 gnupg22 = callPackage ../tools/security/gnupg/22.nix {
3504− guiSupport = stdenv.isDarwin;
3505− pinentry = if stdenv.isDarwin then pinentry_mac else pinentry_gtk2;
3503+ pinentry = if stdenv.isDarwin then pinentry_mac else pinentry;
35063504 };
35073505 gnupg = gnupg22;
35083506
@@ -5521,15 +5519,34 @@ in
55215519
55225520 phodav = callPackage ../tools/networking/phodav { };
55235521
5524− pinentry = libsForQt5.callPackage ../tools/security/pinentry {
5522+ pinentry = callPackage ../tools/security/pinentry {
55255523 libcap = if stdenv.isDarwin then null else libcap;
5524+ gcr = null;
5525+ qt4 = null;
5526+ qt5 = null;
5527+ };
5528+
5529+ pinentry_ncurses = res.pinentry.override {
5530+ gtk2 = null;
55265531 };
55275532
5528− pinentry-curses = (stdenv.lib.getOutput "curses" pinentry);
5529− pinentry-emacs = (stdenv.lib.getOutput "emacs" pinentry);
5530− pinentry-gtk2 = (stdenv.lib.getOutput "gtk2" pinentry);
5531− pinentry-qt = (stdenv.lib.getOutput "qt" pinentry);
5532− pinentry-gnome = (stdenv.lib.getOutput "gnome" pinentry);
5533+ pinentry_emacs = res.pinentry.override {
5534+ enableEmacs = true;
5535+ };
5536+
5537+ pinentry_gnome = res.pinentry.override {
5538+ inherit gcr;
5539+ };
5540+
5541+ pinentry_qt4 = res.pinentry.override {
5542+ gtk2 = null;
5543+ inherit qt4;
5544+ };
5545+
5546+ pinentry_qt5 = res.pinentry.override {
5547+ gtk2 = null;
5548+ inherit qt5;
5549+ };
55335550
55345551 pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {
55355552 inherit (darwin.apple_sdk.frameworks) Cocoa;