Skip to content

Commit

Permalink
more nix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Oct 10, 2023
1 parent 1f40256 commit fb7b4f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
13 changes: 7 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ with pkgs; with python3.pkgs; buildPythonPackage rec {
tcl
];

propagatedBuildInputs = [
# Tools
openroad
klayout
netgen
includedTools = [
(yosys.withPlugins([
sby
eqy
lighter
ys-ghdl
]))
openroad
klayout
netgen
magic
verilog
verilator
];

propagatedBuildInputs = [
# Python
click
cloup
Expand All @@ -79,7 +80,7 @@ with pkgs; with python3.pkgs; buildPythonPackage rec {
deprecated
immutabledict
libparse
];
] ++ includedTools;

doCheck = false;
checkInputs = [ pytestCheckHook pyfakefs ];
Expand Down
20 changes: 9 additions & 11 deletions docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
# limitations under the License.
{
pkgs ? import ./nix/pkgs.nix {},
openlane-app ? import ./. {},
openlane ? import ./. {},
name ? "ghcr.io/efabless/openlane2",
tag-override ? null
}:

with pkgs; let
olenv = python3.withPackages(ps: with ps; [ openlane-app ]);
in dockerTools.buildImage rec {
with pkgs; dockerTools.buildImage rec {
inherit name;
tag = if tag-override == null then "${openlane-app.version}" else tag-override;
tag = if tag-override == null then "${openlane.version}" else tag-override;

copyToRoot = pkgs.buildEnv {
name = "image-root";
Expand All @@ -40,14 +38,14 @@ in dockerTools.buildImage rec {
cacert
iana-etc

# OpenLane
olenv

# Conveniences
git
neovim
zsh
silver-searcher

# OpenLane
(python3.withPackages(ps: with ps; [ openlane ]))
];

postBuild = ''
Expand All @@ -57,7 +55,7 @@ in dockerTools.buildImage rec {
autoload -U promptinit && promptinit && prompt suse && setopt prompt_sp
autoload -U colors && colors
export PS1=$'%{\033[31m%}OpenLane Container (${openlane-app.version})%{\033[0m%}:%{\033[32m%}%~%{\033[0m%}%% ';
export PS1=$'%{\033[31m%}OpenLane Container (${openlane.version})%{\033[0m%}:%{\033[32m%}%~%{\033[0m%}%% ';
HEREDOC
'';
};
Expand All @@ -70,8 +68,8 @@ in dockerTools.buildImage rec {
"LC_ALL=C.UTF-8"
"LC_CTYPE=C.UTF-8"
"EDITOR=nvim"
"PYTHONPATH=${openlane-app.computed_PYTHONPATH}"
"PATH=${olenv}/bin:${openlane-app.computed_PATH}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
"PYTHONPATH=${openlane.computed_PYTHONPATH}"
"PATH=${openlane}/bin:${openlane.computed_PATH}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
];
};
}
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# limitations under the License.
{
pkgs ? import ./nix/pkgs.nix {},
openlane-app ? import ./. { inherit pkgs; }
openlane ? import ./. { inherit pkgs; }
}:

with pkgs; mkShell {
name = "openlane-shell";

propagatedBuildInputs = [
(python3.withPackages(pp: with pp; [
openlane-app
openlane
pyfakefs
pytest
]))
Expand All @@ -36,5 +36,5 @@ with pkgs; mkShell {
# Docs + Testing
jupyter
graphviz
];
] ++ openlane.includedTools;
}

0 comments on commit fb7b4f7

Please sign in to comment.