ifstate: add docs

Co-authored-by: Sandro <7258858+supersandro2000@users.noreply.github.com>

+44 -9
+44 -9
pkgs/by-name/if/ifstate/package.nix
··· 1 { 2 lib, 3 python3Packages, 4 fetchFromGitea, 5 iproute2, ··· 12 }: 13 14 let 15 self = python3Packages.buildPythonApplication rec { 16 pname = "ifstate"; 17 - version = "2.0.1"; 18 - pyproject = true; 19 20 - src = fetchFromGitea { 21 - domain = "codeberg.org"; 22 - owner = "liske"; 23 - repo = "ifstate"; 24 - tag = version; 25 - hash = "sha256-QxjziDlkbTxAVd3qA8u4+JT8NWJxBMVAp7G5Zma9d10="; 26 - }; 27 28 postPatch = '' 29 substituteInPlace libifstate/routing/__init__.py \ ··· 71 }; 72 # needed for access in schema validaten in module 73 jsonschema = "${self}/${python3Packages.python.sitePackages}/libifstate/schema/2/ifstate.conf.schema.json"; 74 }; 75 76 meta = {
··· 1 { 2 lib, 3 + stdenv, 4 + yq, 5 python3Packages, 6 fetchFromGitea, 7 iproute2, ··· 14 }: 15 16 let 17 + version = "2.0.1"; 18 + src = fetchFromGitea { 19 + domain = "codeberg.org"; 20 + owner = "liske"; 21 + repo = "ifstate"; 22 + tag = version; 23 + hash = "sha256-QxjziDlkbTxAVd3qA8u4+JT8NWJxBMVAp7G5Zma9d10="; 24 + }; 25 + docs = stdenv.mkDerivation { 26 + pname = "ifstate-docs"; 27 + 28 + inherit version src; 29 + 30 + nativeBuildInputs = [ yq ]; 31 + 32 + buildInputs = 33 + with python3Packages; 34 + ( 35 + [ 36 + mkdocs-material 37 + mkdocs-glightbox 38 + mkdocs-minify-plugin 39 + ] 40 + ++ mkdocs-material.optional-dependencies.imaging 41 + ); 42 + 43 + postPatch = '' 44 + # git-revision-date requires a git repository 45 + # privacy and social plugin require internet 46 + yq -yi 'del(.plugins[] | select((type == "object" and (has("git-revision-date-localized") or has("social"))) or (type == "string" and . == "privacy")))' mkdocs.yaml 47 + ''; 48 + 49 + buildPhase = '' 50 + runHook preBuild 51 + mkdir -p $out 52 + mkdocs build -d $out 53 + runHook postBuild 54 + ''; 55 + }; 56 self = python3Packages.buildPythonApplication rec { 57 pname = "ifstate"; 58 + inherit version src; 59 60 + pyproject = true; 61 62 postPatch = '' 63 substituteInPlace libifstate/routing/__init__.py \ ··· 105 }; 106 # needed for access in schema validaten in module 107 jsonschema = "${self}/${python3Packages.python.sitePackages}/libifstate/schema/2/ifstate.conf.schema.json"; 108 + inherit docs; 109 }; 110 111 meta = {