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 1 { 2 2 lib, 3 + stdenv, 4 + yq, 3 5 python3Packages, 4 6 fetchFromGitea, 5 7 iproute2, ··· 12 14 }: 13 15 14 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 + }; 15 56 self = python3Packages.buildPythonApplication rec { 16 57 pname = "ifstate"; 17 - version = "2.0.1"; 18 - pyproject = true; 58 + inherit version src; 19 59 20 - src = fetchFromGitea { 21 - domain = "codeberg.org"; 22 - owner = "liske"; 23 - repo = "ifstate"; 24 - tag = version; 25 - hash = "sha256-QxjziDlkbTxAVd3qA8u4+JT8NWJxBMVAp7G5Zma9d10="; 26 - }; 60 + pyproject = true; 27 61 28 62 postPatch = '' 29 63 substituteInPlace libifstate/routing/__init__.py \ ··· 71 105 }; 72 106 # needed for access in schema validaten in module 73 107 jsonschema = "${self}/${python3Packages.python.sitePackages}/libifstate/schema/2/ifstate.conf.schema.json"; 108 + inherit docs; 74 109 }; 75 110 76 111 meta = {