mirror of
https://gitlab.com/TECHNOFAB/soonix.git
synced 2025-12-11 22:00:05 +01:00
docs: add initial docs base
This commit is contained in:
parent
af1494f3c6
commit
ed75ed6695
8 changed files with 124 additions and 13 deletions
22
LICENSE.md
Normal file
22
LICENSE.md
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 TECHNOFAB
|
||||||
|
Copyright (c) 2022 Joshua Gilman
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
1
docs/index.md
Normal file
1
docs/index.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# Soonix
|
||||||
3
docs/options.md
Normal file
3
docs/options.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Options
|
||||||
|
|
||||||
|
{% include 'options.md' %}
|
||||||
|
|
@ -21,11 +21,13 @@
|
||||||
cellBlocks = with ren.blocks; [
|
cellBlocks = with ren.blocks; [
|
||||||
(simple "devShells")
|
(simple "devShells")
|
||||||
(simple "tests")
|
(simple "tests")
|
||||||
|
(simple "docs")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
packages = ren.select self [
|
packages = ren.select self [
|
||||||
["repo" "tests"]
|
["repo" "tests"]
|
||||||
|
["repo" "docs"]
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,24 +24,24 @@ in {
|
||||||
|
|
||||||
output = mkOption {
|
output = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "The relative path where the generated file should be placed";
|
description = "The relative path where the generated file should be placed.";
|
||||||
};
|
};
|
||||||
|
|
||||||
generator = mkOption {
|
generator = mkOption {
|
||||||
type = types.enum ["nix" "string" "derivation" "gotmpl" "jinja" "template"];
|
type = types.enum ["nix" "string" "derivation" "gotmpl" "jinja" "template"];
|
||||||
description = "Which engine to use for content generation";
|
description = "Which engine to use for content generation.";
|
||||||
default = "nix";
|
default = "nix";
|
||||||
};
|
};
|
||||||
|
|
||||||
data = mkOption {
|
data = mkOption {
|
||||||
type = types.anything;
|
type = types.anything;
|
||||||
description = "The input data for the chosen generator";
|
description = "The input data for the chosen generator.";
|
||||||
};
|
};
|
||||||
|
|
||||||
opts = mkOption {
|
opts = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Generator-specific options";
|
description = "Generator-specific options.";
|
||||||
};
|
};
|
||||||
|
|
||||||
hook = mkOption {
|
hook = mkOption {
|
||||||
|
|
@ -50,31 +50,31 @@ in {
|
||||||
mode = mkOption {
|
mode = mkOption {
|
||||||
type = types.enum ["link" "copy"];
|
type = types.enum ["link" "copy"];
|
||||||
default = "link";
|
default = "link";
|
||||||
description = "How the file should be managed (link or copy)";
|
description = "How the file should be managed (link or copy).";
|
||||||
};
|
};
|
||||||
|
|
||||||
gitignore = mkOption {
|
gitignore = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to add the output path to .gitignore";
|
description = "Whether to add the output path to .gitignore.";
|
||||||
};
|
};
|
||||||
|
|
||||||
extra = mkOption {
|
extra = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
description = "Additional bash commands to execute after file operation";
|
description = "Additional bash commands to execute after file operation.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
default = {};
|
default = {};
|
||||||
description = "Hook-specific options for file management";
|
description = "Hook-specific options.";
|
||||||
};
|
};
|
||||||
|
|
||||||
generatedDerivation = mkOption {
|
generatedDerivation = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
internal = true;
|
internal = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = "The generated derivation for this file";
|
description = "The generated derivation for this file.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -87,24 +87,24 @@ in {
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
default = {};
|
default = {};
|
||||||
description = "Configuration hooks for file generation and management";
|
description = "Configuration of the hooks.";
|
||||||
};
|
};
|
||||||
|
|
||||||
shellHook = mkOption {
|
shellHook = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = "Generated shell hook script for managing all files";
|
description = "Generated shell hook script (as a string) for managing all files (readonly).";
|
||||||
};
|
};
|
||||||
shellHookFile = mkOption {
|
shellHookFile = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = "Generated shell hook script for managing all files";
|
description = "Generated shell hook script for managing all files (readonly).";
|
||||||
};
|
};
|
||||||
|
|
||||||
finalFiles = mkOption {
|
finalFiles = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = "Aggregated derivation containing all managed files";
|
description = "Aggregated derivation containing all managed files (readonly).";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
63
nix/repo/docs.nix
Normal file
63
nix/repo/docs.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
{inputs, ...}: let
|
||||||
|
inherit (inputs) pkgs soonix doclib;
|
||||||
|
|
||||||
|
optionsDoc = doclib.mkOptionDocs {
|
||||||
|
module = soonix.module;
|
||||||
|
roots = [
|
||||||
|
{
|
||||||
|
url = "https://gitlab.com/TECHNOFAB/soonix/-/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;
|
||||||
|
umami = {
|
||||||
|
enable = true;
|
||||||
|
src = "https://analytics.tf/umami";
|
||||||
|
siteId = "e8b0ca9c-c540-41b0-8eb8-1b2fcc5e57f7";
|
||||||
|
domains = ["soonix.projects.tf"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
macros = {
|
||||||
|
enable = true;
|
||||||
|
includeDir = toString optionsDocs;
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
site_name = "Soonix";
|
||||||
|
repo_name = "TECHNOFAB/soonix";
|
||||||
|
repo_url = "https://gitlab.com/TECHNOFAB/soonix";
|
||||||
|
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": {
|
||||||
|
"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": "nixmkdocs",
|
||||||
"nixtest-lib": "nixtest-lib"
|
"nixtest-lib": "nixtest-lib"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
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";
|
||||||
|
nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
|
||||||
};
|
};
|
||||||
outputs = i:
|
outputs = i:
|
||||||
i
|
i
|
||||||
// {
|
// {
|
||||||
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
||||||
devshell = i.devshell-lib.lib {inherit (i.parent) pkgs;};
|
devshell = i.devshell-lib.lib {inherit (i.parent) pkgs;};
|
||||||
|
doclib = i.nixmkdocs.lib {inherit (i.parent) pkgs;};
|
||||||
soonix = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
soonix = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue