Browse Source

use overlay instead of passing llvm/rustc/cargo around

pull/1/head
parent
commit
85f7b2bf15
  1. 15
      derivations.nix
  2. 7
      overlay.nix
  3. 7
      release.nix
  4. 3
      shell-firmware.nix

15
derivations.nix

@ -16,18 +16,5 @@ rec {
heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; };
binutils-riscv = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv32"; };
llvm_7 = pkgs.llvm_7.overrideAttrs(oa: {
name = oa.name + "-riscv";
cmakeFlags = oa.cmakeFlags ++ ["-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV"];
});
rustc = (pkgs.rustc.overrideAttrs(oa: {
name = "${oa.pname}-${oa.version}-riscv";
})).override {
inherit llvm_7;
pkgsBuildBuild = pkgs.pkgsBuildBuild // { inherit llvm_7; };
pkgsBuildHost = pkgs.pkgsBuildHost // { inherit llvm_7; };
pkgsBuildTarget = pkgs.pkgsBuildTarget // { inherit llvm_7; };
};
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { inherit rustc; };
cargo = pkgs.cargo.override { inherit rustc; };
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { };
}

7
overlay.nix

@ -0,0 +1,7 @@
self: super:
{
llvm_7 = super.llvm_7.overrideAttrs(oa: {
name = oa.name + "-riscv";
cmakeFlags = oa.cmakeFlags ++ ["-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV"];
});
}

7
release.nix

@ -1,7 +1,12 @@
{ pkgs ? import <nixpkgs> {}}:
{ }:
let
pkgs = import <nixpkgs> { overlays = [ import ./overlay.nix ]; };
derivations = import ./derivations.nix { inherit pkgs; };
jobs = derivations // {
rustc = pkgs.rustc;
cargo = pkgs.cargo;
cargo-vendor = pkgs.cargo-vendor;
helloworld_ecp5 = import ./examples/helloworld_ecp5.nix { inherit pkgs; };
helloworld_kintex7 = import ./examples/helloworld_kintex7.nix { inherit pkgs; };
simplesoc_ecp5 = import ./examples/simplesoc_ecp5.nix { inherit pkgs; };

3
shell-firmware.nix

@ -1,5 +1,6 @@
{ pkgs ? import <nixpkgs> {}}:
{ }:
let
pkgs = import <nixpkgs> { overlays = [ import ./overlay.nix ]; };
hx = import ./derivations.nix { inherit pkgs; };
in
pkgs.mkShell {

Loading…
Cancel
Save