srht-gen-oauth-tok: init at 0.1

Promote the srht-gen-oauth-tok package to a Nixpkgs package.

Changed files
+43 -32
nixos
tests
pkgs
by-name
sr
srht-gen-oauth-tok
+1 -1
nixos/tests/sourcehut/nodes/common.nix
···
environment.systemPackages = with pkgs; [
hut # For interacting with the Sourcehut APIs via CLI
-
(callPackage ../srht-gen-oauth-tok.nix { }) # To automatically generate OAuth tokens
];
}
···
environment.systemPackages = with pkgs; [
hut # For interacting with the Sourcehut APIs via CLI
+
srht-gen-oauth-tok # To automatically generate user OAuth tokens
];
}
-31
nixos/tests/sourcehut/srht-gen-oauth-tok.nix
···
-
{ stdenv, pkgs, lib, fetchFromSourcehut }:
-
-
let
-
perl = pkgs.perl.withPackages (pps: [
-
pps.CryptSSLeay
-
pps.WWWMechanize
-
pps.XMLLibXML
-
]);
-
in
-
stdenv.mkDerivation rec {
-
pname = "srht-gen-oauth-tok";
-
version = "0.1";
-
-
src = fetchFromSourcehut {
-
domain = "entropic.network";
-
owner = "~nessdoor";
-
repo = pname;
-
rev = version;
-
hash = "sha256-GcqP3XbVw2sR5n4+aLUmA4fthNkuVAGnhV1h7suJYdI=";
-
};
-
-
buildInputs = [ perl ];
-
nativeBuildInputs = [ perl ];
-
-
installPhase = "install -Dm755 srht-gen-oauth-tok $out/bin/srht-gen-oauth-tok";
-
-
meta = {
-
description = "A script to register a new Sourcehut OAuth token for the given user";
-
license = lib.licenses.gpl3;
-
};
-
}
···
+42
pkgs/by-name/sr/srht-gen-oauth-tok/package.nix
···
···
+
{ stdenv, pkgs, lib, fetchFromSourcehut, nixosTests }:
+
+
let
+
perl = pkgs.perl.withPackages (pps: [
+
pps.CryptSSLeay
+
pps.WWWMechanize
+
pps.XMLLibXML
+
]);
+
in
+
stdenv.mkDerivation rec {
+
pname = "srht-gen-oauth-tok";
+
version = "0.1";
+
+
src = fetchFromSourcehut {
+
domain = "entropic.network";
+
owner = "~nessdoor";
+
repo = pname;
+
rev = version;
+
hash = "sha256-GcqP3XbVw2sR5n4+aLUmA4fthNkuVAGnhV1h7suJYdI=";
+
};
+
+
buildInputs = [ perl ];
+
nativeBuildInputs = [ perl ];
+
+
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 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 ];
+
};
+
}