mirror of
https://github.com/nix-dot-dev/nix.dev.git
synced 2024-09-11 21:47:12 +03:00
Switch from poetry to nixpkgs
@alejandrosame: fixed merge conflicts
This commit is contained in:
parent
4a829fd889
commit
c3c97f8ee2
26
flake.lock
26
flake.lock
@ -34,34 +34,10 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"poetry2nix": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1685418143,
|
||||
"narHash": "sha256-q2ORekI8au0pGMtOLQI8WMCJBxjzWgYRHpiEOVSBq3w=",
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"rev": "f11cc14e28078c701072f2d1fb34a6495c9376b1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"poetry2nix": "poetry2nix"
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
90
flake.nix
90
flake.nix
@ -3,82 +3,34 @@
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.poetry2nix = {
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/poetry2nix";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
||||
outputs = { self, nixpkgs, flake-utils}:
|
||||
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 = super.sphinx.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ];
|
||||
}
|
||||
);
|
||||
|
||||
accessible-pygments = super.accessible-pygments.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
sphinx-sitemap = super.sphinx-sitemap.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
sphinx-notfound-page = super.sphinx-notfound-page.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ super.flit-core ];
|
||||
}
|
||||
);
|
||||
in {
|
||||
defaultPackage = pkgs.stdenv.mkDerivation {
|
||||
name = "nix-dev";
|
||||
src = self;
|
||||
buildInputs = with pkgs.python310Packages; [
|
||||
livereload
|
||||
myst-parser
|
||||
sphinx
|
||||
sphinx-book-theme
|
||||
sphinx-copybutton
|
||||
sphinx-design
|
||||
black
|
||||
];
|
||||
buildPhase = ''
|
||||
make html
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -R build/html/* $out/
|
||||
'';
|
||||
};
|
||||
in
|
||||
rec {
|
||||
packages = flake-utils.lib.flattenTree {
|
||||
nix-dev-pyenv = pkgs.poetry2nix.mkPoetryEnv {
|
||||
projectDir = self;
|
||||
python = pkgs.python39;
|
||||
overrides = [
|
||||
(self: super: {
|
||||
pydata-sphinx-theme = super.pydata-sphinx-theme.override { preferWheel = true; };
|
||||
sphinx-book-theme = super.sphinx-book-theme.override { preferWheel = true; };
|
||||
})
|
||||
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;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user