-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
89 lines (79 loc) · 2.13 KB
/
Copy pathflake.nix
File metadata and controls
89 lines (79 loc) · 2.13 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
alejandra.url = "github:kamadorueda/alejandra/4.0.0";
};
outputs = {
self,
nixpkgs,
alejandra,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pythonEnv = pkgs.python313.withPackages (p: [
p.cairosvg
p.cocotb
p.chevron
p.gitpython
p.klayout
p.matplotlib
p.mistune
p.pip
p.pyaml
p.requests
p.pytest
p.gdstk
]);
in {
devShells.${system}.default = pkgs.mkShell {
# Use nativeBuildInputs for tools that provide executables
nativeBuildInputs = [
pkgs.bash-completion
pkgs.bzip2
pkgs.cmake
pkgs.coreutils
pkgs.gcc
pkgs.git
pkgs.gnugrep
pkgs.gnumake
pkgs.gnused
pkgs.iverilog
pkgs.jdk25
pkgs.klayout
pkgs.librelane
pkgs.magic-vlsi
pkgs.mill
pkgs.netgen-vlsi
pkgs.openroad
pkgs.pandoc
pkgs.pkg-config
pkgs.typst
pkgs.verilator
pkgs.which
pkgs.yosys
pythonEnv
];
shellHook = ''
export GONSOLO_PROJECT="borg_peripheral"
# PURE MODE COMPATIBILITY:
# 1. Mill/Java require a HOME to write lockfiles and caches.
# If we are in --ignore-environment, HOME is empty.
if [ -z "$HOME" ] || [ "$HOME" = "/" ]; then
export HOME=$(pwd)/.nix-home
mkdir -p $HOME
echo "Notice: Pure mode detected. Using local $HOME for caches."
fi
# 2. Point to the JDK25 home so Java apps don't have to search the PATH
export JAVA_HOME=${pkgs.jdk25}
echo "Entering $GONSOLO_PROJECT development shell..."
# Create a bin directory in our local nix-home
mkdir -p $HOME/bin
# Link native yosys to the name the python script is looking for
ln -sf ${pkgs.yosys}/bin/yosys $HOME/bin/yowasp-yosys
# Ensure our shim is at the front of the PATH
export PATH="$HOME/bin:$PATH"
'';
};
formatter.${system} = alejandra.defaultPackage.${system};
};
}