Skip to content

Conversation

savil
Copy link
Collaborator

@savil savil commented Oct 5, 2022

Summary

To avoid the nix-profile symlinks crowding the .devbox/ directory, I push them
inside a .devbox/nix/profile/ sub-directory. The symlink is renamed to default inside .devbox/nix/profile to be consistent with nix naming.

I also want to rename profileDir to profilePath. That is more accurate since
it is not a directory but a symlink. However, will do in a separate PR since
it has some conflicts with concurrent work like #207.

How was it tested?

> cd testdata/rust/rust-stable
> devbox shell
> which rustc
# see path in nix store

> devbox add openssl
> hash -r
> which openssl
# see path in nix store

# inspect directory and symlinks:
> ls -al /Users/savil/code/jetpack/devbox/testdata/rust/rust-stable/.devbox/nix/profile/
total 0
drwxr-xr-x 5 savil staff 160 Oct  6 11:55 .
drwxr-xr-x 3 savil staff  96 Oct  6 11:55 ..
lrwxr-xr-x 1 savil staff  14 Oct  6 11:55 default -> default-2-link
lrwxr-xr-x 1 savil staff  60 Oct  6 11:55 default-1-link -> /nix/store/qn9px7zzx500d0l78nhz0b39v8nm1siq-user-environment
lrwxr-xr-x 1 savil staff  60 Oct  6 11:55 default-2-link -> /nix/store/6q654ka2lcdvamxxvnsa9vp9dcj9b6yg-user-environment

Copy link
Collaborator Author

savil commented Oct 5, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested review from LucilleH and mohsenari October 5, 2022 23:28
devbox.go Outdated
@@ -30,7 +30,8 @@ const (
configFilename = "devbox.json"

// profileDir contains the contents of the profile generated via `nix-env --profile profileDir <command>`
profileDir = ".devbox/profile"
// Instead of using directory, prefer using the devbox.profileDir() function that ensures the directory exists.
profileDir = ".devbox/nix-profile/profile"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it under /gen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially felt we should reserve gen for generated files....maybe we should discuss the internal structure of .devbox folder.

@savil savil force-pushed the savil/profile-dir branch from 0a68d25 to a8bb58a Compare October 6, 2022 18:52
@savil savil force-pushed the savil/profile-dir branch from a8bb58a to 270f5b3 Compare October 6, 2022 18:56
@savil
Copy link
Collaborator Author

savil commented Oct 6, 2022

test failure is regression from #218. Tests pass locally if I delete testdata/python/pipenv.

@savil savil merged commit fc99d42 into main Oct 6, 2022
@savil savil deleted the savil/profile-dir branch October 6, 2022 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants