aboutsummaryrefslogtreecommitdiff
path: root/src/nix
AgeCommit message (Collapse)Author
2019-12-11Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
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-12-05Shut up clang warningEelco Dolstra
(cherry picked from commit 3392f1b77869269580b58e4931b7a79f44799ce0)
2019-12-05nix doctor: Fix typoEelco Dolstra
(cherry picked from commit 96c6b08ed7f99be84cb1816515a368392d19dbb5)
2019-12-05Make subcommand construction in MultiCommand lazyEelco Dolstra
(cherry picked from commit a0de58f471c9087d8e6cc60a6078f9940a125b15)
2019-12-05Move Command and MultiCommand to libutilEelco Dolstra
(cherry picked from commit f70434b1fbbdb0e188718f0c55a8156a7aa08744)
2019-12-05MultiCommand: Simplify constructionEelco Dolstra
(cherry picked from commit 15a16e5c05d547ec07170df2392263e5e891447b)
2019-12-04Fix macOS buildEelco Dolstra
https://hydra.nixos.org/build/107716759
2019-12-04Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-12-02nix: Add --refresh as an alias for --tarball-ttl 0Eelco Dolstra
2019-12-02Merge branch 'run-environment' of https://github.com/mkenigs/nix into flakesEelco Dolstra
2019-12-01typomatthew
2019-11-27nix: Add --expr flagEelco Dolstra
This replaces the '(...)' installable syntax, which is not very discoverable. The downside is that you can't have multiple expressions or mix expressions and other installables.
2019-11-26Fix clang warningsEelco Dolstra
2019-11-22getEnv(): Return std::optionalEelco Dolstra
This allows distinguishing between an empty value and no value.
2019-11-14Fix attr path to nixpkgs flake in flake templateMaximilian Bosch
This doesn't work anymore since `packages` was removed from the `nixpkgs`-fork with flake support[1], now it's only possible to refer to pkgs via `legacyPackages`. [1] https://github.com/edolstra/nixpkgs/commit/49c9b71e4ca98722cecd64ce8d53c1a4b9c46b64
2019-11-12nix dev-shell: Improve bash output parsingEelco Dolstra
Fixes handling of '=' in unquoted strings and escaped characters in $'...' strings.
2019-11-08Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-11-08Move editorFor srom libutil to nixEelco Dolstra
libutil should not depend on libexpr.
2019-11-07use MixEnvironment in run and shellmatthew
2019-11-07Factor out code to handle environment in run into MixEnvironmentmatthew
2019-11-07changesmatthew
2019-11-07environment fixes in runmatthew
Move environment related code to a separate function. Create a new char** if ignoreEnvironment is set rather than calling clearEnv
2019-11-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-11-05Merge branch 'fix/nix-doctor-output' of https://github.com/bhipple/nixEelco Dolstra
2019-11-05Merge branch 'nix-repl-e' of https://github.com/zimbatm/nixEelco Dolstra
2019-11-05Merge pull request #3190 from mkenigs/examplesEelco Dolstra
change deprecated attribute syntax in run examples
2019-11-04Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-11-04Merge pull request #3202 from kraem/masterEelco Dolstra
Update nix eval --help msg to not include deprecated command
2019-11-03Fix progress bar when nix-prefetch-url is piped.Harald van Dijk
The intent of the code was that if the window size cannot be determined, it would be treated as having the maximum possible size. Because of a missing assignment, it was actually treated as having a width of 0. The reason the width could not be determined was because it was obtained from stdout, not stderr, even though the printing was done to stderr. This commit addresses both issues.
2019-11-03Update nix eval --help msg to not include deprecated commandkraem
2019-11-01include netinet/in.h in src/nix/main.ccng0
Fixes #3186
2019-10-31change deprecated attribute syntax in run examplesmatthew
2019-10-31Minor updates to inline commentsBenjamin Hipple
Add missing docstring on InstallableCommand. Also, some of these were wrapped when they're right next to a line longer than the unwrapped line, so we can just unwrap them to save vertical space.
2019-10-28nix repl: also handle lambda editzimbatm
2019-10-28editorFor: take a pos object insteadzimbatm
2019-10-28libexpr: findDerivationFilename return Pos instead of tuplezimbatm
2019-10-23libexpr: add findDerivationFilenamezimbatm
extract the derivation to filename:lineno heuristic
2019-10-23libutil: add editorFor heuristiczimbatm
2019-10-23nix repl: add :edit commandzimbatm
This allows to have a repl-centric workflow to working on nixpkgs. Usage: :edit <package> - heuristic that find the package file path :edit <path> - just open the editor on the file path Once invoked, `nix repl` will open $EDITOR on that file path. Once the editor exits, `nix repl` will automatically reload itself.
2019-10-22Convert old-style profile manifestEelco Dolstra
2019-10-22Add "nix profile upgrade" commandEelco Dolstra
2019-10-22Add "nix profile remove" commandEelco Dolstra
2019-10-22nix profile info: Index elementsEelco Dolstra
2019-10-22Add start of 'nix profile' commandEelco Dolstra
2019-10-21Fix "nixpkgs." compatibilityEelco Dolstra
2019-10-21Fix buildEelco Dolstra
2019-10-21Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-10-21Mark content-addressable paths with references as experimentalEelco Dolstra
2019-10-21nix make-content-addressable: Add examplesEelco Dolstra