wrpll-simulation/flake.nix

62 lines
2.1 KiB
Nix
Raw Normal View History

2023-11-16 11:53:22 +08:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, poetry2nix, ... }:
2023-11-16 11:53:22 +08:00
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 ];
});
2024-02-19 12:29:56 +08:00
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 {
2023-11-16 11:53:22 +08:00
name = "WRPLL-sim";
venvDir = "./.venv";
buildInputs = with pkgs; [ poetryEnv poetry nixpkgs-fmt ];
2023-11-16 11:53:22 +08:00
};
};
}