forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgs.nix
51 lines (46 loc) · 1.56 KB
/
pkgs.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
system,
nixpkgs,
}:
let
# FIXME:
# Building the docs evaluates many package-option defaults, some of which are unfree.
# This usually happens when we include the package option value in another option's default without
# using a literalExpression defaultText.
config = {
allowUnfree = true;
};
# Extend nixpkg's lib, so that we can handle recursive leaf types such as `either`
libOverlay = final: prev: {
types = prev.types // {
either =
t1: t2:
prev.types.either t1 t2
// {
getSubOptions = prefix: t1.getSubOptions prefix // t2.getSubOptions prefix;
};
};
};
# Extended nixpkgs instance, with patches to nixos-render-docs
overlay = final: prev: {
lib = prev.lib.extend libOverlay;
nixos-render-docs = prev.nixos-render-docs.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [
(final.python3.pkgs.callPackage ./gfm-alerts-to-admonitions {
# Use the same override as `nixos-render-docs` does, to avoid "duplicate dependency" errors
markdown-it-py = final.python3.pkgs.markdown-it-py.overridePythonAttrs { doCheck = false; };
})
];
patches = old.patches or [ ] ++ [
# Adds support for GFM-style admonitions in rendered commonmark
./0001-nixos-render-docs-Output-GFM-admonition.patch
# Adds support for parsing GFM-style admonitions
./0002-nixos-render-docs-Support-gfm-style-admonitions.patch
];
});
};
in
import nixpkgs {
inherit config system;
overlays = [ overlay ];
}