From 10fbc5b29b64d67358cf55a5f3d1a1861bba5903 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Mon, 3 Jun 2024 23:09:32 +0800 Subject: [PATCH] pizauth: init at 1.0.4 --- pkgs/by-name/pi/pizauth/package.nix | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/pi/pizauth/package.nix diff --git a/pkgs/by-name/pi/pizauth/package.nix b/pkgs/by-name/pi/pizauth/package.nix new file mode 100644 index 000000000000..17c201663c02 --- /dev/null +++ b/pkgs/by-name/pi/pizauth/package.nix @@ -0,0 +1,43 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + installShellFiles, + stdenv, + darwin, +}: + +rustPlatform.buildRustPackage rec { + pname = "pizauth"; + version = "1.0.4"; + + src = fetchFromGitHub { + owner = "ltratt"; + repo = "pizauth"; + rev = "pizauth-${version}"; + hash = "sha256-Du+MVdYVQgH2V7928kpur+Xp/0y7HXgB8ZC0qciiQvs="; + }; + + cargoHash = "sha256-DrpYMVGvu7UnzQToVgVptURqp7XyoR1iYUfRSLZaqXw="; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + + postInstall = '' + installShellCompletion --cmd pizauth \ + --bash share/bash/completion.bash + ''; + + meta = { + description = "Command-line OAuth2 authentication daemon"; + homepage = "https://github.com/ltratt/pizauth"; + changelog = "https://github.com/ltratt/pizauth/blob/${src.rev}/CHANGES.md"; + license = with lib.licenses; [ + asl20 + mit + ]; + maintainers = with lib.maintainers; [ moraxyc ]; + mainProgram = "pizauth"; + }; +}