groovylight/flake.nix
Saji 7e41e6e2f3
All checks were successful
Unit Tests / Test (push) Successful in 2m15s
make flake use custom amaranth
2024-09-26 10:34:07 -05:00

91 lines
2.2 KiB
Nix

{
description = "ECP5 toolchain template project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
overlays.default = import ./python.nix;
};
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
let
toolchain-pkgs = with pkgs; [
yosys
nextpnr
trellis
openfpgaloader
];
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [self.overlays.default];
config.allowUnfree = true;
};
formatter = pkgs.nixfmt-rfc-style;
packages.default = pkgs.python3.pkgs.buildPythonPackage {
name = "groovylight";
version = "0.0.1";
src = ./.;
format = "pyproject";
build-system = [ pkgs.python3.pkgs.pdm-backend ];
propagatedBuildInputs = [
pkgs.python3.pkgs.amaranth
pkgs.python3.pkgs.amaranth-boards
];
doCheck = true;
dontCheckRuntimeDeps = 1; # nightly amaranth doesn't pass
nativeCheckInputs =
with pkgs;
[
python3.pkgs.pytestCheckHook
]
++ toolchain-pkgs;
};
devShells.default = pkgs.mkShell {
packages =
with pkgs;
[
(python3.withPackages (
pypkgs: with pypkgs; [
amaranth
amaranth-boards
self'.packages.default
]
))
ecpdap # easier to poke probes.
]
++ toolchain-pkgs;
};
};
};
}