git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #119443 from ambroisie/add-podgrab

Add podgrab package and module

commited83f6455ccf9a84d5db6dc825959cb75f2ea8a6 authorLuke Granger-Brown <git@lukegb.com> dateSun 25 Apr 2021, 14:12 (6 years ago) parentce4f3d71144486
7 files changed+124
maintainers/maintainer-list.nix+6 nixos/modules/module-list.nix+1 nixos/modules/services/misc/podgrab.nix+50 nixos/tests/all-tests.nix+1 nixos/tests/podgrab.nix+34 pkgs/servers/misc/podgrab/default.nix+30 pkgs/top-level/all-packages.nix+2
maintainers/maintainer-list.nix+6
@@ -498,6 +498,12 @@
498498 githubId = 15623522;
499499 name = "Amar Paul";
500500 };
501+ ambroisie = {
502+ email = "bruno.nixpkgs@belanyi.fr";
503+ github = "ambroisie";
504+ githubId = 12465195;
505+ name = "Bruno BELANYI";
506+ };
501507 ambrop72 = {
502508 email = "ambrop7@gmail.com";
503509 github = "ambrop72";
nixos/modules/module-list.nix+1
@@ -530,6 +530,7 @@
530530 ./services/misc/parsoid.nix
531531 ./services/misc/plex.nix
532532 ./services/misc/plikd.nix
533+ ./services/misc/podgrab.nix
533534 ./services/misc/tautulli.nix
534535 ./services/misc/pinnwand.nix
535536 ./services/misc/pykms.nix
nixos/modules/services/misc/podgrab.nixnew file+50
@@ -0,0 +1,50 @@
1+{ config, lib, pkgs, ... }:
2+let
3+ cfg = config.services.podgrab;
4+in
5+{
6+ options.services.podgrab = with lib; {
7+ enable = mkEnableOption "Podgrab, a self-hosted podcast manager";
8+
9+ passwordFile = mkOption {
10+ type = with types; nullOr str;
11+ default = null;
12+ example = "/run/secrets/password.env";
13+ description = ''
14+ The path to a file containing the PASSWORD environment variable
15+ definition for Podgrab's authentification.
16+ '';
17+ };
18+
19+ port = mkOption {
20+ type = types.port;
21+ default = 8080;
22+ example = 4242;
23+ description = "The port on which Podgrab will listen for incoming HTTP traffic.";
24+ };
25+ };
26+
27+ config = lib.mkIf cfg.enable {
28+ systemd.services.podgrab = {
29+ description = "Podgrab podcast manager";
30+ wantedBy = [ "multi-user.target" ];
31+ environment = {
32+ CONFIG = "/var/lib/podgrab/config";
33+ DATA = "/var/lib/podgrab/data";
34+ GIN_MODE = "release";
35+ PORT = toString cfg.port;
36+ };
37+ serviceConfig = {
38+ DynamicUser = true;
39+ EnvironmentFile = lib.optional (cfg.passwordFile != null) [
40+ cfg.passwordFile
41+ ];
42+ ExecStart = "${pkgs.podgrab}/bin/podgrab";
43+ WorkingDirectory = "${pkgs.podgrab}/share";
44+ StateDirectory = [ "podgrab/config" "podgrab/data" ];
45+ };
46+ };
47+ };
48+
49+ meta.maintainers = with lib.maintainers; [ ambroisie ];
50+}
nixos/tests/all-tests.nix+1
@@ -324,6 +324,7 @@ in
324324 pleroma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./pleroma.nix {};
325325 plikd = handleTest ./plikd.nix {};
326326 plotinus = handleTest ./plotinus.nix {};
327+ podgrab = handleTest ./podgrab.nix {};
327328 podman = handleTestOn ["x86_64-linux"] ./podman.nix {};
328329 pomerium = handleTestOn ["x86_64-linux"] ./pomerium.nix {};
329330 postfix = handleTest ./postfix.nix {};
nixos/tests/podgrab.nixnew file+34
@@ -0,0 +1,34 @@
1+let
2+ defaultPort = 8080;
3+ customPort = 4242;
4+in
5+import ./make-test-python.nix ({ pkgs, ... }: {
6+ name = "podgrab";
7+
8+ nodes = {
9+ default = { ... }: {
10+ services.podgrab.enable = true;
11+ };
12+
13+ customized = { ... }: {
14+ services.podgrab = {
15+ enable = true;
16+ port = customPort;
17+ };
18+ };
19+ };
20+
21+ testScript = ''
22+ start_all()
23+
24+ default.wait_for_unit("podgrab")
25+ default.wait_for_open_port("${toString defaultPort}")
26+ default.succeed("curl --fail http://localhost:${toString defaultPort}")
27+
28+ customized.wait_for_unit("podgrab")
29+ customized.wait_for_open_port("${toString customPort}")
30+ customized.succeed("curl --fail http://localhost:${toString customPort}")
31+ '';
32+
33+ meta.maintainers = with pkgs.lib.maintainers; [ ambroisie ];
34+})
pkgs/servers/misc/podgrab/default.nixnew file+30
@@ -0,0 +1,30 @@
1+{ lib, fetchFromGitHub, buildGoModule, nixosTests }:
2+
3+buildGoModule rec {
4+ pname = "podgrab";
5+ version = "unstable-2021-04-14";
6+
7+ src = fetchFromGitHub {
8+ owner = "akhilrex";
9+ repo = pname;
10+ rev = "3179a875b8b638fb86d0e829d12a9761c1cd7f90";
11+ sha256 = "sha256-vhxIm20ZUi+RusrAsSY54tv/D570/oMO5qLz9dNqgqo=";
12+ };
13+
14+ vendorSha256 = "sha256-xY9xNuJhkWPgtqA/FBVIp7GuWOv+3nrz6l3vaZVLlIE=";
15+
16+ postInstall = ''
17+ mkdir -p $out/share/
18+ cp -r $src/client $out/share/
19+ cp -r $src/webassets $out/share/
20+ '';
21+
22+ passthru.tests = { inherit (nixosTests) podgrab; };
23+
24+ meta = with lib; {
25+ description = "A self-hosted podcast manager to download episodes as soon as they become live";
26+ homepage = "https://github.com/akhilrex/podgrab";
27+ license = licenses.gpl3Only;
28+ maintainers = with maintainers; [ ambroisie ];
29+ };
30+}
pkgs/top-level/all-packages.nix+2
@@ -18538,6 +18538,8 @@ in
1853818538
1853918539 hyp = callPackage ../servers/http/hyp { };
1854018540
18541+ podgrab = callPackage ../servers/misc/podgrab { };
18542+
1854118543 prosody = callPackage ../servers/xmpp/prosody {
1854218544 # _compat can probably be removed on next minor version after 0.10.0
1854318545 lua5 = lua5_2_compat;