groovylight/flake.nix

63 lines
1.5 KiB
Nix
Raw Normal View History

2024-04-19 15:13:39 +00:00
{
description = "ECP5 toolchain template project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
2024-09-25 01:52:44 +00:00
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
2024-04-19 15:13:39 +00:00
let
2024-09-22 15:55:52 +00:00
python-overlay = import ./python.nix;
2024-04-19 15:13:39 +00:00
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 = [
2024-09-22 15:55:52 +00:00
python-overlay
];
2024-04-19 15:13:39 +00:00
}
));
in {
2024-05-26 13:48:38 +00:00
packages = forAllSystems (pkgs: {
2024-09-25 01:52:44 +00:00
niar = pkgs.python3.buildPythonPackage {
name = "niar";
version = pyproject-toml.project.version;
src = ./.;
pyproject = true;
2024-09-22 15:55:52 +00:00
2024-09-25 01:52:44 +00:00
build-system = [pkgs.python3.pdm-backend];
propagatedBuildInpusts = [
pkgs.python3.amaranth
pkgs.python3.amaranth-boards
];
doCheck = true;
nativeCheckInputs = [python3.pkgs.pytestCheckHook];
};
2024-05-26 13:48:38 +00:00
});
2024-04-19 15:13:39 +00:00
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
2024-09-25 01:52:44 +00:00
(python3.withPackages (pypkgs: with pypkgs; [
2024-04-19 15:13:39 +00:00
amaranth
2024-09-25 01:52:44 +00:00
amaranth-boards
2024-04-19 15:13:39 +00:00
]))
yosys
nextpnr
# simulators
2024-09-22 15:55:52 +00:00
iverilog
2024-04-19 15:13:39 +00:00
verilator
# support package
trellis
# loader
openfpgaloader
ecpdap # easier to poke probes.
];
};
});
};
}