aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorTad Fisher <tadfisher@gmail.com>2022-02-12 17:51:59 -0800
committerTad Fisher <129148+tadfisher@users.noreply.github.com>2022-02-12 17:54:50 -0800
commit951e1263544994d8ef6c512eaed4dba569840532 (patch)
treefd23230a2ccc54979bec1503789e1c2d3d6d2b0f /default.nix
parente0a023df7ebacb241ccd13dfe02a498e7c32cfe6 (diff)
downloadpass-otp-951e1263544994d8ef6c512eaed4dba569840532.tar.gz
pass-otp-951e1263544994d8ef6c512eaed4dba569840532.zip
flake: Add derivation for pass with local otp build
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..db19fa3
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, oathToolkit
+, bash
+, expect
+, git
+, gnumake
+, gnupg
+, pass
+, shellcheck
+, which
+}:
+
+stdenv.mkDerivation {
+ pname = "pass-otp";
+ version = "unstable";
+ src = ./.;
+
+ buildInputs = [ oathToolkit ];
+
+ checkInputs = [
+ bash
+ expect
+ git
+ gnumake
+ gnupg
+ pass
+ shellcheck
+ which
+ ];
+
+ dontBuild = true;
+ doCheck = true;
+
+ patchPhase = ''
+ sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
+ '';
+
+ checkPhase = ''
+ make SHELL=$SHELL check
+ '';
+
+ installFlags = [
+ "PREFIX=$(out)"
+ "BASHCOMPDIR=$(out)/share/bash-completions/completions"
+ ];
+
+ meta = with lib; {
+ description = "A pass extension for managing one-time-password (OTP) tokens";
+ homepage = "https://github.com/tadfisher/pass-otp";
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ tadfisher ];
+ platforms = platforms.unix;
+ };
+}