Add devShell to flake.nix. Build every available stable architecture. Remove shell.nix. Add nix github action
This commit is contained in:
parent
4459409d73
commit
8b486df059
13
.github/workflows/nix.yml
vendored
Normal file
13
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
name: "build nix flake"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- uses: cachix/install-nix-action@v25
|
||||||
|
- run: nix build '.?submodules=1'
|
14
flake.nix
14
flake.nix
@ -39,11 +39,17 @@
|
|||||||
myPythonPackages.apycula
|
myPythonPackages.apycula
|
||||||
pkgs.icestorm
|
pkgs.icestorm
|
||||||
pkgs.trellis
|
pkgs.trellis
|
||||||
|
pkgs.tcl
|
||||||
|
pkgs.zlib
|
||||||
|
pkgs.capnproto
|
||||||
|
pkgs.lzma
|
||||||
|
pkgs.tk
|
||||||
|
pkgs.wget
|
||||||
] ++ (pkgs.lib.optional enableGui pkgs.qt6.qtbase)
|
] ++ (pkgs.lib.optional enableGui pkgs.qt6.qtbase)
|
||||||
++ (pkgs.lib.optional pkgs.stdenv.cc.isClang pkgs.llvmPackages.openmp);
|
++ (pkgs.lib.optional pkgs.stdenv.cc.isClang pkgs.llvmPackages.openmp);
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DARCH=generic;ice40;ecp5;gowin"
|
"-DARCH=all"
|
||||||
"-DBUILD_TESTS=ON"
|
"-DBUILD_TESTS=ON"
|
||||||
"-DICESTORM_INSTALL_PREFIX=${pkgs.icestorm}"
|
"-DICESTORM_INSTALL_PREFIX=${pkgs.icestorm}"
|
||||||
"-DTRELLIS_INSTALL_PREFIX=${pkgs.trellis}"
|
"-DTRELLIS_INSTALL_PREFIX=${pkgs.trellis}"
|
||||||
@ -59,11 +65,15 @@
|
|||||||
homepage = "https://github.com/yosyshq/nextpnr";
|
homepage = "https://github.com/yosyshq/nextpnr";
|
||||||
license = licenses.isc;
|
license = licenses.isc;
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
maintainers = with maintainers; [ thoughtpolice emily ];
|
maintainers = with maintainers; [ ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
packages.default = self.packages.${system}.nextpnr;
|
packages.default = self.packages.${system}.nextpnr;
|
||||||
|
|
||||||
|
devShell = pkgs.mkShell {
|
||||||
|
buildInputs = [ self.packages.${system}.default ];
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
48
shell.nix
48
shell.nix
@ -1,48 +0,0 @@
|
|||||||
{ pkgs ? import (fetchTarball https://github.com/NixOS/nixpkgs/archive/23.05.tar.gz) {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
pythonPkgs = pkgs.python3Packages;
|
|
||||||
boostPython = pkgs.boost.override { python = pythonPkgs.python; enablePython = true; };
|
|
||||||
vscode = pkgs.vscode-with-extensions.override {
|
|
||||||
vscodeExtensions = with pkgs.vscode-extensions; [
|
|
||||||
bbenoist.nix
|
|
||||||
ms-vscode.cpptools
|
|
||||||
ms-vscode.cmake-tools
|
|
||||||
twxs.cmake
|
|
||||||
usernamehw.errorlens
|
|
||||||
llvm-vs-code-extensions.vscode-clangd
|
|
||||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
|
||||||
{
|
|
||||||
name = "VerilogHDL";
|
|
||||||
publisher = "mshr-h";
|
|
||||||
version = "1.11.4";
|
|
||||||
sha256 = "sha256-4JY0eaN2IkwHv8u8X6ejDXk6vT1qB4vJjWdIy8b/jj4=";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in pkgs.mkShell {
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
cmake
|
|
||||||
eigen
|
|
||||||
boostPython
|
|
||||||
pythonPkgs.python
|
|
||||||
pythonPkgs.apycula
|
|
||||||
libsForQt5.qt5.qtbase
|
|
||||||
llvmPackages.openmp
|
|
||||||
icestorm
|
|
||||||
trellis
|
|
||||||
mold
|
|
||||||
yosys
|
|
||||||
clang
|
|
||||||
valgrind
|
|
||||||
cling
|
|
||||||
gdb
|
|
||||||
vscode
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
export TRELLIS_INSTALL_PREFIX=${pkgs.trellis}
|
|
||||||
export ICESTORM_INSTALL_PREFIX=${pkgs.icestorm}
|
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";
|
|
||||||
'';
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user