-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (62 loc) · 2.25 KB
/
flake.nix
File metadata and controls
70 lines (62 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "OpenRAM development environment (Nix)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in
{
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
# Pip wheels (e.g. numpy in .venv) need common shared libs at runtime on Nix.
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc.lib
pkgs.zlib
];
packages = [
# FOSSI PDK ciel (nixpkgs `ciel` is unrelated: AOSC ciel-rs, wants root)
pkgs.pdk-ciel
# EDA / verification tools
pkgs.klayout
pkgs.magic-vlsi
# Use the LVS-focused netgen package; the generic netgen package
# may require a local build that can fail on some hosts.
pkgs.netgen-vlsi
pkgs.ngspice
pkgs.iverilog
pkgs.xyce
pkgs.xyce-parallel
pkgs.trilinos
pkgs.trilinos-mpi
# Dev conveniences
pkgs.git
pkgs.gnumake
pkgs.curl
# Python + pip (user installs, venvs; prefer Nix where possible)
pkgs.python3
pkgs.python3Packages.pip
];
shellHook = ''
export OPENRAM_USE_CONDA=0
# PEP 668: Nix `python3` is externally managed. Put a repo-local venv first on PATH
# so `make library` uses it. Use $PWD (writable checkout), not `toString self` (nix store).
OPENRAM_VENV="''${OPENRAM_HOME}/.venv"
if [ ! -x "$OPENRAM_VENV/bin/python3" ]; then
echo "OpenRAM: creating venv at $OPENRAM_VENV"
${pkgs.python3}/bin/python3 -m venv "$OPENRAM_VENV"
fi
export VIRTUAL_ENV="$OPENRAM_VENV"
export PATH="$OPENRAM_VENV/bin:$PATH"
echo "OpenRAM: Nix devShell (venv on PATH: $OPENRAM_VENV)"
'';
};
});
};
}