tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
pass: refactor extension packaging
Tad Fisher
7 years ago
0c2a7fa4
c68dc221
+201
-88
8 changed files
expand all
collapse all
unified
split
pkgs
tools
security
pass
default.nix
extensions
default.nix
import.nix
otp.nix
tomb.nix
update.nix
top-level
aliases.nix
all-packages.nix
+6
-5
pkgs/tools/security/pass-otp/default.nix
pkgs/tools/security/pass/extensions/otp.nix
···
1
-
{ stdenv, pass, fetchFromGitHub, oathToolkit }:
0
2
stdenv.mkDerivation rec {
3
name = "pass-otp-${version}";
4
version = "1.1.0";
···
10
sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb";
11
};
12
13
-
buildInputs = [ pass oathToolkit ];
0
0
14
15
patchPhase = ''
16
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
17
'';
18
19
-
installPhase = ''
20
-
make PREFIX=$out install
21
-
'';
22
23
meta = with stdenv.lib; {
24
description = "A pass extension for managing one-time-password (OTP) tokens";
···
1
+
{ stdenv, fetchFromGitHub, oathToolkit }:
2
+
3
stdenv.mkDerivation rec {
4
name = "pass-otp-${version}";
5
version = "1.1.0";
···
11
sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb";
12
};
13
14
+
buildInputs = [ oathToolkit ];
15
+
16
+
dontBuild = true;
17
18
patchPhase = ''
19
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
20
'';
21
22
+
installFlags = [ "PREFIX=$(out)" ];
0
0
23
24
meta = with stdenv.lib; {
25
description = "A pass extension for managing one-time-password (OTP) tokens";
+86
-82
pkgs/tools/security/pass/default.nix
···
1
-
{ stdenv, lib, fetchurl, fetchFromGitHub
2
, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode
3
, makeWrapper
4
5
, xclip ? null, xdotool ? null, dmenu ? null
6
, x11Support ? !stdenv.isDarwin
7
-
, tombPluginSupport ? false, tomb
0
0
8
}:
9
10
with lib;
···
14
&& dmenu != null;
15
16
let
17
-
plugins = map (p: (fetchFromGitHub {
18
-
owner = "roddhjav";
19
-
repo = "pass-${p.name}";
20
-
inherit (p) rev sha256;
21
-
}))
22
-
([
23
-
{ name = "import";
24
-
rev = "491935bd275f29ceac2b876b3a288011d1ce31e7";
25
-
sha256 = "02mbh05ab8h7kc30hz718d1d1vkjz43b96c7p0xnd92610d2q66q"; }
26
-
{ name = "update";
27
-
rev = "cf576c9036fd18efb9ed29e0e9f811207b556fde";
28
-
sha256 = "1hhbrg6a2walrvla6q4cd3pgrqbcrf9brzjkb748735shxfn52hd"; }
29
-
] ++ stdenv.lib.optional tombPluginSupport {
30
-
name = "tomb";
31
-
rev = "3368134898a42c1b758fabac625ec240e125c6be";
32
-
sha256 = "0qqmxfg4w3r088qhlkhs44036mya82vjflsjjhw2hk8y0wd2i6ds"; }
33
-
);
34
35
-
in stdenv.mkDerivation rec {
36
-
version = "1.7.1";
37
-
name = "password-store-${version}";
0
0
0
0
0
0
38
39
-
src = fetchurl {
40
-
url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz";
41
-
sha256 = "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn";
42
-
};
43
44
-
patches = [ ./set-correct-program-name-for-sleep.patch
45
-
] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
0
0
46
47
-
nativeBuildInputs = [ makeWrapper ];
0
48
49
-
installFlags = [ "PREFIX=$(out)" "WITH_ALLCOMP=yes" ];
50
51
-
postInstall = ''
52
-
# plugins
53
-
${stdenv.lib.concatStringsSep "\n" (map (plugin: ''
54
-
pushd ${plugin}
55
-
PREFIX=$out make install
56
-
popd
57
-
'') plugins)}
58
59
-
# Install Emacs Mode. NOTE: We can't install the necessary
60
-
# dependencies (s.el and f.el) here. The user has to do this
61
-
# himself.
62
-
mkdir -p "$out/share/emacs/site-lisp"
63
-
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
64
-
'' + optionalString x11Support ''
65
-
cp "contrib/dmenu/passmenu" "$out/bin/"
66
-
'';
67
68
-
wrapperPath = with stdenv.lib; makeBinPath ([
69
-
coreutils
70
-
getopt
71
-
git
72
-
gnupg
73
-
gnused
74
-
tree
75
-
which
76
-
qrencode
77
-
procps
78
-
] ++ optional tombPluginSupport tomb
79
-
++ ifEnable x11Support [ dmenu xclip xdotool ]);
80
81
-
postFixup = ''
82
-
# Fix program name in --help
83
-
substituteInPlace $out/bin/pass \
84
-
--replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass"
0
0
0
0
0
0
0
85
86
-
# Ensure all dependencies are in PATH
87
-
wrapProgram $out/bin/pass \
88
-
--prefix PATH : "${wrapperPath}"
89
-
'' + stdenv.lib.optionalString x11Support ''
90
-
# We just wrap passmenu with the same PATH as pass. It doesn't
91
-
# need all the tools in there but it doesn't hurt either.
92
-
wrapProgram $out/bin/passmenu \
93
-
--prefix PATH : "$out/bin:${wrapperPath}"
94
-
'';
95
96
-
meta = with stdenv.lib; {
97
-
description = "Stores, retrieves, generates, and synchronizes passwords securely";
98
-
homepage = https://www.passwordstore.org/;
99
-
license = licenses.gpl2Plus;
100
-
maintainers = with maintainers; [ lovek323 the-kenny fpletz ];
101
-
platforms = platforms.unix;
102
103
-
longDescription = ''
104
-
pass is a very simple password store that keeps passwords inside gpg2
105
-
encrypted files inside a simple directory tree residing at
106
-
~/.password-store. The pass utility provides a series of commands for
107
-
manipulating the password store, allowing the user to add, remove, edit,
108
-
synchronize, generate, and manipulate passwords.
0
0
109
'';
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
110
};
0
0
0
0
0
111
}
···
1
+
{ stdenv, lib, pkgs, fetchurl, fetchFromGitHub, buildEnv
2
, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode
3
, makeWrapper
4
5
, xclip ? null, xdotool ? null, dmenu ? null
6
, x11Support ? !stdenv.isDarwin
7
+
8
+
# For backwards-compatibility
9
+
, tombPluginSupport ? false
10
}:
11
12
with lib;
···
16
&& dmenu != null;
17
18
let
19
+
passExtensions = import ./extensions { inherit pkgs; };
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
20
21
+
env = extensions:
22
+
let
23
+
selected = extensions passExtensions
24
+
++ stdenv.lib.optional tombPluginSupport passExtensions.tomb;
25
+
in buildEnv {
26
+
name = "pass-extensions-env";
27
+
paths = selected;
28
+
buildInputs = concatMap (x: x.buildInputs) selected;
29
+
};
30
31
+
generic = extensionsEnv: extraPassthru: stdenv.mkDerivation rec {
32
+
version = "1.7.1";
33
+
name = "password-store-${version}";
0
34
35
+
src = fetchurl {
36
+
url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz";
37
+
sha256 = "0scqkpll2q8jhzcgcsh9kqz0gwdpvynivqjmmbzax2irjfaiklpn";
38
+
};
39
40
+
patches = [ ./set-correct-program-name-for-sleep.patch
41
+
] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
42
43
+
nativeBuildInputs = [ makeWrapper ];
44
45
+
buildInputs = [ extensionsEnv ];
0
0
0
0
0
0
46
47
+
installFlags = [ "PREFIX=$(out)" "WITH_ALLCOMP=yes" ];
0
0
0
0
0
0
0
48
49
+
postInstall = ''
50
+
# Install Emacs Mode. NOTE: We can't install the necessary
51
+
# dependencies (s.el and f.el) here. The user has to do this
52
+
# himself.
53
+
mkdir -p "$out/share/emacs/site-lisp"
54
+
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
55
+
'' + optionalString x11Support ''
56
+
cp "contrib/dmenu/passmenu" "$out/bin/"
57
+
'';
0
0
0
58
59
+
wrapperPath = with stdenv.lib; makeBinPath ([
60
+
coreutils
61
+
getopt
62
+
git
63
+
gnupg
64
+
gnused
65
+
tree
66
+
which
67
+
qrencode
68
+
procps
69
+
] ++ ifEnable x11Support [ dmenu xclip xdotool ]);
70
71
+
postFixup = ''
72
+
# Link extensions env
73
+
rmdir $out/lib/password-store/extensions
74
+
ln -s ${extensionsEnv}/lib/password-store/extensions $out/lib/password-store/.
0
0
0
0
0
75
76
+
# Fix program name in --help
77
+
substituteInPlace $out/bin/pass \
78
+
--replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass"
0
0
0
79
80
+
# Ensure all dependencies are in PATH
81
+
wrapProgram $out/bin/pass \
82
+
--prefix PATH : "${wrapperPath}"
83
+
'' + stdenv.lib.optionalString x11Support ''
84
+
# We just wrap passmenu with the same PATH as pass. It doesn't
85
+
# need all the tools in there but it doesn't hurt either.
86
+
wrapProgram $out/bin/passmenu \
87
+
--prefix PATH : "$out/bin:${wrapperPath}"
88
'';
89
+
90
+
passthru = {
91
+
extensions = passExtensions;
92
+
} // extraPassthru;
93
+
94
+
meta = with stdenv.lib; {
95
+
description = "Stores, retrieves, generates, and synchronizes passwords securely";
96
+
homepage = https://www.passwordstore.org/;
97
+
license = licenses.gpl2Plus;
98
+
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
99
+
platforms = platforms.unix;
100
+
101
+
longDescription = ''
102
+
pass is a very simple password store that keeps passwords inside gpg2
103
+
encrypted files inside a simple directory tree residing at
104
+
~/.password-store. The pass utility provides a series of commands for
105
+
manipulating the password store, allowing the user to add, remove, edit,
106
+
synchronize, generate, and manipulate passwords.
107
+
'';
108
+
};
109
};
110
+
111
+
in
112
+
113
+
generic (env (_: [])) {
114
+
withExtensions = extensions: generic (env extensions) {};
115
}
+12
pkgs/tools/security/pass/extensions/default.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ pkgs, ... }:
2
+
3
+
with pkgs;
4
+
5
+
{
6
+
pass-import = callPackage ./import.nix {
7
+
pythonPackages = python3Packages;
8
+
};
9
+
pass-otp = callPackage ./otp.nix {};
10
+
pass-tomb = callPackage ./tomb.nix {};
11
+
pass-update = callPackage ./update.nix {};
12
+
}
+37
pkgs/tools/security/pass/extensions/import.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper }:
2
+
3
+
let
4
+
pythonEnv = pythonPackages.python.withPackages (p: [ p.defusedxml ]);
5
+
6
+
in stdenv.mkDerivation rec {
7
+
name = "pass-import-${version}";
8
+
version = "2.2";
9
+
10
+
src = fetchFromGitHub {
11
+
owner = "roddhjav";
12
+
repo = "pass-import";
13
+
rev = "v${version}";
14
+
sha256 = "189wf2jz2j43k27930cnl53sm2drh1s0nq1nmh4is3rzn8cna6wq";
15
+
};
16
+
17
+
nativeBuildInputs = [ makeWrapper ];
18
+
19
+
buildInputs = [ pythonEnv ];
20
+
21
+
dontBuild = true;
22
+
23
+
installFlags = [ "PREFIX=$(out)" ];
24
+
25
+
postFixup = ''
26
+
wrapProgram $out/lib/password-store/extensions/import.bash \
27
+
--prefix PATH : "${pythonEnv}/bin"
28
+
'';
29
+
30
+
meta = with stdenv.lib; {
31
+
description = "Pass extension for importing data from existing password managers";
32
+
homepage = https://github.com/roddhjav/pass-import;
33
+
license = licenses.gpl3Plus;
34
+
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
35
+
platforms = platforms.unix;
36
+
};
37
+
}
+32
pkgs/tools/security/pass/extensions/tomb.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ stdenv, fetchFromGitHub, tomb }:
2
+
3
+
stdenv.mkDerivation rec {
4
+
name = "pass-tomb-${version}";
5
+
version = "1.1";
6
+
7
+
src = fetchFromGitHub {
8
+
owner = "roddhjav";
9
+
repo = "pass-tomb";
10
+
rev = "v${version}";
11
+
sha256 = "0wxa673yyzasjlkpd5f3yl5zf7bhsw7h1jbhf6sdjz65bypr2596";
12
+
};
13
+
14
+
buildInputs = [ tomb ];
15
+
16
+
dontBuild = true;
17
+
18
+
installFlags = [ "PREFIX=$(out)" ];
19
+
20
+
postFixup = ''
21
+
substituteInPlace $out/lib/password-store/extensions/tomb.bash \
22
+
--replace 'TOMB="''${PASSWORD_STORE_TOMB:-tomb}"' 'TOMB="''${PASSWORD_STORE_TOMB:-${tomb}/bin/tomb}"'
23
+
'';
24
+
25
+
meta = with stdenv.lib; {
26
+
description = "Pass extension that keeps the password store encrypted inside a tomb";
27
+
homepage = https://github.com/roddhjav/pass-tomb;
28
+
license = licenses.gpl3Plus;
29
+
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
30
+
platforms = platforms.unix;
31
+
};
32
+
}
+25
pkgs/tools/security/pass/extensions/update.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ stdenv, fetchFromGitHub }:
2
+
3
+
stdenv.mkDerivation rec {
4
+
name = "pass-update-${version}";
5
+
version = "2.0";
6
+
7
+
src = fetchFromGitHub {
8
+
owner = "roddhjav";
9
+
repo = "pass-update";
10
+
rev = "v${version}";
11
+
sha256 = "0a81q0jfni185zmbislzbcv0qr1rdp0cgr9wf9riygis2xv6rs6k";
12
+
};
13
+
14
+
dontBuild = true;
15
+
16
+
installFlags = [ "PREFIX=$(out)" ];
17
+
18
+
meta = with stdenv.lib; {
19
+
description = "Pass extension that provides an easy flow for updating passwords";
20
+
homepage = https://github.com/roddhjav/pass-update;
21
+
license = licenses.gpl3Plus;
22
+
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
23
+
platforms = platforms.unix;
24
+
};
25
+
}
+1
pkgs/top-level/aliases.nix
···
151
openssh_with_kerberos = openssh; # added 2018-01-28
152
owncloudclient = owncloud-client; # added 2016-08
153
p11_kit = p11-kit; # added 2018-02-25
0
154
pgp-tools = signing-party; # added 2017-03-26
155
pidgin-with-plugins = pidgin; # added 2016-06
156
pidginlatexSF = pidgin-latex; # added 2014-11-02
···
151
openssh_with_kerberos = openssh; # added 2018-01-28
152
owncloudclient = owncloud-client; # added 2016-08
153
p11_kit = p11-kit; # added 2018-02-25
154
+
pass-otp = pass.withExtensions (ext: [ext.pass-otp]); # added 2018-05-04
155
pgp-tools = signing-party; # added 2017-03-26
156
pidgin-with-plugins = pidgin; # added 2016-06
157
pidginlatexSF = pidgin-latex; # added 2014-11-02
+2
-1
pkgs/top-level/all-packages.nix
···
656
lastpass-cli = callPackage ../tools/security/lastpass-cli { };
657
658
pass = callPackage ../tools/security/pass { };
659
-
pass-otp = callPackage ../tools/security/pass-otp { };
0
660
661
gopass = callPackage ../tools/security/gopass { };
662
···
656
lastpass-cli = callPackage ../tools/security/lastpass-cli { };
657
658
pass = callPackage ../tools/security/pass { };
659
+
660
+
passExtensions = recurseIntoAttrs pass.extensions;
661
662
gopass = callPackage ../tools/security/gopass { };
663