Commit graph

15492 commits

Author SHA1 Message Date
Qyriad 197a3ef981 rebase onto main 2024-04-28 17:29:17 -06:00
Qyriad 48f89f6b0e add VM test for nix upgrade-nix
This commit adds a new NixOS VM test, which tests that `nix upgrade-nix`
works on both kinds of profiles (manifest.nix and manifest.json).

Done as a separate commit from 831d18a13, since it relies on the
--store-path argument from 026c90e5f as well.

Change-Id: I5fc94b751d252862cb6cffb541a4c072faad9f3b
2024-04-28 17:29:12 -06:00
Qyriad b8e6a67455 nix3-upgrade-nix: allow manually specifying the store path for the new nix
Should this specify the profile? The derivation output that gets linked
into that profile? The latter is probably better.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-28 17:29:11 -06:00
Qyriad b90669fbe9 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-28 17:29:11 -06:00
Qyriad 6dd21ca8fe refactor some nix-env and profile code to libcmd
Notably, ProfileManifest and ProfileElement are useful generic
profile management code, and nix profile is not the only place in the
codebase where profiles are relevant.

This commit is in preparation for fixing upgrade-nix's interaction with
new-style profiles.

Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-28 17:29:11 -06:00
Qyriad 531a895bcc add vm test 2024-04-28 17:27:07 -06:00
Qyriad 32f1979fba add VM test for nix upgrade-nix
This commit adds a new NixOS VM test, which tests that `nix upgrade-nix`
works on both kinds of profiles (manifest.nix and manifest.json).

Done as a separate commit from 831d18a13, since it relies on the
--store-path argument from 026c90e5f as well.

Change-Id: I5fc94b751d252862cb6cffb541a4c072faad9f3b
2024-04-28 17:23:31 -06:00
Qyriad 97a4adb325 rl for upgrade nix override 2024-04-28 15:38:19 -06:00
Qyriad 51a69767ca nix3-upgrade-nix: allow manually specifying new nix
This allows manually specifying a store path for the new Nix that
gets linked into Nix's profile.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-28 15:38:04 -06:00
Qyriad 3be59172fe okay store path override works 2024-04-28 15:09:07 -06:00
Qyriad b649c7add7 nix3-upgrade-nix: allow manually specifying new nix
This allows manually specifying a store path for the new Nix that
gets linked into Nix's profile.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-28 15:07:26 -06:00
Qyriad 6504b9f648 improve assert msg and make nix profile elem detection more robust 2024-04-28 14:52:27 -06:00
Qyriad 33e433ad68 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-28 14:52:00 -06:00
Qyriad c529adb996 nix3-upgrade-nix: allow manually specifying the store path for the new nix
Should this specify the profile? The derivation output that gets linked
into that profile? The latter is probably better.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-28 14:52:00 -06:00
Qyriad eb13b2ab3f unfuck commit msg 2024-04-28 01:32:17 -06:00
Qyriad 75ec759633 nix3-upgrade-nix: allow manually specifying the store path for the new nix
Should this specify the profile? The derivation output that gets linked
into that profile? The latter is probably better.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-28 01:31:21 -06:00
Qyriad d0a9e7c2ff refactor some nix-env and profile code to libcmd
Notably, ProfileManifest and ProfileElement are useful generic
profile management code, and nix profile is not the only place in the
codebase where profiles are relevant.

This commit is in preparation for fixing upgrade-nix's interaction with
new-style profiles.

Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-28 01:31:21 -06:00
Qyriad 3502e27f93 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-28 01:31:21 -06:00
Qyriad 8fdf7abaef rebase onto main 2024-04-27 23:31:31 -06:00
Qyriad 5c1e2cf195 nix3-upgrade-nix: allow manually specifying the store path for the new nix
Should this specify the profile? The derivation output that gets linked
into that profile? The latter is probably better.

Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-27 23:31:23 -06:00
Qyriad 9af156ecb4 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 23:31:23 -06:00
Qyriad b49fd8324a refactor some nix-env and 3-profile code libcmd
Notably, ProfileManifest and ProfileElement are useful generic
profile management code, and nix profile is not the only place in the
codebase where profiles are relevant.

