Add Nix flake
This commit is contained in:
parent
8698286567
commit
de580749e2
|
@ -0,0 +1,3 @@
|
|||
/.envrc
|
||||
/result
|
||||
/.direnv/
|
6
Makefile
6
Makefile
|
@ -35,6 +35,8 @@ lint:
|
|||
$(MAKE) -C test lint
|
||||
|
||||
test:
|
||||
$(MAKE) -C test
|
||||
$(MAKE) -C test all
|
||||
|
||||
.PHONY: install uninstall lint test
|
||||
check: lint test
|
||||
|
||||
.PHONY: install uninstall lint test check
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1642700792,
|
||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1642281915,
|
||||
"narHash": "sha256-jcMsXmmO1knyf99o242A+2cy1A0eKa9afly0cwBknPA=",
|
||||
"path": "/nix/store/1q3bx2vjp4afq1wglhxgva9rhs69k8ri-source",
|
||||
"rev": "d5dae6569ea9952f1ae4e727946d93a71c507821",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
description = "A pass extension for managing one-time-password (OTP) tokens";
|
||||
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||
{
|
||||
defaultPackage = with pkgs; 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.gpl3;
|
||||
maintainers = with maintainers; [ tadfisher ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
|
||||
checks.pass-otp = self.defaultPackage.${system};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue