2023-11-16 11:53:22 +08:00
|
|
|
{
|
2023-12-13 12:12:17 +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
|
|
|
|
|
2023-12-12 17:05:22 +08:00
|
|
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
2023-12-13 12:12:17 +08:00
|
|
|
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 ];
|
|
|
|
});
|
2024-01-11 17:20:20 +08:00
|
|
|
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 ];
|
|
|
|
});
|
2024-01-22 10:27:02 +08:00
|
|
|
jupytext = super.jupytext.override {
|
|
|
|
# bypass error: metadata-generation-failed
|
|
|
|
preferWheel = true;
|
|
|
|
};
|
2023-12-13 12:12:17 +08:00
|
|
|
});
|
|
|
|
};
|
2023-12-12 17:05:22 +08:00
|
|
|
|
2023-12-13 12:12:17 +08:00
|
|
|
in rec {
|
2023-12-12 17:05:22 +08:00
|
|
|
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";
|
2023-12-05 10:41:58 +08:00
|
|
|
venvDir = "./.venv";
|
2023-12-13 12:12:17 +08:00
|
|
|
buildInputs = with pkgs; [ poetryEnv poetry nixpkgs-fmt ];
|
2023-12-05 10:41:58 +08:00
|
|
|
|
2023-11-16 11:53:22 +08:00
|
|
|
};
|
2023-12-12 17:05:22 +08:00
|
|
|
};
|
|
|
|
}
|