From a308c61669dd80f76e79c00ac13ca17f11f7ecfd Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Wed, 10 Apr 2024 09:25:01 +0530 Subject: flake/pkgs/npass: init --- README.md | 4 ++-- flake.nix | 42 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2100e88..cc49660 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Todo - [x] pass cat - [x] pass help - [ ] dbus -- [ ] nix flake +- [x] nix flake - [x] shell - - [ ] pkg + - [x] pkg Dependencies ------------ diff --git a/flake.nix b/flake.nix index 4aee201..257b648 100644 --- a/flake.nix +++ b/flake.nix @@ -14,11 +14,18 @@ supportedSystems = lib.platforms.unix; forAllSystems = f: lib.genAttrs supportedSystems (forSystem f); in { - devShells = forAllSystems ({ system, pkgs, ... }: { + devShells = forAllSystems ({ system, pkgs }: { default = pkgs.mkShell { name = "dev"; - buildInputs = with pkgs; [ gpgme meson ninja ccls ]; + buildInputs = with pkgs; [ + gpgme + meson + ninja + ccls + self.packages.${system}.npass + ]; + shellHook = '' [ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME="$HOME/.local/share" @@ -27,5 +34,36 @@ ''; }; }); + + packages = forAllSystems ({ system, pkgs }: let + inherit (pkgs) meson ninja gpgme; + in { + npass = pkgs.stdenv.mkDerivation (finalAttrs: { + pname = "npass"; + version = self.shortRev or self.dirtyShortRev; + + src = ./.; + nativeBuildInputs = [ + meson + ninja + ]; + buildInputs = [ + gpgme + ]; + + meta = { + description = "A passwordstore and Secret Service API implementation"; + homepage = "https://git.sinanmohd.com/npass"; + + license = lib.licenses.gpl3Only; + platforms = supportedSystems; + mainProgram = "pass"; + + maintainers = with lib.maintainers; [ sinanmohd ]; + }; + }); + + default = self.packages.${system}.npass; + }); }; } -- cgit v1.2.3