Skip to content

Commit

Permalink
Add nix flake and lock file. Add nix build step. Pending nix flake up…
Browse files Browse the repository at this point in the history
…date step
  • Loading branch information
RCoeurjoly committed May 8, 2024
1 parent bdce7fa commit 1c89e2a
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/nix-github-actions.yml
Original file line number Diff line number Diff line change
@@ -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'
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "A nix flake for the Yosys synthesis suite";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
customYosys = pkgs.clangStdenv.mkDerivation {
name = "yosys";
src = ./. ;
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git ];
checkInputs = with pkgs; [ gtest ];
propagatedBuildInputs = with pkgs; [ abc-verifier ];
preConfigure = "make config-clang";
checkTarget = "test";
installPhase = ''
make install PREFIX=$out
'';
buildPhase = ''
make -j$(nproc)
'';
meta = with pkgs.lib; {
description = "Yosys Open SYnthesis Suite";
homepage = "https://yosyshq.net/yosys/";
license = licenses.isc;
maintainers = with maintainers; [ ];
};
};
in {
packages.default = customYosys;
defaultPackage = customYosys;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier ];
};
}
);
}

0 comments on commit 1c89e2a

Please sign in to comment.