flake: Add derivation for pass with local otp build
This commit is contained in:
parent
e0a023df7e
commit
951e126354
|
@ -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;
|
||||
};
|
||||
}
|
43
flake.nix
43
flake.nix
|
@ -9,47 +9,12 @@
|
|||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||
{
|
||||
defaultPackage = with pkgs; stdenv.mkDerivation {
|
||||
pname = "pass-otp";
|
||||
version = "unstable";
|
||||
src = ./.;
|
||||
defaultPackage = self.packages.${system}.pass-otp;
|
||||
|
||||
buildInputs = [ oathToolkit ];
|
||||
packages = {
|
||||
pass-otp = pkgs.callPackage ./default.nix { };
|
||||
|
||||
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.gpl3;
|
||||
maintainers = with maintainers; [ tadfisher ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
pass-with-otp = pkgs.pass.withExtensions (e: [ self.packages.${system}.pass-otp ]);
|
||||
};
|
||||
|
||||
checks.pass-otp = self.defaultPackage.${system};
|
||||
|
|
Loading…
Reference in New Issue