-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
65 lines (52 loc) · 1.48 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
let
nixpkgs = import (builtins.fetchTarball {
name = "nixos-unstable-2023-03-15";
url = "https://github.com/nixos/nixpkgs/archive/eec97855384951087980a9596af6f69a0e0bdfa1.tar.gz";
sha256 = "0v13l0rwlg4g0pxbsg2nj823pkv9my6p6zfjnf018d3d0npz6b8i";
}) {};
myPython = nixpkgs.python3.withPackages (ps: with ps; [
docopt
python-gnupg
]);
in nixpkgs.pkgs.stdenv.mkDerivation rec {
name = "horcrux-${version}";
version = "0.4";
src = ./.;
buildInputs = with nixpkgs.pkgs; [
expect # only used by test scripts
which # only used by test scripts
makeWrapper # only used by nix install
unzip # TODO remove?
gnupg
pwgen # pwgen-secure?
qrencode
ssss
steghide
(python3.withPackages (ps: with ps; [
docopt
python-gnupg
]))
];
shellHook = ''
export PATH=$PWD:$PATH
'';
installPhase = ''
mkdir -p $out/bin
install -m755 horcrux $out/bin/horcrux
wrapProgram $out/bin/horcrux \
--prefix PATH : ${nixpkgs.pkgs.lib.makeBinPath buildInputs}
mkdir -p $out/test
cp test/example.* $out/test/
cp test/test-*-*.txt $out/test/
for f in $src/test/*.sh; do
install -m755 $f $out/test/$(basename $f)
wrapProgram $out/test/$(basename $f) \
--prefix PATH : $out/bin:${nixpkgs.pkgs.lib.makeBinPath buildInputs}
done
ln -s $out/test/test.sh $out/bin/horcrux-test
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/horcrux-test
'';
}