Fixed docs build
This commit is contained in:
@@ -38,10 +38,10 @@ jobs:
|
|||||||
|
|
||||||
- run: mkdir -p out && cp -r ./result/* out
|
- run: mkdir -p out && cp -r ./result/* out
|
||||||
|
|
||||||
- name: Store docs
|
- name: Store website
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: docs
|
name: website
|
||||||
path: ./out
|
path: ./out
|
||||||
|
|
||||||
deploy-docs:
|
deploy-docs:
|
||||||
@@ -57,7 +57,8 @@ jobs:
|
|||||||
- name: Get nix build output
|
- name: Get nix build output
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: docs
|
name: website
|
||||||
|
path: './out'
|
||||||
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v3
|
uses: actions/configure-pages@v3
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-- Adds anchor links to headings with IDs.
|
-- Adds anchor links to headings with IDs.
|
||||||
|
|
||||||
function Header (h)
|
function Header (h)
|
||||||
if h.identifier ~= '' then
|
if h.identifier ~= '' then
|
||||||
-- an empty link to this header
|
-- an empty link to this header
|
||||||
|
|||||||
@@ -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)
|
function CodeBlock(block)
|
||||||
-- Check if the code block does not have a language specified.
|
-- Check if the code block does not have a language specified.
|
||||||
if block.classes[1] == nil then
|
if block.classes[1] == nil then
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
-- Changes all level 2 headers to level 3
|
||||||
|
|
||||||
function Header(elem)
|
function Header(elem)
|
||||||
-- Check if the header is of level 2
|
-- Check if the header is of level 2
|
||||||
if elem.level == 2 then
|
if elem.level == 2 then
|
||||||
|
|||||||
@@ -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)
|
function Para(elem)
|
||||||
-- Check if the first element of the paragraph is Emph (italic)
|
-- Check if the first element of the paragraph is Emph (italic)
|
||||||
|
|||||||
@@ -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)
|
function Para(elem)
|
||||||
-- Check if the first element of the paragraph is Emph (italic)
|
-- Check if the first element of the paragraph is Emph (italic)
|
||||||
|
|||||||
@@ -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
|
-- This function checks if a string starts with a given start string
|
||||||
function starts_with(str, start)
|
function starts_with(str, start)
|
||||||
|
|||||||
@@ -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
|
-- This function checks if a string starts with a given start string
|
||||||
function starts_with(str, start)
|
function starts_with(str, start)
|
||||||
|
|||||||
+5
-7
@@ -23,15 +23,13 @@ in
|
|||||||
buildInputs = with pkgs; [pandoc];
|
buildInputs = with pkgs; [pandoc];
|
||||||
phases = ["unpackPhase" "buildPhase"];
|
phases = ["unpackPhase" "buildPhase"];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
#tmpdir=$(mktemp -d)
|
tmpdir=$(mktemp -d)
|
||||||
tmpdir="$out/debug"
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
mkdir -p $tmpdir
|
|
||||||
cp -r docs $out
|
cp -r docs $out
|
||||||
cd $out
|
|
||||||
|
|
||||||
# Generate md docs
|
# Generate md docs
|
||||||
cat ${optionsDocNixos.optionsCommonMark} > "$tmpdir"/nixos.md
|
cat ${optionsDocNixos.optionsCommonMark} > "$tmpdir"/nixos-options.md
|
||||||
|
|
||||||
pandoc \
|
pandoc \
|
||||||
--standalone \
|
--standalone \
|
||||||
@@ -51,7 +49,7 @@ in
|
|||||||
-V --mathjax \
|
-V --mathjax \
|
||||||
-f markdown+smart \
|
-f markdown+smart \
|
||||||
-o $out/options.html \
|
-o $out/options.html \
|
||||||
"$tmpdir"/nixos.md
|
"$tmpdir"/nixos-options.md
|
||||||
|
|
||||||
pandoc \
|
pandoc \
|
||||||
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
|
||||||
@@ -63,6 +61,6 @@ in
|
|||||||
-V --mathjax \
|
-V --mathjax \
|
||||||
-f markdown+smart \
|
-f markdown+smart \
|
||||||
-o $out/index.html \
|
-o $out/index.html \
|
||||||
"$tmpdir/index.md"
|
README.md
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,25 +5,26 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.util-nixarr.services.prowlarr;
|
cfg = config.util-nixarr.services.cross-seed;
|
||||||
#settingsFormat = pkgs.formats.json {};
|
#settingsFormat = pkgs.formats.json {};
|
||||||
#settingsFile = settingsFormat.generate "settings.json" cfg.settings;
|
#settingsFile = settingsFormat.generate "settings.json" cfg.settings;
|
||||||
cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
|
cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
util-nixarr.services.prowlarr = {
|
util-nixarr.services.cross-seed = {
|
||||||
enable = mkEnableOption "cross-seed";
|
enable = mkEnableOption "cross-seed";
|
||||||
|
|
||||||
configFile = mkOption {
|
configFile = mkOption {
|
||||||
type = with types; nullOr path;
|
type = with types; nullOr path;
|
||||||
default = null;
|
default = null;
|
||||||
example = "/var/lib/secrets/cross-seed/settings.js";
|
example = "/var/lib/secrets/cross-seed/settings.js";
|
||||||
description = "";
|
description = "cross-seed config file"; # TODO: todo
|
||||||
};
|
};
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "/var/lib/cross-seed";
|
default = "/var/lib/cross-seed";
|
||||||
|
description = "cross-seed dataDir"; # TODO: todo
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
@@ -45,7 +46,7 @@ in {
|
|||||||
"d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
|
"d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.prowlarr = {
|
systemd.services.cross-seed = {
|
||||||
description = "cross-seed";
|
description = "cross-seed";
|
||||||
after = ["network.target"];
|
after = ["network.target"];
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
|
|||||||
@@ -9,6 +9,20 @@ with lib; let
|
|||||||
cfg = config.nixarr.transmission;
|
cfg = config.nixarr.transmission;
|
||||||
nixarr = config.nixarr;
|
nixarr = config.nixarr;
|
||||||
dnsServers = config.lib.vpn.dnsServers;
|
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 {
|
in {
|
||||||
options.nixarr.transmission = {
|
options.nixarr.transmission = {
|
||||||
enable = mkEnableOption "the Transmission service.";
|
enable = mkEnableOption "the Transmission service.";
|
||||||
@@ -63,6 +77,13 @@ in {
|
|||||||
Enable the cross-seed service.
|
Enable the cross-seed service.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
indexIds = mkOption {
|
||||||
|
type = with types; listOf int;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
list of indexers TODO: todo
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user