wrpll-simulation/flake.nix

53 lines
1.8 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 ];
});
});
};
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
};
};
}