mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-11 17:50:08 +01:00
docs: add initial docs setup
This commit is contained in:
parent
aa1abf945e
commit
e7f7043012
7 changed files with 101 additions and 5 deletions
2
docs/index.md
Normal file
2
docs/index.md
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Nix-GitLab-CI
|
||||||
|
|
||||||
3
docs/options.md
Normal file
3
docs/options.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Options
|
||||||
|
|
||||||
|
{% include 'options.md' %}
|
||||||
|
|
@ -22,14 +22,14 @@
|
||||||
(simple "devShells")
|
(simple "devShells")
|
||||||
(simple "pkgs")
|
(simple "pkgs")
|
||||||
(simple "tests")
|
(simple "tests")
|
||||||
# (simple "docs")
|
(simple "docs")
|
||||||
(simple "ci")
|
(simple "ci")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
packages = ren.select self [
|
packages = ren.select self [
|
||||||
["repo" "tests"]
|
["repo" "tests"]
|
||||||
# ["repo" "docs"]
|
["repo" "docs"]
|
||||||
["repo" "ci" "packages"]
|
["repo" "ci" "packages"]
|
||||||
["packages" "pkgs"]
|
["packages" "pkgs"]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
} @ args: let
|
} @ args: let
|
||||||
inherit (lib) types isAttrs filterAttrs mapAttrs mkOption mkOptionType isType;
|
inherit (lib) types isAttrs filterAttrs mapAttrs mkOption mkOptionType isType literalExpression;
|
||||||
in rec {
|
in rec {
|
||||||
prepend = key: arr: job: {
|
prepend = key: arr: job: {
|
||||||
${key} = arr ++ (job.${key} or []);
|
${key} = arr ++ (job.${key} or []);
|
||||||
|
|
@ -61,12 +61,17 @@ in rec {
|
||||||
_type = "unset";
|
_type = "unset";
|
||||||
};
|
};
|
||||||
isUnset = isType "unset";
|
isUnset = isType "unset";
|
||||||
unsetOr = types.either unsetType;
|
unsetOr = typ:
|
||||||
|
(types.either unsetType typ)
|
||||||
|
// {
|
||||||
|
description = typ.description;
|
||||||
|
};
|
||||||
mkUnsetOption = opts:
|
mkUnsetOption = opts:
|
||||||
mkOption (opts
|
mkOption (opts
|
||||||
// {
|
// {
|
||||||
type = unsetOr opts.type;
|
type = unsetOr opts.type;
|
||||||
default = opts.default or unset;
|
default = opts.default or unset;
|
||||||
|
defaultText = literalExpression "unset";
|
||||||
});
|
});
|
||||||
|
|
||||||
filterUnset = value:
|
filterUnset = value:
|
||||||
|
|
|
||||||
|
|
@ -1 +1,67 @@
|
||||||
{}
|
{inputs, ...}: let
|
||||||
|
inherit (inputs) pkgs cilib doclib;
|
||||||
|
|
||||||
|
optionsDoc = doclib.mkOptionDocs {
|
||||||
|
module = cilib.modules.nixCiSubmodule;
|
||||||
|
roots = [
|
||||||
|
{
|
||||||
|
url = "https://gitlab.com/TECHNOFAB/nix-gitlab-ci/-/blob/main/lib";
|
||||||
|
path = "${inputs.self}/lib";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
optionsDocs = pkgs.runCommand "options-docs" {} ''
|
||||||
|
mkdir -p $out
|
||||||
|
ln -s ${optionsDoc} $out/options.md
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
(doclib.mkDocs {
|
||||||
|
docs."default" = {
|
||||||
|
base = "${inputs.self}";
|
||||||
|
path = "${inputs.self}/docs";
|
||||||
|
material = {
|
||||||
|
enable = true;
|
||||||
|
colors = {
|
||||||
|
primary = "deep orange";
|
||||||
|
accent = "orange";
|
||||||
|
};
|
||||||
|
umami = {
|
||||||
|
enable = true;
|
||||||
|
src = "https://analytics.tf/umami";
|
||||||
|
siteId = "28f7c904-db22-4c2b-9ee4-ed42e14b6db9";
|
||||||
|
domains = ["nix-gitlab-ci.projects.tf"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
macros = {
|
||||||
|
enable = true;
|
||||||
|
includeDir = toString optionsDocs;
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
site_name = "Nix-GitLab-CI";
|
||||||
|
repo_name = "TECHNOFAB/nix-gitlab-ci";
|
||||||
|
repo_url = "https://gitlab.com/TECHNOFAB/nix-gitlab-ci";
|
||||||
|
theme = {
|
||||||
|
logo = "images/logo.png";
|
||||||
|
icon.repo = "simple/gitlab";
|
||||||
|
favicon = "images/favicon.png";
|
||||||
|
};
|
||||||
|
nav = [
|
||||||
|
{"Introduction" = "index.md";}
|
||||||
|
{"Options" = "options.md";}
|
||||||
|
];
|
||||||
|
markdown_extensions = [
|
||||||
|
{
|
||||||
|
"pymdownx.highlight".pygments_lang_class = true;
|
||||||
|
}
|
||||||
|
"pymdownx.inlinehilite"
|
||||||
|
"pymdownx.snippets"
|
||||||
|
"pymdownx.superfences"
|
||||||
|
"pymdownx.escapeall"
|
||||||
|
"fenced_code"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}).packages
|
||||||
|
// {
|
||||||
|
inherit optionsDocs;
|
||||||
|
}
|
||||||
|
|
|
||||||
18
nix/repo/flake.lock
generated
18
nix/repo/flake.lock
generated
|
|
@ -17,6 +17,23 @@
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixmkdocs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"dir": "lib",
|
||||||
|
"lastModified": 1755785622,
|
||||||
|
"narHash": "sha256-xBb9PCkszmrWSEqUiPC7oBJABm1thF572S5QHtloZ+M=",
|
||||||
|
"owner": "TECHNOFAB",
|
||||||
|
"repo": "nixmkdocs",
|
||||||
|
"rev": "61da605a9bff12f66c4b743f43aea59ca200f533",
|
||||||
|
"type": "gitlab"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "lib",
|
||||||
|
"owner": "TECHNOFAB",
|
||||||
|
"repo": "nixmkdocs",
|
||||||
|
"type": "gitlab"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixtest-lib": {
|
"nixtest-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
|
|
@ -37,6 +54,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell-lib": "devshell-lib",
|
"devshell-lib": "devshell-lib",
|
||||||
|
"nixmkdocs-lib": "nixmkdocs-lib",
|
||||||
"nixtest-lib": "nixtest-lib",
|
"nixtest-lib": "nixtest-lib",
|
||||||
"soonix-lib": "soonix-lib",
|
"soonix-lib": "soonix-lib",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
devshell-lib.url = "gitlab:rensa-nix/devshell?dir=lib";
|
devshell-lib.url = "gitlab:rensa-nix/devshell?dir=lib";
|
||||||
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
|
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
|
||||||
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
|
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
|
||||||
|
nixmkdocs-lib.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
@ -14,6 +15,7 @@
|
||||||
devshell = i.devshell-lib.lib {inherit (i.parent) pkgs;};
|
devshell = i.devshell-lib.lib {inherit (i.parent) pkgs;};
|
||||||
soonix = i.soonix-lib.lib {inherit (i.parent) pkgs;};
|
soonix = i.soonix-lib.lib {inherit (i.parent) pkgs;};
|
||||||
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
||||||
|
doclib = i.nixmkdocs-lib.lib {inherit (i.parent) pkgs;};
|
||||||
cilib = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
cilib = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
||||||
treefmt = import i.treefmt-nix;
|
treefmt = import i.treefmt-nix;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue