git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "Merge pull request #71095 from flokli/pinentry-cleanup"
2fbccbcworldofpeace
nixos/doc/manual/release-notes/rl-2003.xml+1−8
@@ -85,14 +85,7 @@
85
85
86 <itemizedlist>
86 <itemizedlist>
87 <listitem>
87 <listitem>
88− <para>
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>
96 </listitem>
89 </listitem>
97 </itemizedlist>
90 </itemizedlist>
98 </section>
91 </section>
nixos/modules/config/no-x-libs.nix+1
@@ -34,6 +34,7 @@ with lib;
34 networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; };
34 networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; };
35 networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
35 networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
36 networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
36 networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
37+ pinentry = super.pinentry.override { gtk2 = null; gcr = null; qt4 = null; qt5 = null; };
37 gobject-introspection = super.gobject-introspection.override { x11Support = false; };
38 gobject-introspection = super.gobject-introspection.override { x11Support = false; };
38 }));
39 }));
39 };
40 };
nixos/modules/installer/tools/tools.nix+1−5
@@ -120,11 +120,7 @@ in
120 # Some programs need SUID wrappers, can be configured further or are
120 # Some programs need SUID wrappers, can be configured further or are
121 # started in user sessions.
121 # started in user sessions.
122 # programs.mtr.enable = true;
122 # programs.mtr.enable = true;
123− # programs.gnupg.agent = {
124− # enable = true;
125− # enableSSHSupport = true;
123+ # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
126− # flavour = "gnome3";
127− # };
128
124
129 # List services that you want to enable:
125 # List services that you want to enable:
130
126
nixos/modules/profiles/installation-device.nix+3
@@ -31,6 +31,9 @@ with lib;
31 # Let the user play Rogue on TTY 8 during the installation.
31 # Let the user play Rogue on TTY 8 during the installation.
32 #services.rogue.enable = true;
32 #services.rogue.enable = true;
33
33
34+ # Disable some other stuff we don't need.
35+ services.udisks2.enable = mkDefault false;
36+
34 # Use less privileged nixos user
37 # Use less privileged nixos user
35 users.users.nixos = {
38 users.users.nixos = {
36 isNormalUser = true;
39 isNormalUser = true;
nixos/modules/programs/gnupg.nix+1−38
@@ -6,19 +6,6 @@ let
6
6
7 cfg = config.programs.gnupg;
7 cfg = config.programs.gnupg;
8
8
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−
22in
9in
23
10
24{
11{
@@ -67,20 +54,6 @@ in
67 '';
54 '';
68 };
55 };
69
56
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−
84 dirmngr.enable = mkOption {
57 dirmngr.enable = mkOption {
85 type = types.bool;
58 type = types.bool;
86 default = false;
59 default = false;
@@ -91,16 +64,6 @@ in
91 };
64 };
92
65
93 config = mkIf cfg.agent.enable {
66 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−
104 systemd.user.sockets.gpg-agent = {
67 systemd.user.sockets.gpg-agent = {
105 wantedBy = [ "sockets.target" ];
68 wantedBy = [ "sockets.target" ];
106 };
69 };
@@ -120,7 +83,7 @@ in
120 systemd.user.sockets.dirmngr = mkIf cfg.dirmngr.enable {
83 systemd.user.sockets.dirmngr = mkIf cfg.dirmngr.enable {
121 wantedBy = [ "sockets.target" ];
84 wantedBy = [ "sockets.target" ];
122 };
85 };
123−
86+
124 environment.systemPackages = with pkgs; [ cfg.package ];
87 environment.systemPackages = with pkgs; [ cfg.package ];
125 systemd.packages = [ cfg.package ];
88 systemd.packages = [ cfg.package ];
126
89
nixos/modules/services/hardware/udisks2.nix+4−1
@@ -34,7 +34,10 @@ with lib;
34
34
35 services.dbus.packages = [ pkgs.udisks2 ];
35 services.dbus.packages = [ pkgs.udisks2 ];
36
36
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+ '';
38
41
39 services.udev.packages = [ pkgs.udisks2 ];
42 services.udev.packages = [ pkgs.udisks2 ];
40
43
nixos/tests/installer.nix+4
@@ -54,6 +54,8 @@ let
54
54
55 hardware.enableAllFirmware = lib.mkForce false;
55 hardware.enableAllFirmware = lib.mkForce false;
56
56
57+ services.udisks2.enable = lib.mkDefault false;
58+
57 ${replaceChars ["\n"] ["\n "] extraConfig}
59 ${replaceChars ["\n"] ["\n "] extraConfig}
58 }
60 }
59 '';
61 '';
@@ -293,6 +295,8 @@ let
293 ++ optional (bootLoader == "grub" && grubVersion == 1) pkgs.grub
295 ++ optional (bootLoader == "grub" && grubVersion == 1) pkgs.grub
294 ++ optionals (bootLoader == "grub" && grubVersion == 2) [ pkgs.grub2 pkgs.grub2_efi ];
296 ++ optionals (bootLoader == "grub" && grubVersion == 2) [ pkgs.grub2 pkgs.grub2_efi ];
295
297
298+ services.udisks2.enable = mkDefault false;
299+
296 nix.binaryCaches = mkForce [ ];
300 nix.binaryCaches = mkForce [ ];
297 nix.extraOptions =
301 nix.extraOptions =
298 ''
302 ''
nixos/tests/os-prober.nix+2−1
@@ -51,11 +51,12 @@ let
51 hashed-mirrors =
51 hashed-mirrors =
52 connect-timeout = 1
52 connect-timeout = 1
53 '';
53 '';
54+ services.udisks2.enable = lib.mkForce false;
54 };
55 };
55 # /etc/nixos/configuration.nix for the vm
56 # /etc/nixos/configuration.nix for the vm
56 configFile = pkgs.writeText "configuration.nix" ''
57 configFile = pkgs.writeText "configuration.nix" ''
57 {config, pkgs, ...}: ({
58 {config, pkgs, ...}: ({
58− imports =
59+ imports =
59 [ ./hardware-configuration.nix
60 [ ./hardware-configuration.nix
60 <nixpkgs/nixos/modules/testing/test-instrumentation.nix>
61 <nixpkgs/nixos/modules/testing/test-instrumentation.nix>
61 ];
62 ];
pkgs/development/libraries/gcr/default.nix+5−1
@@ -24,7 +24,11 @@ stdenv.mkDerivation rec {
24
24
25 nativeBuildInputs = [ pkgconfig gettext gobject-introspection libxslt makeWrapper vala ];
25 nativeBuildInputs = [ pkgconfig gettext gobject-introspection libxslt makeWrapper vala ];
26
26
27+ buildInputs = let
28+ gpg = gnupg.override { guiSupport = false; }; # prevent build cycle with pinentry_gnome
29+ in [
27− buildInputs = [ gnupg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk ];
30+ gpg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk
31+ ];
28
32
29 propagatedBuildInputs = [ glib gtk3 p11-kit ];
33 propagatedBuildInputs = [ glib gtk3 p11-kit ];
30
34
pkgs/tools/security/gnupg/20.nix+1−1
@@ -3,7 +3,7 @@
3
3
4# Each of the dependencies below are optional.
4# Each of the dependencies below are optional.
5# Gnupg can be built without them at the cost of reduced functionality.
5# Gnupg can be built without them at the cost of reduced functionality.
6−, pinentry ? null, guiSupport ? false
6+, pinentry ? null, guiSupport ? true
7, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
7, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
8}:
8}:
9
9
pkgs/tools/security/gnupg/22.nix+1−1
@@ -4,7 +4,7 @@
4
4
5# Each of the dependencies below are optional.
5# Each of the dependencies below are optional.
6# Gnupg can be built without them at the cost of reduced functionality.
6# Gnupg can be built without them at the cost of reduced functionality.
7−, pinentry ? null, guiSupport ? false
7+, pinentry ? null, guiSupport ? true
8, adns ? null, gnutls ? null, libusb ? null, openldap ? null
8, adns ? null, gnutls ? null, libusb ? null, openldap ? null
9, readline ? null, zlib ? null, bzip2 ? null
9, readline ? null, zlib ? null, bzip2 ? null
10}:
10}:
pkgs/tools/security/kwalletcli/default.nix+2−2
@@ -1,5 +1,5 @@
1{ mkDerivation, fetchFromGitHub, lib, makeWrapper, pkgconfig
1{ mkDerivation, fetchFromGitHub, lib, makeWrapper, pkgconfig
2−, kcoreaddons, ki18n, kwallet, mksh, pinentry-qt }:
2+, kcoreaddons, ki18n, kwallet, mksh, pinentry_qt5 }:
3
3
4mkDerivation rec {
4mkDerivation rec {
5 pname = "kwalletcli";
5 pname = "kwalletcli";
@@ -36,7 +36,7 @@ mkDerivation rec {
36
36
37 postInstall = ''
37 postInstall = ''
38 wrapProgram $out/bin/pinentry-kwallet \
38 wrapProgram $out/bin/pinentry-kwallet \
39− --prefix PATH : $out/bin:${lib.makeBinPath [ pinentry-qt ]} \
39+ --prefix PATH : $out/bin:${lib.makeBinPath [ pinentry_qt5 ]} \
40 --set-default PINENTRY pinentry-qt
40 --set-default PINENTRY pinentry-qt
41 '';
41 '';
42
42
pkgs/tools/security/pinentry/default.nix+36−69
@@ -1,93 +1,60 @@
1−{ fetchurl, mkDerivation, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook, wrapGAppsHook
1+{ fetchurl, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook
2−, libgpgerror, libassuan, qtbase, wrapQtAppsHook
2+, libgpgerror, libassuan
3−, ncurses, gtk2, gcr
4−, libcap ? null, libsecret ? null
3+, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null
5−, enabledFlavors ? [ "curses" "tty" "gtk2" "qt" "gnome3" "emacs" ]
4+, qt4 ? null, qt5 ? null
5+, enableEmacs ? false
6}:
6}:
7
7
8−with stdenv.lib;
8+assert qt5 != null -> qt4 == null;
9−
9+assert qt4 != null -> qt5 == null;
10−assert isList enabledFlavors && enabledFlavors != [];
11
10
12let
11let
13− pinentryMkDerivation =
12+ mkDerivation =
14− if (builtins.elem "qt" enabledFlavors)
13+ if qt5 != null
15− then mkDerivation
14+ then qt5.mkDerivation
16 else stdenv.mkDerivation;
15 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−
40in
16in
41
17
42−pinentryMkDerivation rec {
18+mkDerivation rec {
43− pname = "pinentry";
19+ name = "pinentry-1.1.0";
44− version = "1.1.0";
45
20
46 src = fetchurl {
21 src = fetchurl {
47− url = "mirror://gnupg/pinentry/${pname}-${version}.tar.bz2";
22+ url = "mirror://gnupg/pinentry/${name}.tar.bz2";
48 sha256 = "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8";
23 sha256 = "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8";
49 };
24 };
50
25
51− nativeBuildInputs = [ pkgconfig autoreconfHook ]
26+ nativeBuildInputs = [ pkgconfig autoreconfHook ];
52− ++ concatMap(f: flavorInfo.${f}.nativeBuildInputs or []) enabledFlavors;
27+ buildInputs =
53− buildInputs = [ libgpgerror libassuan libcap libsecret ]
28+ [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt4 ]
54− ++ concatMap(f: flavorInfo.${f}.buildInputs or []) enabledFlavors;
29+ ++ stdenv.lib.optional (qt5 != null) qt5.qtbase;
55
30
56− dontWrapGApps = true;
31+ prePatch = ''
57− dontWrapQtApps = true;
32+ substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses
33+ '';
58
34
59 patches = [
35 patches = [
60 ./autoconf-ar.patch
36 ./autoconf-ar.patch
61− ] ++ optionals (elem "gtk2" enabledFlavors) [
37+ ] ++ lib.optionals (gtk2 != null) [
62 (fetchpatch {
38 (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";
64 sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd";
41 sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd";
65 })
42 })
66 ];
43 ];
67
44
68 configureFlags = [
45 configureFlags = [
69− (mkWith (libcap != null) "libcap")
46+ (stdenv.lib.withFeature (libcap != null) "libcap")
70− (mkEnable (libsecret != null) "libsecret")
47+ (stdenv.lib.enableFeature (libsecret != null) "libsecret")
71− ] ++ (map mkEnablePinentry (attrNames flavorInfo));
48+ (stdenv.lib.enableFeature (ncurses != null) "pinentry-curses")
72−
49+ (stdenv.lib.enableFeature true "pinentry-tty")
73− postInstall =
50+ (stdenv.lib.enableFeature enableEmacs "pinentry-emacs")
74− concatStrings (flip map enabledFlavors (f:
51+ (stdenv.lib.enableFeature (gtk2 != null) "pinentry-gtk2")
75− let
52+ (stdenv.lib.enableFeature (gcr != null) "pinentry-gnome3")
76− binary = "pinentry-" + flavorInfo.${f}.bin;
53+ (stdenv.lib.enableFeature (qt4 != null || qt5 != null) "pinentry-qt")
77− in ''
54+
78− moveToOutput bin/${binary} ${placeholder f}
55+ "--with-libassuan-prefix=${libassuan.dev}"
79− ln -sf ${placeholder f}/bin/${binary} ${placeholder f}/bin/pinentry
56+ "--with-libgpg-error-prefix=${libgpgerror.dev}"
80− '' + optionalString (f == "gnome3") ''
57+ ];
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; };
91
58
92 meta = with stdenv.lib; {
59 meta = with stdenv.lib; {
93 homepage = http://gnupg.org/aegypten2/;
60 homepage = http://gnupg.org/aegypten2/;
@@ -98,6 +65,6 @@ pinentryMkDerivation rec {
98 Pinentry provides a console and (optional) GTK and Qt GUIs allowing users
65 Pinentry provides a console and (optional) GTK and Qt GUIs allowing users
99 to enter a passphrase when `gpg' or `gpg2' is run and needs it.
66 to enter a passphrase when `gpg' or `gpg2' is run and needs it.
100 '';
67 '';
101− maintainers = with maintainers; [ ttuegel fpletz ];
68+ maintainers = [ maintainers.ttuegel ];
102 };
69 };
103}
70}
pkgs/top-level/aliases.nix−5
@@ -290,11 +290,6 @@ mapAliases ({
290 pg_hll = postgresqlPackages.pg_hll;
290 pg_hll = postgresqlPackages.pg_hll;
291 pg_cron = postgresqlPackages.pg_cron;
291 pg_cron = postgresqlPackages.pg_cron;
292 pg_topn = postgresqlPackages.pg_topn;
292 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
298 postgis = postgresqlPackages.postgis;
293 postgis = postgresqlPackages.postgis;
299 # end
294 # end
300 ppl-address-book = throw "deprecated in 2019-05-02: abandoned by upstream.";
295 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
3497 gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { };
3497 gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { };
3498 gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1
3498 gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1
3499 gnupg20 = callPackage ../tools/security/gnupg/20.nix {
3499 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;
3502 };
3501 };
3503 gnupg22 = callPackage ../tools/security/gnupg/22.nix {
3502 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;
3506 };
3504 };
3507 gnupg = gnupg22;
3505 gnupg = gnupg22;
3508
3506
@@ -5521,15 +5519,34 @@ in
5521
5519
5522 phodav = callPackage ../tools/networking/phodav { };
5520 phodav = callPackage ../tools/networking/phodav { };
5523
5521
5524− pinentry = libsForQt5.callPackage ../tools/security/pinentry {
5522+ pinentry = callPackage ../tools/security/pinentry {
5525 libcap = if stdenv.isDarwin then null else libcap;
5523 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;
5526 };
5531 };
5527
5532
5528− pinentry-curses = (stdenv.lib.getOutput "curses" pinentry);
5533+ pinentry_emacs = res.pinentry.override {
5529− pinentry-emacs = (stdenv.lib.getOutput "emacs" pinentry);
5534+ enableEmacs = true;
5530− pinentry-gtk2 = (stdenv.lib.getOutput "gtk2" pinentry);
5535+ };
5531− pinentry-qt = (stdenv.lib.getOutput "qt" pinentry);
5536+
5532− pinentry-gnome = (stdenv.lib.getOutput "gnome" pinentry);
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+ };
5533
5550
5534 pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {
5551 pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {
5535 inherit (darwin.apple_sdk.frameworks) Cocoa;
5552 inherit (darwin.apple_sdk.frameworks) Cocoa;