It's not obvious how to use Garage's nix-shell #868
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#868
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While setting up a Nix environment for Garage (instructions here), the following pops up when trying to spawn a dev shell:
Some context:
I am using the
nix.conf
file from the repository, with an extra line to enablenix develop
(still experimental, but tolerates the multiple derivations).I am not very familiar with Nix, but I believe this is due to the fact that
shell.nix
defines multiple shell derivations: there'sdevShell
,devShellFull
,ci
andcache
. If I remove all of them butdevShell
,nix-shell
behaves as expected.Is this something other devs have encountered? Should the documentation be updated to enable/use the experimental Nix CLI, or should
shell.nix
be simplified to only include the dev environment derivation?JKR
Hello JKR,
You can select the shell you want with the
--attr
or-A
attribute:nix-shell --attr devShell
- probably the development shell you wantnix-shell --attr devShellFull
- similar to devShell with the following additional packages:nix-shell --attr ci
- used to run our bash integration tests (./script/test-smoke.sh
), this shell fetches and make available many famous S3 CLI clients (awscli, winscp, s3cmd, duck, etc.).nix-shell --attr cache
- a maintenance shell to update our nix cache used to speed up builds (for example by caching our cross compilation toolchain).Also some context, nix is currently facing some governance challenges, and one aspect of that is that:
nix-build
,nix-shell
,nix-store
, etc.) are very permissives in what you can do with them, they are not opinionated / do not provide any convention, and lead to very different usage patterns between project.nix build
,nix develop
,nix flake
) that enforce many conventions AND work closer to other language package managers (eg.yarn
,composer
,cargo
, etc.). While flake is still tagged as experimental, it became dominant in some ways/some part of the nix ecosystem. Keeping the new CLI + flake as experimental is often criticized in the light of their real adoption.With Garage, if there is no clear reason, we want to stay compatible with the "stable" version of the tools we use (we don't rely on rust nightly for example). However, in many cases, nix flakes become the defacto for many nix projects (for example cargo2nix, one of our dependency). I even had to contribute a compatibility patch for cargo2nix to use it with the legacy tools.
Also, nix flake support has been introduced at a later time (by alex I guess) and thus our setup your development environment page is outdated.
So:
As a conclusion, I would recommend we update the devenv setup page by:
a. explain behind a
<details></details>
tag how to activate the new commands if you have an existing nix install.a.
nix build .#amd64
b.
nix develop
Additionally, I would recommend we deprecate as much as possible the legacy tooling, so we don't have to support 3 builds systems at once (
cargo
,legacy nix
,nix flake
). As part of this deprecation, I think we could also move to the release system I introduced in aerogramme.Development environment: nix-shell requires a single derivationto It's not obvious how to use Garage's nix-shell