From e41bd718ee79ba0ba3bdcd617a970fe263219030 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Fri, 1 Mar 2024 07:38:14 +0100 Subject: [PATCH] Fixed docs build --- .github/workflows/deployment.yml | 7 +++++-- mkDocs.nix | 11 ++++++----- nixarr/transmission/cross-seed/default.nix | 9 +++++---- nixarr/transmission/default.nix | 21 +++++++++++++++++++++ 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 87cc99d..c26944f 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -41,7 +41,7 @@ jobs: - name: Store docs uses: actions/upload-artifact@v4 with: - name: docs + name: test path: ./out deploy-docs: @@ -57,11 +57,14 @@ jobs: - name: Get nix build output uses: actions/download-artifact@v4 with: - name: docs + name: test + path: './out' - name: Setup Pages uses: actions/configure-pages@v3 + - run: tree + - name: Upload GH pages artifact uses: actions/upload-pages-artifact@v1 with: diff --git a/mkDocs.nix b/mkDocs.nix index c52e1eb..6a39786 100644 --- a/mkDocs.nix +++ b/mkDocs.nix @@ -23,12 +23,13 @@ in buildInputs = with pkgs; [pandoc]; phases = ["unpackPhase" "buildPhase"]; buildPhase = '' - #tmpdir=$(mktemp -d) - tmpdir="$out/debug" + #tmpdir="$out/debug" + #mkdir -p $tmpdir + + tmpdir=$(mktemp -d) + mkdir -p $out - mkdir -p $tmpdir cp -r docs $out - cd $out # Generate md docs cat ${optionsDocNixos.optionsCommonMark} > "$tmpdir"/nixos.md @@ -63,6 +64,6 @@ in -V --mathjax \ -f markdown+smart \ -o $out/index.html \ - "$tmpdir/index.md" + README.md ''; } diff --git a/nixarr/transmission/cross-seed/default.nix b/nixarr/transmission/cross-seed/default.nix index e7639b0..f6845e5 100644 --- a/nixarr/transmission/cross-seed/default.nix +++ b/nixarr/transmission/cross-seed/default.nix @@ -5,25 +5,26 @@ ... }: with lib; let - cfg = config.util-nixarr.services.prowlarr; + cfg = config.util-nixarr.services.cross-seed; #settingsFormat = pkgs.formats.json {}; #settingsFile = settingsFormat.generate "settings.json" cfg.settings; cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; }; in { options = { - util-nixarr.services.prowlarr = { + util-nixarr.services.cross-seed = { enable = mkEnableOption "cross-seed"; configFile = mkOption { type = with types; nullOr path; default = null; example = "/var/lib/secrets/cross-seed/settings.js"; - description = ""; + description = "cross-seed config file"; # TODO: todo }; dataDir = mkOption { type = types.path; default = "/var/lib/cross-seed"; + description = "cross-seed dataDir"; # TODO: todo }; user = mkOption { @@ -45,7 +46,7 @@ in { "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -" ]; - systemd.services.prowlarr = { + systemd.services.cross-seed = { description = "cross-seed"; after = ["network.target"]; wantedBy = ["multi-user.target"]; diff --git a/nixarr/transmission/default.nix b/nixarr/transmission/default.nix index 2415bce..659cb2d 100644 --- a/nixarr/transmission/default.nix +++ b/nixarr/transmission/default.nix @@ -9,6 +9,20 @@ with lib; let cfg = config.nixarr.transmission; nixarr = config.nixarr; dnsServers = config.lib.vpn.dnsServers; + get-indexers = with builtins; pkgs.writeShellApplication { + name = "upnp-ports"; + + runtimeInputs = with pkgs; [ jq yq ]; + + text = '' + PROWLARR_API_KEY=$(xq '.Config.ApiKey' "${nixarr.prowlarr.stateDir}/config.xml") + '' + + toJson ( + map (x: + ''http://localhost:9696/${toString x}/api?apikey="$PROWLARR_API_KEY"'' + ) cfg.privateTrackers.cross-seed.indexIds + ); + }; in { options.nixarr.transmission = { enable = mkEnableOption "the Transmission service."; @@ -63,6 +77,13 @@ in { Enable the cross-seed service. ''; }; + indexIds = mkOption { + type = with types; listOf int; + default = []; + description = '' + list of indexers TODO: todo + ''; + }; }; };