Skip to content

Conversation

@harryprayiv
Copy link

I took the liberty of non-destructively nixifying this incredibly cool project (as is my signature move).

@sorki
Copy link

sorki commented Oct 4, 2023

It would be nice to be able to build a full soc binaries using Nix, not just a Haskell libraries.

Haskell libs are easy to build using just cabal2Nix (no need to introduce haskell-nix and hix)

My default.nix from a like a year ago (currently seems to fail building clash-prelude)

{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;

  lion = pkgs.haskellPackages.callCabal2nix "lion" src { };
  lion-soc = pkgs.haskellPackages.callCabal2nix "lion-soc" "${src}/lion-soc" { inherit lion; };
in
  { inherit lion lion-soc; }

but more importantly a shell.nix that's quite useful

{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
  packages = with pkgs; [
    yosys
    nextpnr
    icestorm
    pkgsCross.riscv64-embedded.stdenv.cc
    cabal-install
  ];

  inputsFrom = [  ];

  shellHook = ''
    echo "Lion SoC shell"
    echo ""
    echo "Build using"
    echo "# cd lion-soc"
    echo "# cabal run soc"
  '';
}

I didn't create a PR of this because I wanted to be able to nix-build a full SoC binary and got stuck somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants