diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 87cc99d..92e5128 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -38,10 +38,10 @@ jobs: - run: mkdir -p out && cp -r ./result/* out - - name: Store docs + - name: Store website uses: actions/upload-artifact@v4 with: - name: docs + name: website path: ./out deploy-docs: @@ -57,7 +57,8 @@ jobs: - name: Get nix build output uses: actions/download-artifact@v4 with: - name: docs + name: website + path: './out' - name: Setup Pages uses: actions/configure-pages@v3 diff --git a/docs/pandoc/lua/anchor-links.lua b/docs/pandoc/lua/anchor-links.lua index 5bfb350..e133da0 100644 --- a/docs/pandoc/lua/anchor-links.lua +++ b/docs/pandoc/lua/anchor-links.lua @@ -1,4 +1,5 @@ -- Adds anchor links to headings with IDs. + function Header (h) if h.identifier ~= '' then -- an empty link to this header diff --git a/docs/pandoc/lua/code-default-to-nix.lua b/docs/pandoc/lua/code-default-to-nix.lua index 2996610..5743054 100644 --- a/docs/pandoc/lua/code-default-to-nix.lua +++ b/docs/pandoc/lua/code-default-to-nix.lua @@ -1,4 +1,5 @@ --- This function is called for each CodeBlock element in the document. +-- Change each untagged codeblock in the document to a "nix" code block. + function CodeBlock(block) -- Check if the code block does not have a language specified. if block.classes[1] == nil then diff --git a/docs/pandoc/lua/headers-lvl2-to-lvl3.lua b/docs/pandoc/lua/headers-lvl2-to-lvl3.lua index 5d03bf6..ab5fdab 100644 --- a/docs/pandoc/lua/headers-lvl2-to-lvl3.lua +++ b/docs/pandoc/lua/headers-lvl2-to-lvl3.lua @@ -1,3 +1,5 @@ +-- Changes all level 2 headers to level 3 + function Header(elem) -- Check if the header is of level 2 if elem.level == 2 then diff --git a/docs/pandoc/lua/inline-to-fenced-nix.lua b/docs/pandoc/lua/inline-to-fenced-nix.lua index f4acf48..9e4b470 100644 --- a/docs/pandoc/lua/inline-to-fenced-nix.lua +++ b/docs/pandoc/lua/inline-to-fenced-nix.lua @@ -1,4 +1,4 @@ --- file: remove-declared-by.lua +-- Changes "Example" and "Default" section fenced code blocks into "nix" tagged code blocks function Para(elem) -- Check if the first element of the paragraph is Emph (italic) diff --git a/docs/pandoc/lua/remove-declared-by.lua b/docs/pandoc/lua/remove-declared-by.lua index 6474d3b..623e4c4 100644 --- a/docs/pandoc/lua/remove-declared-by.lua +++ b/docs/pandoc/lua/remove-declared-by.lua @@ -1,4 +1,4 @@ --- file: remove-declared-by.lua +-- Removed "Declared by:" paragraphs. TODO: Make them link to the GH repo instead function Para(elem) -- Check if the first element of the paragraph is Emph (italic) diff --git a/docs/pandoc/lua/remove-module-args.lua b/docs/pandoc/lua/remove-module-args.lua index ded832a..317bf01 100644 --- a/docs/pandoc/lua/remove-module-args.lua +++ b/docs/pandoc/lua/remove-module-args.lua @@ -1,4 +1,4 @@ --- file: remove-util-nixarr.lua +-- Remove junk module.args section of the nix documentation -- This function checks if a string starts with a given start string function starts_with(str, start) diff --git a/docs/pandoc/lua/remove-utils.lua b/docs/pandoc/lua/remove-utils.lua index 4197a6a..3a88290 100644 --- a/docs/pandoc/lua/remove-utils.lua +++ b/docs/pandoc/lua/remove-utils.lua @@ -1,4 +1,4 @@ --- file: remove-util-nixarr.lua +-- Remove the "util-nixarr" sections from the docs -- This function checks if a string starts with a given start string function starts_with(str, start) diff --git a/mkDocs.nix b/mkDocs.nix index c52e1eb..9199eae 100644 --- a/mkDocs.nix +++ b/mkDocs.nix @@ -23,15 +23,13 @@ in buildInputs = with pkgs; [pandoc]; phases = ["unpackPhase" "buildPhase"]; buildPhase = '' - #tmpdir=$(mktemp -d) - tmpdir="$out/debug" + tmpdir=$(mktemp -d) + mkdir -p $out - mkdir -p $tmpdir cp -r docs $out - cd $out # Generate md docs - cat ${optionsDocNixos.optionsCommonMark} > "$tmpdir"/nixos.md + cat ${optionsDocNixos.optionsCommonMark} > "$tmpdir"/nixos-options.md pandoc \ --standalone \ @@ -51,7 +49,7 @@ in -V --mathjax \ -f markdown+smart \ -o $out/options.html \ - "$tmpdir"/nixos.md + "$tmpdir"/nixos-options.md pandoc \ --metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \ @@ -63,6 +61,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..4d9a146 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 = "get-indexers"; + + 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 + ''; + }; }; };