1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 00:06:26 -04:00

add python dependency sphinx-sitemap

This commit is contained in:
Alejandro Sanchez Medina 2023-10-10 13:35:55 +01:00
parent 5ede808e39
commit c2adc4efe4
2 changed files with 57 additions and 1 deletions

View file

@ -9,12 +9,17 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [
# Add sphinx-sitemap from an overlay until
# it becomes available from nixpkgs-unstable
(import ./overlay.nix)
];
};
in {
packages.default = pkgs.stdenv.mkDerivation {
name = "nix-dev";
src = self;
buildInputs = with pkgs.python310Packages; [
buildInputs = with pkgs.python310.pkgs; [
livereload
linkify-it-py
myst-parser
@ -23,6 +28,7 @@
sphinx-copybutton
sphinx-design
sphinx-notfound-page
sphinx-sitemap
black
];
buildPhase = ''

50
overlay.nix Normal file
View file

@ -0,0 +1,50 @@
final: prev: let
python-module-sphinx-sitemap = {
lib,
buildPythonPackage,
fetchPypi,
sphinx,
pytest,
}: let
pname = "sphinx-sitemap";
version = "2.5.1";
in
buildPythonPackage {
inherit pname version;
src = fetchPypi {
inherit pname version;
sha256 = "sha256-mEvvBou9vCbPriCai2E5LpaBq8kZG0d80w2kBuOmDuU=";
};
propagatedBuildInputs = [
sphinx
];
nativeCheckInputs = [
pytest
];
doCheck = true;
checkPhase = ''
pytest --fixtures tests
'';
meta = with lib; {
description = "Sitemap generator for Sphinx";
homepage = "https://github.com/jdillard/sphinx-sitemap";
maintainers = with maintainers; [ ];
license = licenses.mit;
};
};
in {
python310 = prev.python310.override {
packageOverrides = python-final: python-prev: {
sphinx-sitemap = python-module-sphinx-sitemap {
inherit (prev) lib;
inherit (python-prev) buildPythonPackage fetchPypi pytest;
inherit (python-prev.pkgs) sphinx;
};
};
};
}