config-perso/machines/kat-son/doc/hugo-theme-extranix-options-search.nix

68 lines
2.7 KiB
Nix

{
fetchFromGitHub,
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation {
name = "hugo-theme-extranix-options-search";
src = fetchFromGitHub {
owner = "mipmip";
repo = "hugo-theme-extranix-options-search";
rev = "1b5cdc63b3127ab81aed2736b0dea7ed09b7ec72";
hash = "sha256-oowopWC9JdZIex548S0W91MIPSDCaJ3isuNLfesjT9U=";
};
patches = [
./0001-fix-pretty-no-defaults.patch
./0002-chore-remove-useless-dependencies.patch
];
installPhase =
let
js-search = fetchurl {
url = "https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js";
hash = "sha256-LD9UsSATk+xTzAbk8nD2gA2bjHKvetXtCMDAFkM2K5Q=";
};
jquery = fetchurl {
url = "https://code.jquery.com/jquery-3.7.1.slim.min.js";
hash = "sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=";
};
bootstrap.css.main = fetchurl {
url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css";
hash = "sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=";
};
bootstrap.css.theme = fetchurl {
url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css";
hash = "sha256-ZT4HPpdCOt2lvDkXokHuhJfdOKSPFLzeAJik5U/Q+l4=";
};
bootstrap.js = fetchurl {
url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js";
hash = "sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=";
};
in
''
mkdir $out
rm static/images/favicon.*
cp -r * $out
cp ${js-search} $out/static/js/js-search.min.js
cp ${jquery} $out/static/js/jquery.slim.min.js
cp ${bootstrap.css.main} $out/static/css/bootstrap.min.css
cp ${bootstrap.css.theme} $out/static/css/bootstrap-theme.min.css
cp ${bootstrap.js} $out/static/js/bootstrap.min.js
substituteInPlace $out/layouts/index.html \
--replace-fail 'https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js' js/js-search.min.js \
--replace-fail 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js' js/jquery.slim.min.js \
--replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' css/bootstrap.min.css \
--replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css' css/bootstrap-theme.min.css \
--replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' js/bootstrap.min.js \
'';
meta = {
description = "Theme which implements a nix modules options search machine.";
homepage = "https://github.com/mipmip/hugo-theme-extranix-options-search";
license = lib.licenses.asl20;
maintainers = [ ];
};
}