From 951e1263544994d8ef6c512eaed4dba569840532 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Sat, 12 Feb 2022 17:51:59 -0800 Subject: flake: Add derivation for pass with local otp build --- flake.nix | 43 ++++--------------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 3fb9ad2..dd8d5c6 100644 --- a/flake.nix +++ b/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}; -- cgit v1.2.3