aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-05-22Merge pull request #8377 from layus/fix-ssl-cert-mountThéophane Hufschmitt
Make mounting ssl cert file optional
2023-05-22Merge pull request #8365 from obsidiansystems/proto-structsThéophane Hufschmitt
Revert "Revert "Use template structs instead of phantoms""
2023-05-19Shortcircuit for empty caFileGuillaume Maudoux
2023-05-19Make mounting ssl cert file optionalGuillaume Maudoux
2023-05-19Merge pull request #8354 from KasyanDiGris/git-fetcher-ask-credentialsEelco Dolstra
Ask for git credentials in fetcher
2023-05-19Merge pull request #8215 from obsidiansystems/general-repair-pathEelco Dolstra
Support `repairPath` on most stores.
2023-05-19Merge pull request #7312 from layus/fixed-output-system-certEelco Dolstra
Allow system certs access to fixed-output derivations
2023-05-18Merge pull request #8366 from obsidiansystems/worker-proto-forward-decl-typesRobert Hensing
Don't use `store-api.hh` in `worker-protocol.hh`
2023-05-18Remove unusedKonstantin Vukolov
2023-05-18Add option isInteractiveKonstantin Vukolov
2023-05-18Don't use `store-api.hh` in `worker-protocol.hh`John Ericson
Using abstract types like can help cut down on compilation time, both from scratch, and especially incremental builds during development. The idea is that `worker-protocol.hh` can declare all the (de)serializers, but only again abstract types; when code needs to use some (de)serializers, it can include headers just for the data types it needs to (de)serialize. `store-api.hh` in particular is a bit of a sledgehammer, and the data types we want to serialize have their own headers.
2023-05-17Revert "Revert "Use template structs instead of phantoms""John Ericson
This is the more typically way to do [Argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)-leveraging generic serializers in C++. It makes the relationship between the `read` and `write` methods more clear and rigorous, and also looks more familiar to users coming from other languages that do not have C++'s libertine ad-hoc overloading. I am returning to this because during the review in https://github.com/NixOS/nix/pull/6223, it came up as something that would make the code easier to read --- easier today hopefully already, but definitely easier if we were have multiple codified protocols with code sharing between them as that PR seeks to accomplish. If I recall correctly, the main criticism of this the first time around (in 2020) was that having to specify the type when writing, e.g. `WorkerProto<MyType>::write`, was too verbose and cumbersome. This is now addressed with the `workerProtoWrite` wrapper function. This method is also the way `nlohmann::json`, which we have used for a number of years now, does its serializers, for what its worth. This reverts commit 45a0ed82f089158a79c8c25ef844c55e4a74fc35. That commit in turn reverted 9ab07e99f527d1fa3adfa02839da477a1528d64b.
2023-05-17Upgrade `downstreamPlaceholder` to a type with methodsJohn Ericson
This gets us ready for dynamic derivation dependencies (part of RFC 92).
2023-05-17Add test for `downstreamPlaceholder`John Ericson
This is good in general, but in particular ensures when we heavily refactor it in the next commit there is less likelihood for an unintentional change in behavior to sneak in.
2023-05-17Merge pull request #8349 from tweag/fix-control-masterJohn Ericson
Fix ControlMaster behaviour
2023-05-17Merge pull request #8360 from obsidiansystems/worker-protocol.ccJohn Ericson
Move `worker_proto` defs out of `remote-store.cc` to own file
2023-05-17Move `worker_proto` defs out of `remote-store.cc` to own fileJohn Ericson
These items are not templates, and they declared in `worker-protocol.hh`; therefore they should live in a `worker-protocol.cc`. Anything else needlessly diverges from convention. After all, it is not like this code is only used in `remote-store.cc`; it is also used in `daemon.cc`. There is no good reason to place it with the client implementation or the server implementation when it used equally by both.
2023-05-17add cross-references to pure evaluation modeValentin Gagarin
use consistent wording everywhere. add some details on the configuration option documentation.
2023-05-17Also use long options in src/nix/*.mdAlexander Schmolck
2023-05-17Ask for git credentials in fetcherKonstantin Vukolov
2023-05-16Merge pull request #8346 from tweag/fix-nix-profile-install-conflict-segfaultJohn Ericson
Fix the segfault on `nix profile install` with conflict
2023-05-16Fix ControlMaster behaviourAlexander Bantyev
2023-05-16Merge pull request #8154 from tweag/delete-old-on-all-profiles-dirJohn Ericson
undefined
2023-05-16Fix the printing of the installables on `nix profile install` conflictThéophane Hufschmitt
- If the element comes from a flake, print the full flakeref (with the fragment part) and not just the reference to the flake itself - If the element doesn't come from a flake, print its store path(s) This is a bit too verbose, but has the advantages of being correct (and not crashing), so it's strictly better than the previous situation Fix https://github.com/NixOS/nix/issues/8284
2023-05-16Rename `ProfileElement.describe()` to `.identifier`Théophane Hufschmitt
This method isn't used to describe what the element is, but to return a unique identifier for it whithin the current profile
2023-05-15Merge pull request #8341 from obsidiansystems/dedup-gen-hhJohn Ericson
Dedup some markdown -> C++ big literal stuff in build system
2023-05-15Merge pull request #8340 from NixOS/delete-commited-build-artifactsRobert Hensing
Delete commited build artifacts
2023-05-15Delete commited build artifactsJohn Ericson
They were improperly added in 8a93b5a55184d9d34effdd94d58429c9ad1a3d14. They were not `.gitignore`d because they were stale in that commit -- build artifacts no longer used that name by then and so `.gitignore` was updated accordingly.
2023-05-15Fix some bounds in rapid check instancesJohn Ericson
`inRange` is exclusive not inclusive: https://github.com/emil-e/rapidcheck/blob/master/doc/generators.md#usage Furthermore, use `std::variant_size_v` so we use the right number automatically. Finally, make the `switch` assert the discriminant is in bounds as expected.
2023-05-15Dedup some markdown -> C++ big literal stuff in build systemJohn Ericson
This pattern rule was unwisely hidden in `src/libstore/local.mk`. Now it is properly in `mk/` and we reuse it for the profile docs too.
2023-05-15Make more string values work as installablesJohn Ericson
As discussed in #7417, it would be good to make more string values work as installables. That is to say, if an installable refers to a value, and the value is a string, it used to not work at all, since #7484, it works somewhat, and this PR make it work some more. The new cases that are added for `BuiltPath` contexts: - Fixed input- or content-addressed derivation: ``` nix-repl> hello.out.outPath "/nix/store/jppfl2bp1zhx8sgs2mgifmsx6dv16mv2-hello-2.12" nix-repl> :p builtins.getContext hello.out.outPath { "/nix/store/c7jrxqjhdda93lhbkanqfs07x2bzazbm-hello-2.12.drv" = { outputs = [ "out" ]; }; } The string matches the specified single output of that derivation, so it should also be valid. - Floating content-addressed derivation: ``` nix-repl> (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath "/1a08j26xqc0zm8agps8anxpjji410yvsx4pcgyn4bfan1ddkx2g0" nix-repl> :p builtins.getContext (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath { "/nix/store/qc645pyf9wl37c6qvqzaqkwsm1gp48al-hello-2.12.drv" = { outputs = [ "out" ]; }; } ``` The string is not a path but a placeholder, however it also matches the context, and because it is a CA derivation we have no better option. This should also be valid. We may also want to think about richer attrset based values (also discussed in that issue and #6507), but this change "completes" our string-based building blocks, from which the others can be desugared into or at least described/document/taught in terms of. Progress towards #7417 Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-05-15Create `EvalState::coerceToDerivedPath`John Ericson
This gives us some round trips to test. `EvalState::coerceToDerivedPathUnchecked` is a factored out helper just for unit testing.
2023-05-15Expose `mkOutputString` as method of `EvalState`John Ericson
2023-05-15Split `mkOutputString` in twoJohn Ericson
This well help us with some unit testing
2023-05-15Remove unneeded argument for `mkOutputString`John Ericson
2023-05-15Merge pull request #8141 from tweag/user-files-docJohn Ericson
Document user files of nix
2023-05-15Make `nix-collect-garbage -d` look into more placesThéophane Hufschmitt
Make it look into the new-style profiles dir, the old-style one, and the target of `~/.nix-profile` to be sure that we don't miss anything
2023-05-14`max-substitution-jobs` release note entryMatej Urbas
2023-05-12Merge pull request #8299 from urbas/max-substitution-jobsEelco Dolstra
`max-substitution-jobs` setting
2023-05-10Fix `nix print-dev-env` & `nix develop` with drv pathsJohn Ericson
Fixes #8309 This regression was because both `CmdDevelop` and `CmdPrintDevEnv` were switched to be `InstallableValueCommand` subclasses, but actually neither should have been. The `nixpkgsFlakeRef` method should indeed not be on the base installable class, because "flake refs" and "nixpkgs" are not installable-wide notions, but that doesn't mean these commands should only accept installable values.
2023-05-10Merge pull request #3959 from obsidiansystems/ca-drv-exoticJohn Ericson
Derivations can output "text-hashed" data
2023-05-10Merge pull request #7721 from yorickvP/post-build-hookThéophane Hufschmitt
Also pass unwanted outputs to post-build-hook
2023-05-09Improve error message for self reference with text hashingJohn Ericson
The `ContentAddressWithReferences` method is made total, with error handling now squarely the caller's job. This is better.
2023-05-09Add name to some error messagesJohn Ericson
2023-05-09Cleanups to content address typesJohn Ericson
2023-05-09Apply suggestions from code review John Ericson
Thanks! Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-05-09Fix bug, `newInfo` -> `newInfo0`John Ericson
It appears we were checking a variable in the process of definining it.
2023-05-09Fix spurious changeJohn Ericson
Didn't mean to use the private name that shouldn't be exposed.
2023-05-09prevent double quotationAlex Ameen
2023-05-09libexpr: quote reserved keys when printingAlex Ameen
This fixes a bug in commands like `nix eval' which would emit invalid attribute sets if they contained reserved keywords such as "assert", "let", etc. These keywords will not be quoted when printed, making them valid expressions. All keywords recognized by the lexer are quoted except "or", which does not require quotation.