refactor(docs): cleanup variables

This commit is contained in:
Sk7Str1p3 2026-07-26 18:49:40 +00:00
parent 645fa542ee
commit 7d3133cc3c
Signed by: Sk7Str1p3
SSH key fingerprint: SHA256:GcXqjfo0IHK280c6aH9o5SmcOWyqMS8gjfOtDQ3gr/Q

View file

@ -18,33 +18,23 @@ stdenvNoCC.mkDerivation {
];
patchPhase =
let
shouldExclude = relPath: lib.any (pattern: builtins.match pattern relPath != null) excluded;
relPath = file: lib.removePrefix (toString ../. + "/") (toString file);
nixFiles =
with lib.fileset;
let
allFiles = toList (fileFilter (f: f.hasExt "nix") ../.);
in
lib.filter (
file:
let
relPath = lib.removePrefix (toString ../. + "/") (toString file);
in
!shouldExclude relPath
) allFiles;
lib.filter (file: !(lib.any (pattern: builtins.match pattern (relPath file) != null) excluded)) (
toList (fileFilter (f: f.hasExt "nix") ../.)
);
chapters = lib.sort (a: b: a.sortKey < b.sortKey) (
map (
file:
let
relPath = lib.removePrefix (toString ../. + "/") (toString file);
mdPath =
(
if baseNameOf file == "default.nix" then
lib.removeSuffix "/" (dirOf relPath)
lib.removeSuffix "/" (dirOf (relPath file))
else
lib.removeSuffix ".nix" relPath
lib.removeSuffix ".nix" (relPath file)
)
+ ".md";
@ -55,7 +45,7 @@ stdenvNoCC.mkDerivation {
hosts = 3;
users = 4;
};
order = orderMap.${lib.head (lib.splitString "/" relPath)};
order = orderMap.${lib.head (lib.splitString "/" (relPath file))};
category = lib.removeSuffix ".md" (lib.replaceStrings [ "/" ] [ "." ] mdPath);
title =