diff options
-rw-r--r-- | tvix/default.nix | 19 | ||||
-rw-r--r-- | tvix/shell.nix | 33 | ||||
-rw-r--r-- | views/tvix/default.nix | 26 | ||||
-rw-r--r-- | views/tvix/workspace.josh | 5 |
4 files changed, 40 insertions, 43 deletions
diff --git a/tvix/default.nix b/tvix/default.nix index 34acde434a80..cfb77f792bff 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -94,22 +94,9 @@ in # lacking something, but it is required for some people's workflows. # # This shell can be entered with e.g. `mg shell //tvix:shell`. - shell = pkgs.mkShell { - name = "tvix-rust-dev-env"; - packages = [ - pkgs.buf-language-server - pkgs.cargo - pkgs.cargo-machete - pkgs.clippy - pkgs.evans - pkgs.fuse - pkgs.pkg-config - pkgs.rust-analyzer - pkgs.rustc - pkgs.rustfmt - pkgs.protobuf - ] ++ iconvDarwinDep; - }; + # This is a separate file, so it can be used individually in the tvix josh + # workspace too. + shell = (import ./shell.nix { inherit pkgs; }); # Builds and tests the code in castore/protos. castore-protos-go = pkgs.buildGoModule { diff --git a/tvix/shell.nix b/tvix/shell.nix new file mode 100644 index 000000000000..1a7e9ddd2b56 --- /dev/null +++ b/tvix/shell.nix @@ -0,0 +1,33 @@ +# This file is shell.nix in the tvix josh workspace, +# *and* used to provide the //tvix:shell attribute in a full depot checkout. +# Hence, it may not use depot as a toplevel argument. + +{ + # This falls back to the tvix josh workspace-provided nixpkgs checkout. + # In the case of depot, it's always set explicitly. + pkgs ? (import ./nixpkgs { + depotOverlays = false; + depot.third_party.sources = import ./sources { }; + }) +, ... +}: + +let + iconvDarwinDep = pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.libiconv ]; +in +pkgs.mkShell { + name = "tvix-rust-dev-env"; + packages = [ + pkgs.buf-language-server + pkgs.cargo + pkgs.cargo-machete + pkgs.clippy + pkgs.evans + pkgs.fuse + pkgs.pkg-config + pkgs.rust-analyzer + pkgs.rustc + pkgs.rustfmt + pkgs.protobuf + ] ++ iconvDarwinDep; +} diff --git a/views/tvix/default.nix b/views/tvix/default.nix deleted file mode 100644 index feee0f222240..000000000000 --- a/views/tvix/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Externally importable TVL depot stack. This is intended to be called -# with a supplied package set, otherwise the package set currently in -# use by the TVL depot will be used. -# -{ pkgs ? (import ./nixpkgs { - depotOverlays = false; - depot.third_party.sources = import ./sources { }; - }) -, ... -}: - -pkgs.mkShell { - name = "tvix-rust-dev-env"; - packages = with pkgs; [ - buf-language-server - cargo - clippy - evans - fuse - pkg-config - protobuf - rust-analyzer - rustc - rustfmt - ]; -} diff --git a/views/tvix/workspace.josh b/views/tvix/workspace.josh index e0b15c7f30b5..b4f6e3ce5be3 100644 --- a/views/tvix/workspace.josh +++ b/views/tvix/workspace.josh @@ -2,4 +2,7 @@ ::nixpkgs/ ::sources/ ] -:/tvix + +::tvix:exclude[ + ::tvix/default.nix +]:/tvix |