This commit is in preparation for fixing upgrade-nix's interaction with
new-style profiles.

Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 23:31:23 -06:00
Qyriad 31708ff8ff good commit message for the libcmd refacotr 2024-04-27 23:15:38 -06:00
Qyriad 23de548850 nix3-upgrade-nix: allow manually specifying the store path for the new nix
Change-Id: Ib71711ffb466febf4a6892e3fdbda644e053770d
2024-04-27 23:15:13 -06:00
Qyriad f881146005 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 23:15:13 -06:00
Qyriad 19e9ada564 refactor some nix-env and 3-profile code libcmd
Notably, ProfileManifest and ProfileElement are useful generic
profile management code, and nix profile is not the only place in the
codebase where profiles are relevant.

This commit is in preparation for fixing upgrade-nix's interaction with
new-style profiles.

Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 23:09:54 -06:00
Qyriad 4789077d08 whoops, forgot to remove the unused one from a few commits ago 2024-04-27 23:05:10 -06:00
Qyriad 6194eebae6 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 23:04:56 -06:00
Qyriad 11ce7c65a9 cleanup! factor upgradeNewStyleProfile to its own function 2024-04-27 23:04:22 -06:00
Qyriad b636118030 fix nix upgrade-nix on new-style profiles
nix3-profile automatically migrates any profile its used on to its style
of profile -- the ones with manifest.json instead of manifest.nix. On
non-NixOS systems, Nix is conventionally installed to the profile at
/nix/var/nix/profiles/default, so if a user passed that to `--profile`
of `nix profile`, then it would break upgrade-nix from ever working
again, without recreating the profile.

This commit fixes that, and allows upgrade-nix to work on either kind of
profile.

Fixes #16.

Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 22:52:02 -06:00
Qyriad 1ec6411d42 will the real MVP please stand up 2024-04-27 22:18:17 -06:00
Qyriad 05756b90cf mvp
Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 22:18:09 -06:00
Qyriad 7f3514f94e whitespace 2024-04-27 20:43:12 -06:00
Qyriad a00cb15b77 refactor some nix-env and nix profile code into libcmd
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 20:43:04 -06:00
Qyriad 37a2e02662 mvp
Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 20:43:04 -06:00
Qyriad 229ef1609f ProfileManifest 2024-04-27 20:40:20 -06:00
Qyriad c3f1603ef9 mvp
Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 20:40:12 -06:00
Qyriad 581bb8eb82 refactor some nix-env and nix profile code into libcmd
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 20:40:12 -06:00
Qyriad b2f94107e2 ProfileElement 2024-04-27 18:45:48 -06:00
Qyriad a7c0aefb64 mvp
Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 18:45:36 -06:00
Qyriad 1d00657e9b refactor some nix-env and nix profile code into libcmd
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 18:45:36 -06:00
Qyriad 19e1ad9193 mvp 2024-04-27 17:29:01 -06:00
Qyriad a514712224 mvp
Change-Id: I4c49b1beba93bb50e8f8a107edc451affe08c3f7
2024-04-27 17:28:56 -06:00
Qyriad f9b3dd5208 ProfileElementSource 2024-04-27 14:44:54 -06:00
Qyriad 49886ce0dc refactor some nix-env and nix profile code into libcmd
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 14:44:37 -06:00
puck 0c831765bd Run all derivation builders inside the sandbox on macOS
This replaces the external sandbox-exec call with direct calls into
libsandbox. This API is technically deprecated and is missing some
prototypes, but all major browsers depend on it, so it is unlikely to
materially change without warning.

This commit also ensures the netrc file is only written if the
derivation is in fact meant to be able to access the internet.

This change commits a sin of not actually actively declaring its
dependency on macOS's libsandbox.dylib; this is due to the dylib
cache in macOS making that explicit dependency unnecessary. In the
future this might become a problem, so this commit marks our sins.

Co-authored-by: Artemis Tosini <lix@artem.ist>
Co-authored-by: Lunaphied <lunaphied@lunaphied.me>
Change-Id: Ia302141a53ce7b0327c1aad86a117b6645fe1189
2024-04-27 14:44:15 -06:00
Qyriad 057e663de8 queryInstalled, showVersions 2024-04-27 13:25:18 -06:00
Qyriad 91ea6aaf4f refactor some nix-env and nix profile code into libcmd
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
2024-04-27 13:24:39 -06:00
Qyriad 76b45b4861 Merge "docs(nix-env): summarize of each subcommand in --help" into main 2024-04-27 18:42:46 +00:00
puck 9229e87347 Fix progress bar on copyPaths
This variable should not be shared between activities.

Change-Id: I4eee89bc7acb320a3972dc3a55bfb087d3a9eb3a
2024-04-27 18:03:15 +00:00