Skip to content

Commit 1c5cc8c

Browse files
authored
[rm nixpkgs] Install same package in profile as in flake.nix (#1295)
## Summary I don't really expect there to be a difference here, but for consistency, we should be installing exactly the same packages in profile and in flake.nix, even if we expect the contents to be the same. ## How was it tested? Before: ``` > DEVBOX_FEATURE_REMOVE_NIXPKGS=1 devbox rm hello > DEVBOX_FEATURE_REMOVE_NIXPKGS=1 devbox add [email protected] > cat devbox.lock ... "[email protected]": { "last_modified": "1970-01-01T00:00:00Z", "resolved": "github:NixOS/nixpkgs/eb751d65225ec53de9cf3d88acbf08d275882389#hello", "source": "devbox-search", "systems": { "aarch64-darwin": { "store_path": "/nix/store/qh8s6yb93b1wl0jxg5i0pfq2rf7qm44j-hello-2.12.1" }, "x86_64-darwin": { "store_path": "/nix/store/ycbqd7822qcnasaqy0mmiv2j9n9m62yl-hello-2.12.1", "ca_store_path": "/nix/store/1jaa5hqp6pv43z7p3xc7gkck0q3rkg4n-hello-2.12.1" }, "x86_64-linux": { "store_path": "/nix/store/8n3pr83b7aab975gwrd6hnk10pqphr59-hello-2.12.1" } } }, ... > ls -la .devbox/nix/profile/default/bin total 0 dr-xr-xr-x 5 root nixbld 160 Dec 31 1969 . dr-xr-xr-x 5 root nixbld 160 Dec 31 1969 .. lrwxr-xr-x 1 root nixbld 66 Dec 31 1969 hello -> /nix/store/ycbqd7822qcnasaqy0mmiv2j9n9m62yl-hello-2.12.1/bin/hello > DEVBOX_FEATURE_REMOVE_NIXPKGS=1 devbox run -- tail -n 1 '$(which hello)' exec /nix/store/1jaa5hqp6pv43z7p3xc7gkck0q3rkg4n-hello-2.12.1/bin/hello "$@" ``` After ``` > ls -la .devbox/nix/profile/default/bin total 0 dr-xr-xr-x 5 root nixbld 160 Dec 31 1969 . dr-xr-xr-x 5 root nixbld 160 Dec 31 1969 .. lrwxr-xr-x 1 root nixbld 66 Dec 31 1969 hello -> /nix/store/1jaa5hqp6pv43z7p3xc7gkck0q3rkg4n-hello-2.12.1/bin/hello ```
1 parent 6c1f473 commit 1c5cc8c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

internal/devpkg/package.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ func (p *Package) Installable() (string, error) {
156156
}
157157

158158
if inCache {
159-
// TODO savil: change to ContentAddressablePath?
160-
installable, err := p.InputAddressedPath()
159+
installable, err := p.ContentAddressedPath()
161160
if err != nil {
162161
return "", err
163162
}

internal/nix/nixprofile/profile.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ func ProfileListIndex(args *ProfileListIndexArgs) (int, error) {
7575
return -1, err
7676
}
7777
if inCache {
78-
// TODO savil: change to ContentAddressedPath?
79-
pathInStore, err := args.Input.InputAddressedPath()
78+
pathInStore, err := args.Input.Installable()
8079
if err != nil {
8180
return -1, err
8281
}

0 commit comments

Comments
 (0)