yosys/flake.nix

45 lines
1.4 KiB
Nix
Raw Normal View History

{
description = "A nix flake for the Yosys synthesis suite";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
customYosys = pkgs.clangStdenv.mkDerivation {
name = "yosys";
src = ./. ;
2024-05-07 21:47:40 -05:00
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git pkg-configUpstream ];
checkInputs = with pkgs; [ gtest ];
propagatedBuildInputs = with pkgs; [ abc-verifier ];
preConfigure = "make config-clang";
checkTarget = "test";
installPhase = ''
make install PREFIX=$out
'';
buildPhase = ''
make -j$(nproc)
'';
meta = with pkgs.lib; {
description = "Yosys Open SYnthesis Suite";
homepage = "https://yosyshq.net/yosys/";
license = licenses.isc;
maintainers = with maintainers; [ ];
};
};
in {
packages.default = customYosys;
defaultPackage = customYosys;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier ];
};
}
);
}