aboutsummaryrefslogtreecommitdiff
path: root/src/nix/upgrade-nix.cc
AgeCommit message (Collapse)Author
2019-11-22getEnv(): Return std::optionalEelco Dolstra
This allows distinguishing between an empty value and no value.
2018-08-30nix upgrade-nix: Handle .nix-profile being a link to .../profiles/per-user/...Eelco Dolstra
Also some cosmetic improvements.
2018-08-30nix upgrade-nix: Improve error message if 'nix' is not in a profileEelco Dolstra
E.g. $ nix upgrade-nix error: directory '/home/eelco/Dev/nix/inst/bin' does not appear to be part of a Nix profile instead of $ nix upgrade-nix error: '/home/eelco/Dev/nix/inst' is not a symlink
2018-08-30Merge branch 'nix-upgrade-profile' of https://github.com/LnL7/nixEelco Dolstra
2018-08-30Add simple test for nix upgrade-nixEelco Dolstra
2018-08-25upgrade-nix: resolve profile symlinksDaiderd Jordan
The profile present in PATH is not necessarily the actual profile location. User profiles are generally added as $HOME/.nix-profile in which case the indirect profile link needs to be resolved first. /home/user/.nix-profile -> /nix/var/nix/profiles/per-user/user/profile /nix/var/nix/profiles/per-user/user/profile -> profile-15-link /nix/var/nix/profiles/per-user/user/profile-14-link -> /nix/store/hyi4kkjh3bwi2z3wfljrkfymz9904h62-user-environment /nix/var/nix/profiles/per-user/user/profile-15-link -> /nix/store/6njpl3qvihz46vj911pwx7hfcvwhifl9-user-environment To upgrade nix here we want /nix/var/nix/profiles/per-user/user/profile-16-link instead of /home/user/.nix-profile-1-link. The latter is not a gcroot and would be garbage collected, resulting in a broken profile. Fixes #2175
2018-08-25upgrade-nix: add --dry-runDaiderd Jordan
2018-06-12Move EvalState from the stack to the heapEelco Dolstra
EvalState contains a few counters (e.g. nrValues) that increase quickly enough that they end up being interpreted as pointers by the garbage collector. Moving it to the heap makes them invisible to the garbage collector. This reduces the max RSS doing 100 evaluations of nixos.tests.firefox.x86_64-linux.drvPath from 455 MiB to 292 MiB. Note: ideally, allocations would be much further up in the 64-bit address space to reduce the odds of an integer being misinterpreted as a pointer. Maybe we can use some linker magic to move the .bss segment to a higher address.
2018-05-30Move evaluator-specific settings out of libstoreEelco Dolstra
2018-01-31Add 'nix upgrade-nix' commandEelco Dolstra
This command upgrades Nix to the latest stable version by installing a store path obtained from https://github.com/NixOS/nixpkgs/raw/master/nixos/modules/installer/tools/nix-fallback-paths.nix which is the same store path that the installer at https://nixos.org/nix/install.sh uses. The upgrade fails if Nix is not installed in a profile (e.g. on NixOS, or when installed outside of the Nix store).