about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
AgeCommit message (Collapse)AuthorFilesLines
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-31/+31
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-31/+31
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-11/+11
2016-08-29 nix path-info: Add --json flagEelco Dolstra1-8/+7
Also, factor out JSON generation from value-to-json.{cc,hh}, and support producing indented JSON.
2016-08-23 nix build: Use Nix search pathEelco Dolstra1-2/+1
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-02 Allow setting the state directory as a store parameterEelco Dolstra1-1/+4
E.g. "local?store=/tmp/store&state=/tmp/var".
2016-06-01 Make the store directory a member variable of StoreEelco Dolstra1-2/+2
2016-05-04 Cleanup: Remove singleton()Eelco Dolstra1-3/+3
2016-04-25 Improved logging abstractionEelco Dolstra1-1/+1
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-12 Merge pull request #762 from ctheune/ctheune-floatsEelco Dolstra1-0/+4
Implement floats
2016-02-04 Eliminate the "store" global variableEelco Dolstra1-21/+21
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.)
2016-01-05 First hit at providing support for floats in the language.Christian Theune1-0/+4
2015-11-21 Print license information on '--xml --meta'Pascal Wittmann1-0/+12
The nixpkgs manual prescribes the use of values from stdenv.lib.licenses for the meta.license attribute. Those values are attribute sets and currently skipped when running nix-env with '--xml --meta'. This has the consequence that also nixpkgs-lint will report missing licenses. With this commit nix-env with '--xml --meta' will print all attributes of an attribute set that are of type tString. For example the output for the package nixpkgs.hello is <meta name="license" type="strings"> <string type="url" value="http://spdx.org/licenses/GPL-3.0+" /> <string type="shortName" value="gpl3Plus" /> <string type="fullName" value="GNU General Public License v3.0 or later" /> <string type="spdxId" value="GPL-3.0+" /> </meta> This commit fixes nixpkgs-lint, too.
2015-09-18 Shut up clang warningsEelco Dolstra1-1/+1
2015-09-17 nix-env --upgrade: show "downgrading" when doing soVladimír Čunát1-2/+4
It was strange to show "upgrading" when the version was getting lower. This is left on "upgrading" when the versions are the same, as I can't see any better wording.
2015-09-17 nix-env --upgrade: avoid unexpected downgradesVladimír Čunát1-6/+8
Until now, if one explicitly installed a low-priority version, nix-env --upgrade would downgrade it by default and even with --leq. Let's never accept an upgrade with version not matching the upgradeType. Additionally, let's never decrease the priority of an installed package; you can use --install to force that. Also refactor to use variable bestVersion instead of bestName, as only version was used from it.
2015-07-23 Optimize small listsEelco Dolstra1-4/+4
The value pointers of lists with 1 or 2 elements are now stored in the list value itself. In particular, this makes the "concatMap (x: if cond then [(f x)] else [])" idiom cheaper.
2015-07-23 --version: Print some config infoEelco Dolstra1-1/+7
Such as whether Nix is built with signed binary cache support, and the location of the configuration file.
2015-07-17 OCD: foreach -> C++11 ranged forEelco Dolstra1-131/+129
2015-05-21 nix-collect-garbage: Don't call nix-envEelco Dolstra1-61/+12
Also, make sure --delete-older-than doesn't delete the current generation.
2015-05-05 Allow URLs in the Nix search pathEelco Dolstra1-2/+2
E.g. to install "hello" from the latest Nixpkgs: $ nix-build '<nixpkgs>' -A hello -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz Or to install a specific version of NixOS: $ nixos-rebuild switch -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/63def04891a0abc328b1b0b3a78ec02c58f48583.tar.gz
2015-03-19 Fix Boehm API violationEelco Dolstra1-0/+1
We were calling GC_INIT() after doing an allocation (in the baseEnv construction), which is not allowed.
2015-01-15 Fix assertion failure in nix-envEelco Dolstra1-1/+3
$ nix-env -f ~/Dev/nixops/ -iA foo nix-env: src/libexpr/eval.hh:57: void nix::Bindings::push_back(const nix::Attr&): Assertion `size_ < capacity' failed. Aborted
2014-09-23 Add --force-name support for --set in nix-env, to support ↵Shell Turner1-0/+3
nix-install-package --set
2014-09-19 Store Attrs inside BindingsEelco Dolstra1-7/+7
This prevents a double allocation per attribute set.
2014-08-20 Use pager for more commandsEelco Dolstra1-1/+6
2014-08-20 Use proper quotes everywhereEelco Dolstra1-31/+31
2014-08-20 Add some colorEelco Dolstra1-8/+2
2014-08-18 Fix --attr parsingEelco Dolstra1-1/+3
2014-08-13 Refactor option handlingEelco Dolstra1-153/+139
2014-08-01 Make readDirectory() return inode / file typeEelco Dolstra1-6/+6
2014-06-02 nix-env -qa --json: Generate valid JSON even if there are invalid meta attrsEelco Dolstra1-2/+3
2014-05-26 Ensure that -I flags get included in nixPathEelco Dolstra1-3/+12
Also fixes #261.
2014-04-15 nix-env: Minor change to '--delete-generations Nd' semanticsRicardo M. Correia1-4/+10
The option '--delete-generations Nd' deletes all generations older than N days. However, most likely the user does not want to delete the generation that was active N days ago. For example, say that you have these 3 generations: 1: <30 days ago> 2: <15 days ago> 3: <1 hour ago> If you do --delete-generations 7d (say, as part of a cron job), most likely you still want to keep generation 2, i.e. the generation that was active 7 days ago (and for most of the past 7 days, in fact). This patch fixes this issue. Note that this also affects 'nix-collect-garbage --delete-older-than Nd'. Thanks to @roconnor for noticing the issue!
2014-03-30 nix-env: Add support for --delete-generations 15dRicardo M. Correia1-2/+17
It will delete all generations older than the specified number of days.
2014-02-18 Add a flag ‘--check’ to verify build determinismEelco Dolstra1-1/+1
The flag ‘--check’ to ‘nix-store -r’ or ‘nix-build’ will cause Nix to redo the build of a derivation whose output paths are already valid. If the new output differs from the original output, an error is printed. This makes it easier to test if a build is deterministic. (Obviously this cannot catch all sources of non-determinism, but it catches the most common one, namely the current time.) For example: $ nix-build '<nixpkgs>' -A patchelf ... $ nix-build '<nixpkgs>' -A patchelf --check error: derivation `/nix/store/1ipvxsdnbhl1rw6siz6x92s7sc8nwkkb-patchelf-0.6' may not be deterministic: hash mismatch in output `/nix/store/4pc1dmw5xkwmc6q3gdc9i5nbjl4dkjpp-patchelf-0.6.drv' The --check build fails if not all outputs are valid. Thus the first call to nix-build is necessary to ensure that all outputs are valid. The current outputs are left untouched: the new outputs are either put in a chroot or diverted to a different location in the store using hash rewriting.
2014-01-21 Remove unused typeEelco Dolstra1-1/+0
2013-12-20 nix-env --set-flag: Barf if a selector doesn't match any installed packageEelco Dolstra1-5/+13
Fixes #184.
2013-11-19 Check meta values and warn about bad onesEelco Dolstra1-23/+31
2013-11-19 Generalise meta attributesEelco Dolstra1-82/+65
2013-11-19 nix-env -q: Add a --json flagEelco Dolstra1-8/+45
2013-10-24 Rename "attribute sets" to "sets"Eelco Dolstra1-5/+5
We don't have any other kind of sets so calling them attribute sets is unnecessarily verbose.
2013-09-06 Remove stray debug lineEelco Dolstra1-2/+0
2013-09-03 nix-env -i: Add a flag ‘--remove-all’ / ‘-r’Eelco Dolstra1-17/+25
This is equivalent to running ‘nix-env -e '*'’ first, except that it happens in a single transaction. Thus, ‘nix-env -i pkgs...’ replaces the profile with the specified set of packages. The main motivation is to support declarative package management (similar to environment.systemPackages in NixOS). That is, if you have a specification ‘profile.nix’ like this: with import <nixpkgs> {}; [ thunderbird geeqie ... ] then after any change to ‘profile.nix’, you can run: $ nix-env -f profile.nix -ir to update the profile to match the specification. (Without the ‘-r’ flag, if you remove a package from ‘profile.nix’, it won't be removed from the actual profile.) Suggested by @zefhemel.
2013-09-03 nix-env: Use wildcard match by defaultEelco Dolstra1-8/+4
That is, you don't need to pass '*' anymore, so nix-env -qa is equivalent to nix-env -qa '*'
2013-09-03 nix-env: Load files in ~/.nix-defexpr on demandEelco Dolstra1-3/+6
So if you do "nix-env -qa -A nixos", then other channels won't be parsed/evaluated at all.
2013-09-03 Check for name collisions in the input Nix expressionsEelco Dolstra1-3/+9
2013-09-03 Work on Values instead of ExprsEelco Dolstra1-29/+38
This prevents some duplicate evaluation in nix-env and nix-instantiate. Also, when traversing ~/.nix-defexpr, only read regular files with the extension .nix. Previously it was reading files like .../channels/binary-caches/<name>. The only reason this didn't cause problems is pure luck (namely, <name> shadows an actual Nix expression, the binary-caches files happen to be syntactically valid Nix expressions, and we iterate over the directory contents in just the right order).
2013-09-03 Get rid of the parse tree cacheEelco Dolstra1-2/+2
Since we already cache files in normal form (fileEvalCache), caching parse trees is redundant. Note that getting rid of this cache doesn't actually save much memory at the moment, because parse trees are currently not freed / GC'ed.
2013-08-26 Fix typos, especially those that end up in the Nix manualIvan Kozik1-1/+1