diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-02-19 16:56:48 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-02-19 17:01:10 +0100 |
| commit | 25f9b854c0065a3d63278178ef4c8abc99108eba (patch) | |
| tree | 50eb4c1d8e32d65b49905ebfb8ff8411045e30d6 /modules/rss-bridge.nix | |
| parent | 547870aaafcafe4836557f2fc98768053af26ef2 (diff) | |
| parent | 7532f335a3ed8a898e2df95f06faa38bad2b8e5d (diff) | |
Merge branch 'rollback'
Diffstat (limited to 'modules/rss-bridge.nix')
| -rw-r--r-- | modules/rss-bridge.nix | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/modules/rss-bridge.nix b/modules/rss-bridge.nix deleted file mode 100644 index 7c0d349..0000000 --- a/modules/rss-bridge.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.services.rss-bridge; - rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: - oldAttrs // { - installPhase = oldAttrs.installPhase + '' - pushd $out/bridges - ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php - ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php - ln -sf ${./FipAlbumsBridge.php} FipAlbumsBridge.php - ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php - popd - '' + lib.optionalString debug '' - touch $out/DEBUG - ''; - }); -in { - options.services.rss-bridge = { - package = mkOption { - type = types.package; - description = "Which derivation to use."; - default = pkgs.rss-bridge; - defaultText = literalExample "pkgs.rss-bridge"; - }; - debug = mkEnableOption "debug mode"; - extraBridges = mkOption { - type = types.listOf (types.submodule { - options = { - name = mkOption { - type = types.strMatching "[a-zA-Z0-9]*"; - description = '' - The name of the bridge. - It need not include 'Bridge' at the end, unlike required in RSS-Bridge. - ''; - example = "SomeAppWithANewsletter"; - }; - source = mkOption { - type = types.path; - description = '' - The path to a file whose contents is the PHP sourcecode of the bridge. - See also the RSS-Bridge documentation: https://rss-bridge.github.io/rss-bridge/Bridge_API/index.html. - ''; - }; - }; - }); - default = [ ]; - description = '' - A list of additional bridges that aren't already included in RSS-Bridge. - These bridges are automatically whitelisted''; - }; - }; - - config.services.rss-bridge.whitelist = - map (bridge: bridge.name) cfg.extraBridges; - config.services.nginx = mkIf (cfg.virtualHost != null) { - virtualHosts.${cfg.virtualHost}.root = mkIf (cfg.extraBridges != [ ]) - (mkForce (pkgs.runCommand "rss-bridge" { } ('' - mkdir -p $out/bridges - cp -r ${cfg.package}/* $out/ - pushd $out/bridges - '' + concatStrings (map (bridge: '' - ln -sf ${bridge.source} "${bridge.name}Bridge.php" - '') cfg.extraBridges) + '' - popd - '' + lib.optionalString cfg.debug '' - touch $out/DEBUG - ''))); - }; -} |
