144 lines
3 KiB
Nix
144 lines
3 KiB
Nix
let
|
||
sources = import ./nix/sources.nix;
|
||
pkgs = import sources.nixpkgs {};
|
||
inherit (import sources.gitignore { inherit (pkgs) lib; }) gitignoreSource;
|
||
|
||
stdenv = pkgs.stdenv;
|
||
|
||
python3Packages = pkgs.python3Packages;
|
||
buildPythonPackage = python3Packages.buildPythonPackage;
|
||
fetchPypi = python3Packages.fetchPypi;
|
||
|
||
lunr = buildPythonPackage rec {
|
||
pname = "lunr";
|
||
version = "0.5.8";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
sha256 = "0vn2j5iyy40sv0f4v8nin5n5xs4a020g6gcbcgfpbxzgk0xhdyy4";
|
||
};
|
||
|
||
propagatedBuildInputs = with python3Packages; [
|
||
future
|
||
six
|
||
];
|
||
|
||
checkInputs = with python3Packages; [
|
||
mock
|
||
pytest
|
||
];
|
||
};
|
||
|
||
# FIXME: use nixpkgs’s mkdocs once it is ≥1.1
|
||
mkdocs = buildPythonPackage rec {
|
||
pname = "mkdocs";
|
||
version = "1.1.2";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
sha256 = "0fgv5zawpyyv0vd4j5y8m4h058lh9jkwfcm0xy4pg7dr09a1xdph";
|
||
};
|
||
|
||
propagatedBuildInputs = (with python3Packages; [
|
||
backports_tempfile
|
||
click
|
||
jinja2
|
||
livereload
|
||
markdown
|
||
nltk
|
||
pyyaml
|
||
tornado
|
||
]) ++ [
|
||
lunr
|
||
];
|
||
|
||
doCheck = false; # circular depdendency
|
||
};
|
||
|
||
pymdown-extensions = buildPythonPackage rec {
|
||
pname = "pymdown-extensions";
|
||
version = "8.0.1";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
sha256 = "07p5xks6qf73nbv0qb7jrspkpmxdyr7dpxv3rnkh9p2b5l2h99wv";
|
||
};
|
||
|
||
propagatedBuildInputs = with python3Packages; [
|
||
markdown
|
||
];
|
||
|
||
doCheck = false; # they fail?
|
||
};
|
||
|
||
mkdocs-material-extensions = buildPythonPackage rec {
|
||
pname = "mkdocs-material-extensions";
|
||
version = "1.0.1";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
sha256 = "13y617sql4hqs376c3dfcb6v7q41km9x7fh52k3f74a2brzzniv9";
|
||
};
|
||
|
||
# circular dependency
|
||
doCheck = false;
|
||
postPatch = ''
|
||
sed -i 's/mkdocs-material>=5.0.0//' requirements/project.txt
|
||
'';
|
||
};
|
||
|
||
mkdocs-material = buildPythonPackage rec {
|
||
pname = "mkdocs-material";
|
||
version = "6.1.2";
|
||
|
||
src = fetchPypi {
|
||
inherit pname version;
|
||
sha256 = "0yifc1df94rsaxy72hqnhjkv4c50c30j5kg0yxybkxy07p7kafic";
|
||
};
|
||
|
||
propagatedBuildInputs = (with python3Packages; [
|
||
markdown
|
||
pygments
|
||
]) ++ [
|
||
mkdocs
|
||
mkdocs-material-extensions
|
||
pymdown-extensions
|
||
];
|
||
};
|
||
|
||
iosevka-web = stdenv.mkDerivation rec {
|
||
pname = "iosevka-web";
|
||
version = "3.7.1";
|
||
|
||
src = pkgs.fetchzip {
|
||
url = "https://github.com/be5invis/Iosevka/releases/download/v${version}/pkg-iosevka-${version}.zip";
|
||
sha256 = "0d012aqfnyqlpl4smfa2x2qz2qmbbfxb6jr4awv8gp6r359rc9k1";
|
||
stripRoot = false;
|
||
};
|
||
|
||
dontBuild = true;
|
||
|
||
installPhase = ''
|
||
mkdir -p $out
|
||
cp -r woff woff2 ttf *.css $out
|
||
'';
|
||
};
|
||
in
|
||
stdenv.mkDerivation {
|
||
name = "wiki";
|
||
|
||
src = gitignoreSource ./.;
|
||
|
||
buildPhase = "mkdocs build -d $out";
|
||
|
||
installPhase = ''
|
||
mkdir -p $out/assets/fonts
|
||
ln -s ${iosevka-web} $out/assets/fonts/iosevka
|
||
'';
|
||
|
||
nativeBuildInputs = [
|
||
mkdocs
|
||
mkdocs-material
|
||
];
|
||
}
|