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 <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
2023-10-07 05:40:24 +02:00
|
|
|
# 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 { };
|
|
|
|
})
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
pkgs.mkShell {
|
|
|
|
name = "tvix-rust-dev-env";
|
|
|
|
packages = [
|
|
|
|
pkgs.buf-language-server
|
|
|
|
pkgs.cargo
|
|
|
|
pkgs.cargo-machete
|
|
|
|
pkgs.clippy
|
|
|
|
pkgs.evans
|
|
|
|
pkgs.fuse
|
2023-10-16 17:10:17 +02:00
|
|
|
pkgs.go
|
2023-12-29 14:59:31 +01:00
|
|
|
pkgs.grpcurl
|
2023-12-11 04:51:43 +01:00
|
|
|
pkgs.hyperfine
|
2023-11-03 10:01:56 +01:00
|
|
|
pkgs.nix_2_3 # b/313
|
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 <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
2023-10-07 05:40:24 +02:00
|
|
|
pkgs.pkg-config
|
|
|
|
pkgs.rust-analyzer
|
|
|
|
pkgs.rustc
|
|
|
|
pkgs.rustfmt
|
|
|
|
pkgs.protobuf
|
2023-10-16 15:44:12 +02:00
|
|
|
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
|
|
|
# We need these two dependencies in the ambient environment to be able to
|
|
|
|
# `cargo build` on MacOS.
|
|
|
|
pkgs.libiconv
|
|
|
|
pkgs.buildPackages.darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
2023-12-09 17:45:39 +01:00
|
|
|
|
|
|
|
# Set TVIX_BENCH_NIX_PATH to a somewhat pinned nixpkgs path.
|
|
|
|
# This is for invoking `cargo bench` imperatively on the developer machine.
|
|
|
|
# For tvix benchmarking across longer periods of time (by CI), we probably
|
|
|
|
# should also benchmark with a more static nixpkgs checkout, so nixpkgs
|
|
|
|
# refactorings are not observed as eval perf changes.
|
|
|
|
shellHook = ''
|
|
|
|
export TVIX_BENCH_NIX_PATH=nixpkgs=${pkgs.path}
|
|
|
|
'';
|
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 <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
2023-10-07 05:40:24 +02:00
|
|
|
}
|