From f7a0c71b615dc008eaa255b87cb96b77d3ce6a6c Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Wed, 17 Jul 2024 22:07:18 +0800 Subject: [PATCH] libreddit: remove as unmaintained upstream --- nixos/modules/module-list.nix | 2 +- .../misc/{libreddit.nix => redlib.nix} | 14 ++++--- nixos/tests/all-tests.nix | 1 - nixos/tests/libreddit.nix | 19 ---------- nixos/tests/redlib.nix | 4 +- pkgs/servers/libreddit/default.nix | 38 ------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 -- 8 files changed, 13 insertions(+), 70 deletions(-) rename nixos/modules/services/misc/{libreddit.nix => redlib.nix} (87%) delete mode 100644 nixos/tests/libreddit.nix delete mode 100644 pkgs/servers/libreddit/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 31e592d5d9fe..1f0244cc484d 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -758,7 +758,6 @@ ./services/misc/klipper.nix ./services/misc/languagetool.nix ./services/misc/leaps.nix - ./services/misc/libreddit.nix ./services/misc/lidarr.nix ./services/misc/lifecycled.nix ./services/misc/llama-cpp.nix @@ -803,6 +802,7 @@ ./services/misc/pykms.nix ./services/misc/radarr.nix ./services/misc/readarr.nix + ./services/misc/redlib.nix ./services/misc/redmine.nix ./services/misc/renovate.nix ./services/misc/ripple-data-api.nix diff --git a/nixos/modules/services/misc/libreddit.nix b/nixos/modules/services/misc/redlib.nix similarity index 87% rename from nixos/modules/services/misc/libreddit.nix rename to nixos/modules/services/misc/redlib.nix index c1f6b276ad9f..0da85df46bf7 100644 --- a/nixos/modules/services/misc/libreddit.nix +++ b/nixos/modules/services/misc/redlib.nix @@ -3,7 +3,7 @@ with lib; let - cfg = config.services.libreddit; + cfg = config.services.redlib; args = concatStringsSep " " ([ "--port ${toString cfg.port}" @@ -11,11 +11,15 @@ let ]); in { + imports = [ + (mkRenamedOptionModule [ "services" "libreddit" ] [ "services" "redlib" ]) + ]; + options = { - services.libreddit = { + services.redlib = { enable = mkEnableOption "Private front-end for Reddit"; - package = mkPackageOption pkgs "libreddit" { }; + package = mkPackageOption pkgs "redlib" { }; address = mkOption { default = "0.0.0.0"; @@ -34,14 +38,14 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = "Open ports in the firewall for the libreddit web interface"; + description = "Open ports in the firewall for the redlib web interface"; }; }; }; config = mkIf cfg.enable { - systemd.services.libreddit = { + systemd.services.redlib = { description = "Private front-end for Reddit"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 29eb36ab1f28..14129d437336 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -502,7 +502,6 @@ in { leaps = handleTest ./leaps.nix {}; lemmy = handleTest ./lemmy.nix {}; libinput = handleTest ./libinput.nix {}; - libreddit = handleTest ./libreddit.nix {}; librenms = handleTest ./librenms.nix {}; libresprite = handleTest ./libresprite.nix {}; libreswan = runTest ./libreswan.nix; diff --git a/nixos/tests/libreddit.nix b/nixos/tests/libreddit.nix deleted file mode 100644 index ecf347b9e12e..000000000000 --- a/nixos/tests/libreddit.nix +++ /dev/null @@ -1,19 +0,0 @@ -import ./make-test-python.nix ({ lib, ... }: - -{ - name = "libreddit"; - meta.maintainers = with lib.maintainers; [ fab ]; - - nodes.machine = { - services.libreddit.enable = true; - # Test CAP_NET_BIND_SERVICE - services.libreddit.port = 80; - }; - - testScript = '' - machine.wait_for_unit("libreddit.service") - machine.wait_for_open_port(80) - # Query a page that does not require Internet access - machine.succeed("curl --fail http://localhost:80/settings") - ''; -}) diff --git a/nixos/tests/redlib.nix b/nixos/tests/redlib.nix index e4bde25e30a6..808f857aed19 100644 --- a/nixos/tests/redlib.nix +++ b/nixos/tests/redlib.nix @@ -3,7 +3,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { meta.maintainers = with lib.maintainers; [ soispha ]; nodes.machine = { - services.libreddit = { + services.redlib = { package = pkgs.redlib; enable = true; # Test CAP_NET_BIND_SERVICE @@ -12,7 +12,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { }; testScript = '' - machine.wait_for_unit("libreddit.service") + machine.wait_for_unit("redlib.service") machine.wait_for_open_port(80) # Query a page that does not require Internet access machine.succeed("curl --fail http://localhost:80/settings") diff --git a/pkgs/servers/libreddit/default.nix b/pkgs/servers/libreddit/default.nix deleted file mode 100644 index c27ea94a7b0c..000000000000 --- a/pkgs/servers/libreddit/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib -, stdenv -, nixosTests -, rustPlatform -, fetchFromGitHub -, Security -}: - -rustPlatform.buildRustPackage rec { - pname = "libreddit"; - version = "0.30.1"; - - src = fetchFromGitHub { - owner = "libreddit"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-Z+COSDiJoWHHZQM4BJca0JA5RrJKYjhfkFj8yx/0gZA="; - }; - - cargoHash = "sha256-42xtt5dCcV6+TcssFjufkVtDSRiDGaatAaiP6K8DT8I="; - - buildInputs = lib.optionals stdenv.isDarwin [ - Security - ]; - - passthru.tests = { - inherit (nixosTests) libreddit; - }; - - meta = with lib; { - description = "Private front-end for Reddit"; - mainProgram = "libreddit"; - homepage = "https://github.com/libreddit/libreddit"; - changelog = "https://github.com/libreddit/libreddit/releases/tag/v${version}"; - license = with licenses; [ agpl3Only ]; - maintainers = with maintainers; [ fab jojosch ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index d1a1bae4e9c3..8fd636c76f85 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -729,6 +729,7 @@ mapAliases ({ librdf = lrdf; # Added 2020-03-22 LibreArp = librearp; # Added 2024-06-12 LibreArp-lv2 = librearp-lv2; # Added 2024-06-12 + libreddit = throw "'libreddit' has been removed because it is unmaintained upstream. Consider using 'redlib', a maintained fork"; # Added 2024-07-17 libressl_3_5 = throw "'libressl_3_5' has reached end-of-life "; # Added 2023-05-07 librtlsdr = rtl-sdr; # Added 2023-02-18 librewolf-wayland = librewolf; # Added 2022-11-15 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4061d72d3223..8020f0d791f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10175,10 +10175,6 @@ with pkgs; libzmf = callPackage ../development/libraries/libzmf { }; - libreddit = callPackage ../servers/libreddit { - inherit (darwin.apple_sdk.frameworks) Security; - }; - librespeed-cli = callPackage ../tools/misc/librespeed-cli { }; libreswan = callPackage ../tools/networking/libreswan { };