From 697b6d85aec6b92c359f2ca54bea35f664c3da28 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 2 Jan 2022 09:51:52 -0300 Subject: [PATCH] acme-sh: refactor Also, add some more meta info. --- pkgs/tools/admin/acme-sh/default.nix | 77 ++++++++++++++++++++++++++++ pkgs/tools/admin/acme.sh/default.nix | 44 ---------------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 78 insertions(+), 45 deletions(-) create mode 100644 pkgs/tools/admin/acme-sh/default.nix delete mode 100644 pkgs/tools/admin/acme.sh/default.nix diff --git a/pkgs/tools/admin/acme-sh/default.nix b/pkgs/tools/admin/acme-sh/default.nix new file mode 100644 index 000000000000..00812537777a --- /dev/null +++ b/pkgs/tools/admin/acme-sh/default.nix @@ -0,0 +1,77 @@ +{ lib +, stdenv +, fetchFromGitHub +, coreutils +, curl +, dnsutils +, gnugrep +, gnused +, iproute2 +, makeWrapper +, openssl +, socat +, unixtools +}: + +stdenv.mkDerivation rec { + pname = "acme.sh"; + version = "3.0.0"; + + src = fetchFromGitHub { + owner = "Neilpang"; + repo = "acme.sh"; + rev = version; + sha256 = "sha256-KWSDAHzvNl8Iao13OV/ExRoKqkc9nouWim+bAN1V+Jo="; + }; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = let + binPath = lib.makeBinPath [ + coreutils + curl + dnsutils + gnugrep + gnused + openssl + socat + (if stdenv.isLinux then iproute2 else unixtools.netstat) + ]; + in + '' + runHook preInstall + + mkdir -p $out $out/bin $out/libexec + cp -R $src/* $_ + makeWrapper $out/libexec/acme.sh $out/bin/acme.sh \ + --prefix PATH : "${binPath}" + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://acme.sh/"; + description = "A pure Unix shell script implementing ACME client protocol"; + longDescription = '' + An ACME Shell script: acme.sh + + - An ACME protocol client written purely in Shell (Unix shell) language. + - Full ACME protocol implementation. + - Support ECDSA certs + - Support SAN and wildcard certs + - Simple, powerful and very easy to use. You only need 3 minutes to learn it. + - Bash, dash and sh compatible. + - Purely written in Shell with no dependencies on python. + - Just one script to issue, renew and install your certificates automatically. + - DOES NOT require root/sudoer access. + - Docker ready + - IPv6 ready + - Cron job notifications for renewal or error etc. + ''; + license = licenses.gpl3Only; + maintainers = teams.serokell.members; + inherit (coreutils.meta) platforms; + }; +} diff --git a/pkgs/tools/admin/acme.sh/default.nix b/pkgs/tools/admin/acme.sh/default.nix deleted file mode 100644 index efa565bc3e70..000000000000 --- a/pkgs/tools/admin/acme.sh/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, openssl, socat, iproute2, - unixtools, dnsutils, coreutils, gnugrep, gnused }: -stdenv.mkDerivation rec { - pname = "acme.sh"; - version = "3.0.0"; - - src = fetchFromGitHub { - owner = "Neilpang"; - repo = "acme.sh"; - rev = version; - sha256 = "sha256-KWSDAHzvNl8Iao13OV/ExRoKqkc9nouWim+bAN1V+Jo="; - }; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - - mkdir -p $out $out/bin $out/libexec - cp -R $src/* $_ - makeWrapper $out/libexec/acme.sh $out/bin/acme.sh \ - --prefix PATH : "${ - lib.makeBinPath [ - coreutils - gnugrep - gnused - socat - openssl - curl - dnsutils - (if stdenv.isLinux then iproute2 else unixtools.netstat) - ] - }" - - runHook postInstall - ''; - - meta = with lib; { - description = "A pure Unix shell script implementing ACME client protocol"; - homepage = "https://acme.sh/"; - license = licenses.gpl3; - maintainers = teams.serokell.members; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ea6e8fd3dce3..804aac9202e6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -858,7 +858,7 @@ with pkgs; accuraterip-checksum = callPackage ../tools/audio/accuraterip-checksum { }; - acme-sh = callPackage ../tools/admin/acme.sh { }; + acme-sh = callPackage ../tools/admin/acme-sh { }; acousticbrainz-client = callPackage ../tools/audio/acousticbrainz-client { };