diff --git a/flake.lock b/flake.lock index 2a6d737d..d6d60c70 100644 --- a/flake.lock +++ b/flake.lock @@ -18,17 +18,54 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "lowrisc-nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1783357944, + "narHash": "sha256-uvsq+827sCrOUdcALh83bN4ngp6Hms8KdmE9mgEzmIo=", + "owner": "lowRISC", + "repo": "lowrisc-nix", + "rev": "4db34a757ba4f21ea82846ff4f43e6f61bd43caa", + "type": "github" + }, + "original": { + "owner": "lowRISC", + "repo": "lowrisc-nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1780203844, "narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-26.05", "repo": "nixpkgs", "type": "github" @@ -36,11 +73,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1775423009, - "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=", + "lastModified": 1783224372, + "narHash": "sha256-8i/87eeoqiGE4yOTjwSA3Eh/ziJRQEmd/unYU+K27sk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9", + "rev": "d407951447dcd00442e97087bf374aad70c04cea", "type": "github" }, "original": { @@ -50,6 +87,22 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1783148766, + "narHash": "sha256-uslt2pqShTIXDdAHRHv2QkYLsVdY8Oqwz0EA48/RSM8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a50de1b7d8a586adc18d2395c19de7d6058e6030", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, "pyproject-build-systems": { "inputs": { "nixpkgs": [ @@ -63,11 +116,11 @@ ] }, "locked": { - "lastModified": 1773870109, - "narHash": "sha256-ZoTdqZP03DcdoyxvpFHCAek4bkPUTUPUF3oCCgc3dP4=", + "lastModified": 1782093830, + "narHash": "sha256-6gmEVe69+KlRkZD4PEEV5xAlB9CB0Y9TiuEgQjDrKTQ=", "owner": "pyproject-nix", "repo": "build-system-pkgs", - "rev": "b6e74f433b02fa4b8a7965ee24680f4867e2926f", + "rev": "430680a19bc85a3bda55f12e4cc1a1aadcf2e478", "type": "github" }, "original": { @@ -83,11 +136,11 @@ ] }, "locked": { - "lastModified": 1775439158, - "narHash": "sha256-NHY9SJNU019n+8NCabBDtmuzRFeE2gZlYKHowp9bV24=", + "lastModified": 1782905613, + "narHash": "sha256-SvXJcAemihifkTn4BGvyE5K1FJX9bl4U8DQ5pqKvD0s=", "owner": "nix-community", "repo": "pyproject.nix", - "rev": "fb6b728260f3f32761367e9fd1e1a25b4245bcd0", + "rev": "7af23cfe91064865ecf2e835da28b45b3c6f49fd", "type": "github" }, "original": { @@ -99,7 +152,8 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "lowrisc-nix": "lowrisc-nix", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "pyproject-build-systems": "pyproject-build-systems", "pyproject-nix": "pyproject-nix", @@ -121,6 +175,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "uv2nix": { "inputs": { "nixpkgs": [ @@ -131,11 +200,11 @@ ] }, "locked": { - "lastModified": 1775386139, - "narHash": "sha256-n82p7WF+dYxf5r01pXlqbk8CAF7xX0Tk7wAcmMjkuhc=", + "lastModified": 1783307743, + "narHash": "sha256-oseisp2tblvzYZdojkA5URLnMjrpPiemzr5T7BdUyuU=", "owner": "pyproject-nix", "repo": "uv2nix", - "rev": "3cffcee173635d553e213d11418690b5290ff1c9", + "rev": "288b0a580ede39d3d7f96e3d835f9df0a7080223", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 291071e7..652a5bc2 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,8 @@ inputs.uv2nix.follows = "uv2nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + lowrisc-nix.url = "github:lowRISC/lowrisc-nix"; }; outputs = { @@ -35,6 +37,7 @@ uv2nix, pyproject-nix, pyproject-build-systems, + lowrisc-nix, ... }: flake-utils.lib.eachDefaultSystem (system: let @@ -126,6 +129,11 @@ }; devShells = { + # Lightweight Python dev shell. This is the direnv-loaded default + # (`use flake` in .envrc): direnv sources a shell's environment into the + # current shell, so it must be a plain mkShell — the FHS EDA shell below + # cannot be sourced (it execs into a bubblewrap mount namespace), which + # is why it is a *separate* shell entered explicitly with `nix develop`. default = pkgs.mkShell { packages = [ python @@ -151,6 +159,21 @@ export LD_LIBRARY_PATH="${lib.makeLibraryPath [pkgs.stdenv.cc.cc.lib pkgs.zlib]}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ''; }; + + # EDA tool shell driven by lowrisc-nix's generic mkEdaShell. Enter with + # `nix develop .#eda` (it execs into a hermetic FHS sandbox, so it is not + # direnv-loadable). Tool paths/licenses come at runtime from the JSON + # file named by $LOWRISC_EDA_CONFIG; without it the shell still works and + # just warns. Bundles the dvsim virtualenv so dvsim can drive the tools. + eda = lowrisc-nix.lib.mkEdaShell { + inherit pkgs; + name = "dvsim-eda"; + tools = { + cadence.xcelium = "23.09.002"; + synopsys.vcs = "X-2025.06-SP2-1"; + }; + extraDeps = [self.packages.${system}.default]; + }; }; checks = {inherit (pythonSet.dvsim.passthru.tests) pytest;};