forked from NixOS/nix.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
61 lines (56 loc) · 1.81 KB
/
flake.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
52
53
54
55
56
57
58
59
60
61
{
description = "nix.dev static website";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
inputs.flake-utils.url = "github:numtide/flake-utils/master";
inputs.poetry2nix = {
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/poetry2nix/master";
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ poetry2nix.overlay ];
};
poetryOverrides = self: super: {
# Refs https://github.com/nix-community/poetry2nix/issues/218#issuecomment-981615612
typing-extensions = super.typing-extensions.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ];
}
);
sphinx-design = super.sphinx-design.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ];
}
);
};
in rec {
packages = flake-utils.lib.flattenTree {
nix-dev-pyenv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = self;
python = pkgs.python39;
overrides = [
pkgs.poetry2nix.defaultPoetryOverrides
poetryOverrides
];
};
nix-dev-html = pkgs.stdenv.mkDerivation {
name = "nix-dev";
src = self;
buildInputs = [ packages.nix-dev-pyenv ];
buildPhase = ''
make html
'';
installPhase = ''
mkdir -p $out
cp -R build/html/* $out/
'';
};
};
defaultPackage = packages.nix-dev-html;
}
);
}