62 lines
2.1 KiB
Nix
62 lines
2.1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
|
poetry2nix = {
|
|
url = "github:nix-community/poetry2nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
outputs = { nixpkgs, poetry2nix, ... }:
|
|
let
|
|
|
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
|
poetry2nixlib = (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; });
|
|
|
|
poetryEnv = poetry2nixlib.mkPoetryEnv {
|
|
python = pkgs.python3;
|
|
projectDir = ./.;
|
|
pyproject = ./pyproject.toml;
|
|
poetrylock = ./poetry.lock;
|
|
overrides = poetry2nixlib.overrides.withDefaults (self: super: {
|
|
trace-updater = super.trace-updater.overridePythonAttrs (
|
|
# ModuleNotFoundError: No module named 'setuptools'
|
|
old: {
|
|
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
|
|
});
|
|
tsdownsample = super.tsdownsample.override {
|
|
# for bypassing building with maturin
|
|
preferWheel = true;
|
|
};
|
|
plotly-resampler = super.plotly-resampler.overridePythonAttrs (
|
|
# ModuleNotFoundError: No module named 'poetry'
|
|
old: {
|
|
buildInputs = (old.buildInputs or [ ]) ++ [ super.poetry-core ];
|
|
});
|
|
flake8-black = super.flake8-black.overridePythonAttrs (
|
|
# ModuleNotFoundError: No module named 'setuptools'
|
|
old: {
|
|
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
|
|
});
|
|
control = super.control.overridePythonAttrs (
|
|
# ModuleNotFoundError: No module named 'setuptools'
|
|
old: {
|
|
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
|
|
});
|
|
jupytext = super.jupytext.override {
|
|
# bypass error: metadata-generation-failed
|
|
preferWheel = true;
|
|
};
|
|
});
|
|
};
|
|
|
|
in rec {
|
|
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
|
|
devShell.x86_64-linux = pkgs.mkShell {
|
|
name = "WRPLL-sim";
|
|
venvDir = "./.venv";
|
|
buildInputs = with pkgs; [ poetryEnv poetry nixpkgs-fmt ];
|
|
|
|
};
|
|
};
|
|
}
|