From 03fec0b3934004d743397347f6fb2a1322b4c46c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 7 Oct 2023 06:40:24 +0300 Subject: refactor(tvix,views/tvix): move shell into separate file So far, we provided a custom `default.nix` in the root of the tvix josh workspace, which re-defined the shell attribute from `tvix/default.nix`. Some of the recent fixes, e.g. the MacOS-specific additions to the list of dependencies however didn't get ported over to this file, and in general, it's quite annoying to have two different places for these things. Initially I explored the idea of moving this default.nix file to a default-depot.nix file in the josh worktree only, and then "polyfill" some of the dependencies, or set up readTree in the josh workspace too, but it turned out to pull in too many dependencies to be worth the effort (nix.sparseTree, tools.depotfmt, crate2nix overlay, third_party.gitignoreSource). I now took a different approach - moving the definition of the `shell` attribute from `tvix/default.nix` to its own `shell.nix` file, which is imported from `tvix/default.nix` in regular depot usecases. Josh workspace consumers only see the `shell.nix`, which can be used in a self-contained fashion, the other `default.nix` is gone entirely, and we update the workspace file to also not show `tvix/default.nix` at the root either, so running `nix-shell` and then `cargo build` should still work. Change-Id: I6cb54d45d150c597612530ba44bc578f9d7f9120 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9556 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster Autosubmit: flokli --- tvix/default.nix | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'tvix/default.nix') diff --git a/tvix/default.nix b/tvix/default.nix index 34acde434a..cfb77f792b 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 { -- cgit 1.4.1