{
description = "NSV stopwatch";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
poetry2nix.url = "github:nix-community/poetry2nix";
};
outputs = { self, poetry2nix, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryPackages defaultPoetryOverrides;
poetryEnv = mkPoetryPackages {
projectDir = ./.;
python = pkgs.python311;
overrides = defaultPoetryOverrides.extend
(self: super: {
vunit-hdl = super.vunit-hdl.overridePythonAttrs(
attrs: {
buildInputs = (attrs.buildInputs or []) ++ [ super.setuptools ];
}
);
});
};
vhdl-toolchain = pkgs.symlinkJoin {
name = "vhdl-toolchain";
meta.mainProgram = "nvc";
paths = [
pkgs.ghdl
pkgs.nvc
poetryEnv.python
poetryEnv.poetryPackages
];
};
in {
packages.${system}.default = vhdl-toolchain;
devShells.${system}.default = pkgs.mkShell {
nativeBuildInputs = [
vhdl-toolchain
pkgs.vhdl-ls
pkgs.gtkwave
];
VUNIT_SIMULATOR = "nvc";
};
};
}