aboutsummaryrefslogtreecommitdiff
path: root/src/nix/add-to-store.cc
AgeCommit message (Collapse)Author
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2021-01-13Convert option descriptions to MarkdownEelco Dolstra
2020-12-04Split 'nix store add-to-store' into 'add-path' and 'add-file'Eelco Dolstra
This makes it consistent with 'nix hash <path|file>'.
2020-12-03Move most store-related commands to 'nix store'Eelco Dolstra
2020-12-03nix add-to-store: Move markdown docs into a separate fileEelco Dolstra
2020-12-03Make doc() return arbitrary Markdown rather than the contents of the ↵Eelco Dolstra
"Description" section Thus we can return the examples section (and any other sections) from doc() and don't need examples() anymore.
2020-10-09Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-10-06Remove static variable name clashesEelco Dolstra
This was useful for an experiment with building Nix as a single compilation unit. It's not very useful otherwise but also doesn't hurt...
2020-09-25stdout_ -> coutJohn Ericson
Better to get creative than just sprinkle arbitrary underscores.
2020-09-04Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-08-20Allow 'nix' subcommands to provide docs in Markdown formatEelco Dolstra
2020-08-07Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-buildsJohn Ericson
2020-08-06Minimize the usage of `Hash::dummy`John Ericson
2020-07-30Merge remote-tracking branch 'origin/master' into fix-and-ci-static-buildsMatthew Bauer
2020-07-30Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-06-29Rename logging->stdout to logging->stdout_Matthew Bauer
musl doesn't like this identifier
2020-06-23Fix test suiteCarlo Nucera
2020-06-23Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-06-22Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-06-19WIP: Make Hash always store a valid hash typeJohn Ericson
2020-06-19More designated initializersJohn Ericson
2020-06-19Merge remote-tracking branch 'me/no-stringly-typed-derivation-output' into ↵John Ericson
validPathInfo-ca-proper-datatype
2020-06-18Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatypeJohn Ericson
2020-06-17Update strings from review commentMatthew Bauer
2020-06-12Fix add-to-store --flat to put in correct hashMatthew Bauer
2020-06-12Add --flat to nix add-to-storeMatthew Bauer
This can be used to add flat hashes to the nix store.
2020-06-04Make sure info.ca tag bit is set in `nix add-to-store`John Ericson
2020-06-03No C++ designated initializers yet with Clang 7John Ericson
2020-06-02Merge remote-tracking branch 'upstream/master' into ↵John Ericson
validPathInfo-ca-proper-datatype
2020-06-02WIPJohn Ericson
2020-05-29Remove addToStore variant as requested by `FIXME`John Ericson
The idea is it's always more flexible to consumer a `Source` than a plain string, and it might even reduce memory consumption. I also looked at `addToStoreFromDump` with its `// FIXME: remove?`, but the worked needed for that is far more up for interpretation, so I punted for now.
2020-05-28Merge branch 'master' of github.com:NixOS/nix into enum-classCarlo Nucera
2020-05-26Merge remote-tracking branch 'origin/master' into enum-FileIngestionMethodCarlo Nucera
2020-05-05nix --help: Group commandsEelco Dolstra
2020-05-04Flag: Use designated initializersEelco Dolstra
2020-04-16Use Logger::stdout()Eelco Dolstra
(cherry picked from commit 8f41847394524fcac40d3b5620139ca7e94a18e3)
2020-03-29Replace some `bool recursive` with a new `FileIngestionMethod` enumJohn Ericson
2020-03-29Use `enum struct` and drop prefixesJohn Ericson
This does a few enums; the rest will be gotten in subsequent commits.
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-05Make subcommand construction in MultiCommand lazyEelco Dolstra
(cherry picked from commit a0de58f471c9087d8e6cc60a6078f9940a125b15)
2019-03-14experimental/optional -> optionalEelco Dolstra
2017-09-14Add "nix add-to-store" commandEelco Dolstra