Documentation refactor (#103)

* docs: switch to ndg

* flake.lock: Update

Flake lock file updates:

• Added input 'ndg':
    'github:feel-co/ndg/d678855cdd0385b1bd78adf3456d072642317d6a?narHash=sha256-gJcybEQZa5Jdh3MSgvGLqiqQFRTZ3IxQFvVIsJecbno%3D' (2026-04-14)
• Added input 'ndg/nixpkgs':
    'https://releases.nixos.org/nixos/unstable/nixos-26.05pre972949.6201e203d095/nixexprs.tar.xz?lastModified=1775036866&narHash=sha256-ByAX1LkhCwZ94%2BKnFAmnJSMAvui7kgCxjHgUHsWAbfI%3D&rev=6201e203d09599479a3b3450ed24fa81537ebc4e' (2026-04-01)
This commit is contained in:
Max 2026-04-16 21:33:58 +01:00 committed by GitHub
parent 28d48c325e
commit ade67e761d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 63 additions and 31 deletions

View File

@ -1,3 +0,0 @@
# Configuration
Hyprspace is configured through a simple JSON config file. This page lists the possible values in NixOS options doc style.

View File

@ -1,4 +1,4 @@
# Development
# Hacking
## Developer Environment

View File

@ -1,3 +1,7 @@
# Hyprspace
A Lightweight VPN Built on top of IPFS & Libp2p for Truly Distributed Networks.
## Configuration
Hyprspace is configured through a simple JSON config file. The available options can be found in the [options reference](options.html).

View File

@ -1,8 +0,0 @@
{
"template": {
"iconUrl": "${ema:homeUrl}favicon.png"
},
"page": {
"siteTitle": "Hyprspace"
}
}

5
docs/ndg.toml Normal file
View File

@ -0,0 +1,5 @@
input_dir = "content"
title = "Hyprspace"
[sidebar]
group_by_dir = true

View File

@ -2,7 +2,7 @@
lib,
runCommand,
nixosOptionsDoc,
emanote,
ndg,
hyprspace,
}:
@ -15,18 +15,9 @@ let
};
in
runCommand "hyprspace-docs-${hyprspace.version}"
{
src = ./content;
nativeBuildInputs = [ emanote ];
}
''
unpackPhase
cd "$sourceRoot"
cp ${../hyprspace.png} ./favicon.png
cp ${./emanote-config.json} ./index.yaml
cat ${optionsDoc.optionsCommonMark} >> ./configuration.md
mkdir -p $out/share/www/hyprspace-docs
emanote -L . gen $out/share/www/hyprspace-docs
''
runCommand "hyprspace-docs-${hyprspace.version}" { } ''
${ndg}/bin/ndg --config-file ${./ndg.toml} \
--config input_dir=${./content} \
--config output_dir=$out/share/www/hyprspace-docs \
--config module_options=${optionsDoc.optionsJSON}/share/doc/nixos/options.json
''

View File

@ -44,7 +44,38 @@
"type": "github"
}
},
"ndg": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1776204333,
"narHash": "sha256-gJcybEQZa5Jdh3MSgvGLqiqQFRTZ3IxQFvVIsJecbno=",
"owner": "feel-co",
"repo": "ndg",
"rev": "d678855cdd0385b1bd78adf3456d072642317d6a",
"type": "github"
},
"original": {
"owner": "feel-co",
"repo": "ndg",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1775036866,
"narHash": "sha256-ByAX1LkhCwZ94+KnFAmnJSMAvui7kgCxjHgUHsWAbfI=",
"rev": "6201e203d09599479a3b3450ed24fa81537ebc4e",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre972949.6201e203d095/nixexprs.tar.xz?lastModified=1775036866&rev=6201e203d09599479a3b3450ed24fa81537ebc4e"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1751011381,
"narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=",
@ -64,7 +95,8 @@
"inputs": {
"flake-parts": "flake-parts",
"hercules-ci-effects": "hercules-ci-effects",
"nixpkgs": "nixpkgs"
"ndg": "ndg",
"nixpkgs": "nixpkgs_2"
}
}
},

View File

@ -14,6 +14,9 @@
flake-parts.follows = "flake-parts";
};
};
ndg = {
url = "github:feel-co/ndg";
};
};
outputs =
@ -49,14 +52,22 @@
];
perSystem =
{ config, pkgs, ... }:
{
config,
inputs',
pkgs,
...
}:
{
packages = {
default = config.packages.hyprspace;
hyprspace = pkgs.callPackage ./package.nix {
generateSchemasProgram = config.apps.dev-generate-schemas.program;
};
docs = pkgs.callPackage ./docs/package.nix { hyprspace = config.packages.default; };
docs = pkgs.callPackage ./docs/package.nix {
hyprspace = config.packages.default;
inherit (inputs'.ndg.packages) ndg;
};
vendor = pkgs.callPackage ./dev/vendor.nix {
generateSchemasProgram = config.apps.dev-generate-schemas.program;
};