aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env/nix-env.cc
AgeCommit message (Collapse)Author
2020-07-16Generations API cleanupEelco Dolstra
2020-06-24convenience form of addTraceBen Burdette
2020-06-19addErrorTraceBen Burdette
2020-06-16Remove StorePath::clone() and related functionsEelco Dolstra
2020-06-15Remove trailing whitespaceEelco Dolstra
2020-06-11Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
2020-06-08Make the logger customisableregnat
Add a new `--log-format` cli argument to change the format of the logs. The possible values are - raw (the default one for old-style commands) - bar (the default one for new-style commands) - bar-with-logs (equivalent to `--print-build-logs`) - internal-json (the internal machine-readable json format)
2020-06-02elide the 'ErrorInfo' in logError and logWarning callsBen Burdette
2020-05-13formatting and a few minor changesBen Burdette
2020-05-11Merge branch 'master' into errors-phase-2Ben Burdette
2020-05-03convert some printError calls to logErrorBen Burdette
2020-04-28Tweak warning messageEelco Dolstra
2020-04-25nix-env: refactor uninstallDerivationsLinus Heckemann
Reduces the number of store queries it performs. Also prints a warning if any of the selectors did not match any installed derivations. UX Caveats: - Will print a warning that nothing matched if a previous selector already removed the path - Will not do anything if no selectors were provided (no change from before). Fixes #3531
2020-04-21remove 'format' from Error constructor callsBen Burdette
2020-03-30Remove global -I flagsEelco Dolstra
(cherry picked from commit 2c692a3b144523bca68dd6de618124ba6c9bb332)
2020-03-24Misc changes from the flakes branchEelco Dolstra
2020-03-24findAlongAttrPath(): Return positionEelco Dolstra
(cherry picked from commit 0b013a54dc570395bed887369f8dd622b8ce337b)
2020-03-14display attr-path only when queried availableYI
2019-12-10Make the Store API more type-safeEelco Dolstra
Most functions now take a StorePath argument rather than a Path (which is just an alias for std::string). The StorePath constructor ensures that the path is syntactically correct (i.e. it looks like <store-dir>/<base32-hash>-<name>). Similarly, functions like buildPaths() now take a StorePathWithOutputs, rather than abusing Path by adding a '!<outputs>' suffix. Note that the StorePath type is implemented in Rust. This involves some hackery to allow Rust values to be used directly in C++, via a helper type whose destructor calls the Rust type's drop() function. The main issue is the dynamic nature of C++ move semantics: after we have moved a Rust value, we should not call the drop function on the original value. So when we move a value, we set the original value to bitwise zero, and the destructor only calls drop() if the value is not bitwise zero. This should be sufficient for most types. Also lots of minor cleanups to the C++ API to make it more modern (e.g. using std::optional and std::string_view in some places).
2019-11-22getEnv(): Return std::optionalEelco Dolstra
This allows distinguishing between an empty value and no value.
2019-10-10nix-env: Ignore failures creating ~/.nix-profile and ~/.nix-defexprEelco Dolstra
https://hydra.nixos.org/build/102803093
2019-10-09nix-env: Create ~/.nix-defexpr automaticallyEelco Dolstra
2019-10-09nix-env: Create ~/.nix-profile automaticallyEelco Dolstra
2019-10-09OCD performance fix: {find,count}+insert => insertEelco Dolstra
2019-07-27Add pname and version to nix-env -q --jsonTom McLaughlin
2018-10-26Merge all nix-* binaries into nixEelco Dolstra
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-09-17nix-env: Fix segfault if -f argument is not a directory or a Nix expressionEelco Dolstra
Fixes #2425.
2018-05-31Merge pull request #767 from mogorman/garbage_collect_keep_last_fewPeter Simons
Implement --delete-generations + flag for keeping last N number of gens
2018-05-02Fix some random -Wconversion warningsEelco Dolstra
2018-03-01Update nix-env.ccMatt O'Gorman
missing comma
2018-03-01this updates issues that were addressed by people in prMatthew O'Gorman
2018-03-01Implement --delete-generations + flag for keeping last N number of generationsMatthew O'Gorman
2018-02-08Add plugins to make Nix more extensible.Shea Levy
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2017-10-24nix: Respect -I, --arg, --argstrEelco Dolstra
Also, random cleanup to argument handling.
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-20Add "nix search" commandEelco Dolstra
2017-07-03Replace a few bool flags with enumsEelco Dolstra
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-05-16Improve progress indicatorEelco Dolstra
2017-05-05Figure out the user's home directory if $HOME is not setEelco Dolstra
2016-11-26Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25Get rid of unicode quotes (#1140)Guillaume Maudoux
2016-09-21printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra
2016-08-29nix path-info: Add --json flagEelco Dolstra
Also, factor out JSON generation from value-to-json.{cc,hh}, and support producing indented JSON.
2016-08-23nix build: Use Nix search pathEelco Dolstra
That is, unless --file is specified, the Nix search path is synthesized into an attribute set. Thus you can say $ nix build nixpkgs.hello assuming $NIX_PATH contains an entry of the form "nixpkgs=...". This is more verbose than $ nix build hello but is less ambiguous.
2016-06-02Allow setting the state directory as a store parameterEelco Dolstra
E.g. "local?store=/tmp/store&state=/tmp/var".
2016-06-01Make the store directory a member variable of StoreEelco Dolstra
2016-05-04Cleanup: Remove singleton()Eelco Dolstra
2016-04-25Improved logging abstractionEelco Dolstra
This also gets rid of --log-type, since the nested log type isn't useful in a multi-threaded situation, and nobody cares about the "pretty" log type.
2016-02-12Merge pull request #762 from ctheune/ctheune-floatsEelco Dolstra
Implement floats
2016-02-04Eliminate the "store" global variableEelco Dolstra
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)