|
3 | 3 |
|
4 | 4 | inputs = { |
5 | 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; |
6 | | - lowrisc_fusesoc_src = { url = "github:lowRISC/fusesoc?ref=ot-0.2"; flake = false; }; |
7 | | - lowrisc_edalize_src = { url = "github:lowRISC/edalize?ref=ot-0.2"; flake = false; }; |
| 6 | + lowrisc_fusesoc_src = { |
| 7 | + url = "github:lowRISC/fusesoc?ref=ot-0.2"; |
| 8 | + flake = false; |
| 9 | + }; |
| 10 | + lowrisc_edalize_src = { |
| 11 | + url = "github:lowRISC/edalize?ref=ot-0.2"; |
| 12 | + flake = false; |
| 13 | + }; |
8 | 14 | }; |
9 | 15 |
|
10 | | - outputs = {self, nixpkgs, |
11 | | - lowrisc_fusesoc_src, lowrisc_edalize_src, |
12 | | - }: |
13 | | - let |
14 | | - system = "x86_64-linux"; |
15 | | - pkgs = import nixpkgs { |
16 | | - inherit system; |
17 | | - config = { allowUnfree = true; }; |
18 | | - }; |
19 | | - |
20 | | - lowRISC_python_overrides = pfinal: pprev: { |
21 | | - fusesoc = pprev.fusesoc.overridePythonAttrs (oldAttrs: { |
22 | | - version = "0.3.3.dev"; |
23 | | - src = lowrisc_fusesoc_src; |
24 | | - }); |
25 | | - edalize = pprev.edalize.overridePythonAttrs (oldAttrs: { |
26 | | - version = "0.3.3.dev"; |
27 | | - src = lowrisc_edalize_src; |
28 | | - }); |
29 | | - }; |
| 16 | + outputs = { |
| 17 | + self, |
| 18 | + nixpkgs, |
| 19 | + lowrisc_fusesoc_src, |
| 20 | + lowrisc_edalize_src, |
| 21 | + }: let |
| 22 | + system = "x86_64-linux"; |
| 23 | + pkgs = import nixpkgs { |
| 24 | + inherit system; |
| 25 | + config = {allowUnfree = true;}; |
| 26 | + }; |
30 | 27 |
|
31 | | - lowRISC_spike_override = final: prev: { |
32 | | - riscv-isa-sim = prev.riscv-isa-sim.overrideAttrs (oldAttrs: rec { |
33 | | - version = "ibex-cosim-v0.3"; |
34 | | - src = pkgs.fetchFromGitHub { |
35 | | - owner = "lowrisc"; |
36 | | - repo = oldAttrs.pname; |
37 | | - rev = version; |
38 | | - sha256 = "sha256-pKuOpzybOI8UqWV1TSFq4hqTHf7Bft/3WL19fRpwmfU="; |
39 | | - }; |
40 | | - }); |
41 | | - }; |
| 28 | + lowRISC_python_overrides = pfinal: pprev: { |
| 29 | + fusesoc = pprev.fusesoc.overridePythonAttrs (oldAttrs: { |
| 30 | + version = "0.3.3.dev"; |
| 31 | + src = lowrisc_fusesoc_src; |
| 32 | + }); |
| 33 | + edalize = pprev.edalize.overridePythonAttrs (oldAttrs: { |
| 34 | + version = "0.3.3.dev"; |
| 35 | + src = lowrisc_edalize_src; |
| 36 | + }); |
| 37 | + }; |
42 | 38 |
|
43 | | - # Using requireFile prevents rehashing each time. |
44 | | - # This saves much seconds during rebuilds. |
45 | | - vivado_bundled_installer_src = pkgs.requireFile rec { |
46 | | - name = "vivado_bundled.tar.gz"; |
47 | | - sha256 = "1yxx6crvawhzvary9js0m8bzm35vv6pzfqdkv095r84lb13fyp7b"; |
48 | | - # Print the following message if the name / hash are not |
49 | | - # found in the store. |
50 | | - message = '' |
51 | | - requireFile : |
52 | | - file/dir not found in /nix/store |
53 | | - file = ${name} |
54 | | - hash = ${sha256} |
| 39 | + lowRISC_spike_override = final: prev: { |
| 40 | + riscv-isa-sim = prev.riscv-isa-sim.overrideAttrs (oldAttrs: rec { |
| 41 | + version = "ibex-cosim-v0.3"; |
| 42 | + src = pkgs.fetchFromGitHub { |
| 43 | + owner = "lowrisc"; |
| 44 | + repo = oldAttrs.pname; |
| 45 | + rev = version; |
| 46 | + sha256 = "sha256-pKuOpzybOI8UqWV1TSFq4hqTHf7Bft/3WL19fRpwmfU="; |
| 47 | + }; |
| 48 | + }); |
| 49 | + }; |
55 | 50 |
|
56 | | - This nix expression requires that ${name} is already part of the store. |
57 | | - - Login to xilinx.com |
58 | | - - Download Unified Installer from https://www.xilinx.com/support/download.html, |
59 | | - - Run installer, specify a 'Download Image (Install Seperately)' |
60 | | - - Gzip the bundled installed image directory |
61 | | - - Rename the file to ${name} |
62 | | - - Add it to the nix store with |
63 | | - nix-prefetch-url --type sha256 file:/path/to/${name} |
64 | | - - Change the sha256 key above to $HASH |
65 | | - ''; |
66 | | - }; |
| 51 | + # Using requireFile prevents rehashing each time. |
| 52 | + # This saves much seconds during rebuilds. |
| 53 | + vivado_bundled_installer_src = pkgs.requireFile rec { |
| 54 | + name = "vivado_bundled.tar.gz"; |
| 55 | + sha256 = "1yxx6crvawhzvary9js0m8bzm35vv6pzfqdkv095r84lb13fyp7b"; |
| 56 | + # Print the following message if the name / hash are not |
| 57 | + # found in the store. |
| 58 | + message = '' |
| 59 | + requireFile : |
| 60 | + file/dir not found in /nix/store |
| 61 | + file = ${name} |
| 62 | + hash = ${sha256} |
67 | 63 |
|
68 | | - vivado = pkgs.callPackage (import ./vivado.nix) { |
69 | | - # We need to prepare the pre-downloaded installer to |
70 | | - # execute within a nix build. Make use of the included java deps, |
71 | | - # but we still need to do a little patching to make it work. |
72 | | - vivado-src = pkgs.stdenv.mkDerivation rec { |
73 | | - pname = "vivado_src"; |
74 | | - version = "2022.2"; |
75 | | - src = vivado_bundled_installer_src; |
76 | | - postPatch = '' |
77 | | - patchShebangs . |
78 | | - patchelf \ |
79 | | - --set-interpreter $(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker) \ |
80 | | - tps/lnx64/jre*/bin/java |
81 | | - ''; |
82 | | - dontBuild = true; dontFixup = true; |
83 | | - installPhase = '' |
84 | | - mkdir -p $out |
85 | | - cp -R * $out |
86 | | - ''; |
87 | | - }; |
88 | | - }; |
| 64 | + This nix expression requires that ${name} is already part of the store. |
| 65 | + - Login to xilinx.com |
| 66 | + - Download Unified Installer from https://www.xilinx.com/support/download.html, |
| 67 | + - Run installer, specify a 'Download Image (Install Seperately)' |
| 68 | + - Gzip the bundled installed image directory |
| 69 | + - Rename the file to ${name} |
| 70 | + - Add it to the nix store with |
| 71 | + nix-prefetch-url --type sha256 file:/path/to/${name} |
| 72 | + - Change the sha256 key above to $HASH |
| 73 | + ''; |
| 74 | + }; |
89 | 75 |
|
90 | | - in |
91 | | - { |
92 | | - overlay_pkgs = pkgs.lib.composeManyExtensions [ |
93 | | - (import ./overlay.nix) |
94 | | - lowRISC_spike_override |
95 | | - (final: prev: { |
96 | | - inherit vivado; |
97 | | - }) |
98 | | - ]; |
99 | | - overlay_python = pkgs.lib.composeManyExtensions [ |
100 | | - (import ./python-overlay.nix) |
101 | | - lowRISC_python_overrides |
102 | | - ]; |
| 76 | + vivado = pkgs.callPackage (import ./vivado.nix) { |
| 77 | + # We need to prepare the pre-downloaded installer to |
| 78 | + # execute within a nix build. Make use of the included java deps, |
| 79 | + # but we still need to do a little patching to make it work. |
| 80 | + vivado-src = pkgs.stdenv.mkDerivation rec { |
| 81 | + pname = "vivado_src"; |
| 82 | + version = "2022.2"; |
| 83 | + src = vivado_bundled_installer_src; |
| 84 | + postPatch = '' |
| 85 | + patchShebangs . |
| 86 | + patchelf \ |
| 87 | + --set-interpreter $(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker) \ |
| 88 | + tps/lnx64/jre*/bin/java |
| 89 | + ''; |
| 90 | + dontBuild = true; |
| 91 | + dontFixup = true; |
| 92 | + installPhase = '' |
| 93 | + mkdir -p $out |
| 94 | + cp -R * $out |
| 95 | + ''; |
103 | 96 | }; |
| 97 | + }; |
| 98 | + in { |
| 99 | + overlay_pkgs = pkgs.lib.composeManyExtensions [ |
| 100 | + (import ./overlay.nix) |
| 101 | + lowRISC_spike_override |
| 102 | + (final: prev: { |
| 103 | + inherit vivado; |
| 104 | + }) |
| 105 | + ]; |
| 106 | + overlay_python = pkgs.lib.composeManyExtensions [ |
| 107 | + (import ./python-overlay.nix) |
| 108 | + lowRISC_python_overrides |
| 109 | + ]; |
| 110 | + }; |
104 | 111 | } |
0 commit comments