{ inputs = { nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; utils.url = "github:numtide/flake-utils"; }; outputs = inputs: inputs.utils.lib.eachDefaultSystem ( system: let pkgs = import inputs.nixpkgs { localSystem = system; overlays = [ (final: prev: { riscv-bluespec-classic = pkgs.callPackage ( { stdenv, bluespec, nextpnr, openfpgaloader, trellis, which, yosys, TOPMODULE ? "mkTop", makeFlags ? [ ], }: stdenv.mkDerivation { pname = "riscv-bluespec-classic"; version = "0.1.0"; src = ./.; # Versions can be checked with # `nix eval --json ".#bluespec-joh-template.nativeBuildInputs" | nix-shell -p jq --run jq` nativeBuildInputs = [ bluespec nextpnr openfpgaloader trellis which yosys ]; # TODO: Build and install something } ) { }; }) ]; }; in { packages = { default = inputs.self.packages."${system}".riscv-bluespec-classic; riscv-bluespec-classic = pkgs.riscv-bluespec-classic; }; devShells.default = with pkgs; mkShell { inputsFrom = [ riscv-bluespec-classic ]; }; } ); }