From 1c2a4b971eb0e683a85d1adcc97acd6f9b51e65b Mon Sep 17 00:00:00 2001 From: Tomas Antonio Lopez Date: Wed, 7 Feb 2024 03:05:04 +0100 Subject: [PATCH] srht-gen-oauth-tok: init at 0.1 Promote the srht-gen-oauth-tok package to a Nixpkgs package. --- nixos/tests/sourcehut/nodes/common.nix | 2 +- .../by-name/sr/srht-gen-oauth-tok/package.nix | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) rename nixos/tests/sourcehut/srht-gen-oauth-tok.nix => pkgs/by-name/sr/srht-gen-oauth-tok/package.nix (53%) diff --git a/nixos/tests/sourcehut/nodes/common.nix b/nixos/tests/sourcehut/nodes/common.nix index 79626eb582ef..f0a81358f972 100644 --- a/nixos/tests/sourcehut/nodes/common.nix +++ b/nixos/tests/sourcehut/nodes/common.nix @@ -102,6 +102,6 @@ in environment.systemPackages = with pkgs; [ hut # For interacting with the Sourcehut APIs via CLI - (callPackage ../srht-gen-oauth-tok.nix { }) # To automatically generate OAuth tokens + srht-gen-oauth-tok # To automatically generate user OAuth tokens ]; } diff --git a/nixos/tests/sourcehut/srht-gen-oauth-tok.nix b/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix similarity index 53% rename from nixos/tests/sourcehut/srht-gen-oauth-tok.nix rename to pkgs/by-name/sr/srht-gen-oauth-tok/package.nix index 0a6527c9ecbb..16a0b2c2cfd7 100644 --- a/nixos/tests/sourcehut/srht-gen-oauth-tok.nix +++ b/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs, lib, fetchFromSourcehut }: +{ stdenv, pkgs, lib, fetchFromSourcehut, nixosTests }: let perl = pkgs.perl.withPackages (pps: [ @@ -24,8 +24,19 @@ stdenv.mkDerivation rec { installPhase = "install -Dm755 srht-gen-oauth-tok $out/bin/srht-gen-oauth-tok"; + passthru.tests.sourcehut = nixosTests.sourcehut; + meta = { - description = "A script to register a new Sourcehut OAuth token for the given user"; + description = "A script to register a new Sourcehut OAuth token for a given user"; + longDescription = '' + srht-gen-oauth-tok is a Perl script for automating the generation of user + OAuth tokens for Sourcehut-based code forges. This is done by emulating a + browser and interacting with the Web interface. + ''; + maintainers = with lib.maintainers; [ nessdoor ]; + mainProgram = "srht-gen-oauth-tok"; license = lib.licenses.gpl3; + platforms = lib.platforms.all; + sourceProvenance = [ lib.sourceTypes.fromSource ]; }; }