From b06f2652912a4035497e8a4078143bafe85264f7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 19 Apr 2021 17:45:05 +0000 Subject: [PATCH] pkgs: extract podgrab from 'services/podgrab' --- pkgs/default.nix | 4 +++- pkgs/podgrab/default.nix | 29 +++++++++++++++++++++++++++++ services/podgrab.nix | 28 +--------------------------- 3 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 pkgs/podgrab/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index c78fe50..82ae94d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,2 +1,4 @@ { pkgs }: -{ } +{ + podgrab = pkgs.callPackage ./podgrab { }; +} diff --git a/pkgs/podgrab/default.nix b/pkgs/podgrab/default.nix new file mode 100644 index 0000000..7f18416 --- /dev/null +++ b/pkgs/podgrab/default.nix @@ -0,0 +1,29 @@ +{ buildGoModule, fetchFromGitHub, lib }: + +buildGoModule rec { + pname = "podgrab"; + version = "2021-03-26"; + + src = fetchFromGitHub { + owner = "akhilrex"; + repo = "podgrab"; + rev = "3179a875b8b638fb86d0e829d12a9761c1cd7f90"; + sha256 = "sha256-vhxIm20ZUi+RusrAsSY54tv/D570/oMO5qLz9dNqgqo="; + }; + + vendorSha256 = "sha256-xY9xNuJhkWPgtqA/FBVIp7GuWOv+3nrz6l3vaZVLlIE="; + + postInstall = '' + mkdir -p $out/share/ + cp -r "$src/client" "$out/share/" + cp -r "$src/webassets" "$out/share/" + ''; + + meta = with lib; { + description = '' + A self-hosted podcast manager to download episodes as soon as they become live + ''; + homepage = "https://github.com/akhilrex/podgrab"; + license = licenses.gpl3; + }; +} diff --git a/services/podgrab.nix b/services/podgrab.nix index 48d527e..556ffff 100644 --- a/services/podgrab.nix +++ b/services/podgrab.nix @@ -8,33 +8,7 @@ let domain = config.networking.domain; podgrabDomain = "podgrab.${domain}"; - podgrabPkg = with pkgs; with stdenv; buildGoModule rec { - pname = "podgrab"; - version = "2021-03-26"; - - src = fetchFromGitHub { - owner = "akhilrex"; - repo = "podgrab"; - rev = "3179a875b8b638fb86d0e829d12a9761c1cd7f90"; - sha256 = "sha256-vhxIm20ZUi+RusrAsSY54tv/D570/oMO5qLz9dNqgqo="; - }; - - vendorSha256 = "sha256-xY9xNuJhkWPgtqA/FBVIp7GuWOv+3nrz6l3vaZVLlIE="; - - postInstall = '' - mkdir -p $out/share/ - cp -r "$src/client" "$out/share/" - cp -r "$src/webassets" "$out/share/" - ''; - - meta = with lib; { - description = '' - A self-hosted podcast manager to download episodes as soon as they become live - ''; - homepage = "https://github.com/akhilrex/podgrab"; - license = licenses.gpl3; - }; - }; + podgrabPkg = pkgs.ambroisie.podgrab; in { options.my.services.podgrab = with lib; {