From 6b2bf81bc32285082e3dd32f0bccb952efb3e1ab Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Tue, 1 Apr 2025 15:53:30 +0100 Subject: [PATCH 1/4] Changed lowrisc_pkgs -> lowriscPkgs This is more idomatic; variables should be cammel case. --- flake.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 6906e4ee..e9771f4c 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,7 @@ }) ]; }; - lowrisc_pkgs = import ./pkgs {inherit pkgs inputs;}; + lowriscPkgs = import ./pkgs {inherit pkgs inputs;}; in { checks = { license = pkgs.stdenv.mkDerivation { @@ -73,15 +73,15 @@ ''; }; }; - packages = flake-utils.lib.filterPackages system lowrisc_pkgs; + packages = flake-utils.lib.filterPackages system lowriscPkgs; devShells = { opentitan = pkgs.callPackage ./dev/opentitan.nix { - inherit (lowrisc_pkgs) ncurses5-fhs ncurses6-fhs bazel_ot verilator_ot python_ot verible_ot; + inherit (lowriscPkgs) ncurses5-fhs ncurses6-fhs bazel_ot verilator_ot python_ot verible_ot; }; cheriot = pkgs.mkShell { name = "cheriot"; packages = - (with lowrisc_pkgs; [llvm_cheriot xmake]) + (with lowriscPkgs; [llvm_cheriot xmake]) ++ (with pkgs; [ gnumake magic-enum @@ -89,7 +89,7 @@ ]); }; caliptra = pkgs.callPackage ./dev/caliptra.nix { - inherit (lowrisc_pkgs) verilator_caliptra riscv64-gcc_caliptra; + inherit (lowriscPkgs) verilator_caliptra riscv64-gcc_caliptra; }; }; formatter = pkgs.alejandra; From b7bb91740592698106e4d058a5489e0f13a3bc90 Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Tue, 1 Apr 2025 15:56:17 +0100 Subject: [PATCH 2/4] Changed llvm-cheriot identifier. The pname of this derivation is 'llvm-cheriot', suggesting this is a distinct package from 'llvm'. Changed the identifier to match. Note: Underscore is usually used to deliminate name from version. --- flake.nix | 2 +- pkgs/default.nix | 2 +- pkgs/{llvm_cheriot.nix => llvm-cheriot.nix} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename pkgs/{llvm_cheriot.nix => llvm-cheriot.nix} (100%) diff --git a/flake.nix b/flake.nix index e9771f4c..37578090 100644 --- a/flake.nix +++ b/flake.nix @@ -81,7 +81,7 @@ cheriot = pkgs.mkShell { name = "cheriot"; packages = - (with lowriscPkgs; [llvm_cheriot xmake]) + (with lowriscPkgs; [llvm-cheriot xmake]) ++ (with pkgs; [ gnumake magic-enum diff --git a/pkgs/default.nix b/pkgs/default.nix index b051e16c..844ee202 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -18,7 +18,7 @@ # CherIoT packages spike-ibex-cosim = pkgs.callPackage ./spike.nix {}; - llvm_cheriot = pkgs.callPackage ./llvm_cheriot.nix {}; + llvm-cheriot = pkgs.callPackage ./llvm-cheriot.nix {}; xmake = pkgs.callPackage ./xmake {}; cheriot-sim = pkgs.callPackage ./cheriot-sim.nix {}; cheriot-audit = pkgs.callPackage ./cheriot-audit.nix {}; diff --git a/pkgs/llvm_cheriot.nix b/pkgs/llvm-cheriot.nix similarity index 100% rename from pkgs/llvm_cheriot.nix rename to pkgs/llvm-cheriot.nix From ecea8955489e146a7b606369d12f7cc4d8a3581e Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Tue, 1 Apr 2025 16:03:12 +0100 Subject: [PATCH 3/4] Renamed python_ot to python-ot This isn't the 'ot' version of python. Rather, it is a the python environment for opentitan, so ot should be part of the package name. This changes the name to reflect that. --- dev/opentitan.nix | 6 +++--- flake.nix | 2 +- pkgs/default.nix | 2 +- pkgs/{python_ot => python-ot}/default.nix | 0 pkgs/{python_ot => python-ot}/pyproject.toml | 0 pkgs/{python_ot => python-ot}/uv.lock | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename pkgs/{python_ot => python-ot}/default.nix (100%) rename pkgs/{python_ot => python-ot}/pyproject.toml (100%) rename pkgs/{python_ot => python-ot}/uv.lock (100%) diff --git a/dev/opentitan.nix b/dev/opentitan.nix index 72118be2..e3706850 100644 --- a/dev/opentitan.nix +++ b/dev/opentitan.nix @@ -6,7 +6,7 @@ ncurses5-fhs, ncurses6-fhs, bazel_ot, - python_ot, + python-ot, verilator_ot, verible_ot, edaTools ? [], @@ -18,7 +18,7 @@ ... }: let # These dependencies are required for building user DPI C/C++ code, and cosimulation models. - edaExtraDeps = with pkgs; [elfutils openssl python_ot]; + edaExtraDeps = with pkgs; [elfutils openssl python-ot]; gcc-patched = wrapCCWith { cc = gcc-unwrapped; @@ -52,7 +52,7 @@ in # Python dependencies uv - python_ot + python-ot # For serde-annotate which can be built with just cargo rustup diff --git a/flake.nix b/flake.nix index 37578090..426198b5 100644 --- a/flake.nix +++ b/flake.nix @@ -76,7 +76,7 @@ packages = flake-utils.lib.filterPackages system lowriscPkgs; devShells = { opentitan = pkgs.callPackage ./dev/opentitan.nix { - inherit (lowriscPkgs) ncurses5-fhs ncurses6-fhs bazel_ot verilator_ot python_ot verible_ot; + inherit (lowriscPkgs) ncurses5-fhs ncurses6-fhs bazel_ot verilator_ot python-ot verible_ot; }; cheriot = pkgs.mkShell { name = "cheriot"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 844ee202..270f7e7e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,7 +12,7 @@ # OpenTitan packages verilator_ot = import ./verilator {inherit pkgs;}; - python_ot = pkgs.callPackage ./python_ot {inherit inputs;}; + python-ot = pkgs.callPackage ./python-ot {inherit inputs;}; bazel_ot = pkgs.callPackage ./bazel_ot {}; verible_ot = pkgs.callPackage ./verible.nix {}; diff --git a/pkgs/python_ot/default.nix b/pkgs/python-ot/default.nix similarity index 100% rename from pkgs/python_ot/default.nix rename to pkgs/python-ot/default.nix diff --git a/pkgs/python_ot/pyproject.toml b/pkgs/python-ot/pyproject.toml similarity index 100% rename from pkgs/python_ot/pyproject.toml rename to pkgs/python-ot/pyproject.toml diff --git a/pkgs/python_ot/uv.lock b/pkgs/python-ot/uv.lock similarity index 100% rename from pkgs/python_ot/uv.lock rename to pkgs/python-ot/uv.lock From 16521b47cac261771572aa10cd2accc6503014d6 Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Tue, 1 Apr 2025 16:07:27 +0100 Subject: [PATCH 4/4] Renamed bazel_ot to bazelisk This derivation isn't the 'ot' version of bazel. It's just bazelisk, with the upstream's bazel shell autocompletions. --- dev/opentitan.nix | 4 ++-- flake.nix | 2 +- pkgs/{bazel_ot => bazelisk}/default.nix | 0 pkgs/default.nix | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename pkgs/{bazel_ot => bazelisk}/default.nix (100%) diff --git a/dev/opentitan.nix b/dev/opentitan.nix index e3706850..2c48a5f2 100644 --- a/dev/opentitan.nix +++ b/dev/opentitan.nix @@ -5,7 +5,7 @@ pkgs, ncurses5-fhs, ncurses6-fhs, - bazel_ot, + bazelisk, python-ot, verilator_ot, verible_ot, @@ -46,7 +46,7 @@ in targetPkgs = _: with pkgs; [ - bazel_ot + bazelisk verilator_ot verible_ot diff --git a/flake.nix b/flake.nix index 426198b5..a6857081 100644 --- a/flake.nix +++ b/flake.nix @@ -76,7 +76,7 @@ packages = flake-utils.lib.filterPackages system lowriscPkgs; devShells = { opentitan = pkgs.callPackage ./dev/opentitan.nix { - inherit (lowriscPkgs) ncurses5-fhs ncurses6-fhs bazel_ot verilator_ot python-ot verible_ot; + inherit (lowriscPkgs) ncurses5-fhs ncurses6-fhs bazelisk verilator_ot python-ot verible_ot; }; cheriot = pkgs.mkShell { name = "cheriot"; diff --git a/pkgs/bazel_ot/default.nix b/pkgs/bazelisk/default.nix similarity index 100% rename from pkgs/bazel_ot/default.nix rename to pkgs/bazelisk/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 270f7e7e..7042b51a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,7 +13,7 @@ # OpenTitan packages verilator_ot = import ./verilator {inherit pkgs;}; python-ot = pkgs.callPackage ./python-ot {inherit inputs;}; - bazel_ot = pkgs.callPackage ./bazel_ot {}; + bazelisk = pkgs.callPackage ./bazelisk {}; verible_ot = pkgs.callPackage ./verible.nix {}; # CherIoT packages