{ description = "ECP5 toolchain template project"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; outputs = inputs@{ self, nixpkgs, flake-utils, ... }: let python-overlay = import ./python.nix; systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; forAllSystems = function: nixpkgs.lib.genAttrs systems (system: function ( import nixpkgs { inherit system; config.allowUnfree = true; overlays = [ python-overlay ]; } )); in { packages = forAllSystems (pkgs: { niar = pkgs.python3.buildPythonPackage { name = "niar"; version = pyproject-toml.project.version; src = ./.; pyproject = true; build-system = [pkgs.python3.pdm-backend]; propagatedBuildInpusts = [ pkgs.python3.amaranth pkgs.python3.amaranth-boards ]; doCheck = true; nativeCheckInputs = [python3.pkgs.pytestCheckHook]; }; }); devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ (python3.withPackages (pypkgs: with pypkgs; [ amaranth amaranth-boards ])) yosys nextpnr # simulators iverilog verilator # support package trellis # loader openfpgaloader ecpdap # easier to poke probes. ]; }; }); }; }