aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-03-27Merge pull request #7763 from obsidiansystems/installable-wide-infoEelco Dolstra
Stratify `ExtraPathInfo` along `Installable` hierarchy
2023-03-27Merge pull request #8084 from edolstra/store-docsEelco Dolstra
Auto-generate store documentation
2023-03-27Merge pull request #8073 from tweag/fix-root-channels-locationJohn Ericson
Fix root channels location
2023-03-27Merge pull request #8062 from edolstra/ssl-cert-fileEelco Dolstra
Add a setting for configuring the SSL certificates file
2023-03-27Merge pull request #7609 from obsidiansystems/hide-experimental-settingsJohn Ericson
Hide experimental settings
2023-03-27ssl-cert-file: Use listsEelco Dolstra
2023-03-27Merge pull request #8104 from avdv/graphml-use-long-for-narsizeEelco Dolstra
nix-store: Use `long` for `narSize` in graphml output
2023-03-27Make some comments in profiles.hh doxygen-enabledThéophane Hufschmitt
These are proper documentation of the API, so they deserve to be here
2023-03-26Catch eval errors in `hasContent`oxalica
`legacyPackages` of nixpkgs trigger eval errors in `hasContent`, causing the whole `legacyPackages` being skipped. We should treat it as has-content in that case.
2023-03-24nix-store: Use `long` for `narSize` in graphml outputClaudio Bley
2023-03-24Stratify `ExtraPathInfo` along `Installable` hierarchyJohn Ericson
Instead of having a bunch of optional fields, have a few subclasses which can have mandatory fields. Additionally, the new `getExtraPathInfo`, and `nixpkgsFlakeRef`, are moved to `InstallableValue`. I did these things because https://github.com/NixOS/rfcs/pull/134 ; with these things moved to `InstallableValue`, the base `Installable` no longer depends on libexpr! This is a major step towards that. Also, add a bunch of doc comments for sake of the internal API docs.
2023-03-24Merge pull request #7757 from obsidiansystems/more-installable-valueEelco Dolstra
Move value-only methods to `InstallableValue`
2023-03-24Merge pull request #8098 from ↵Théophane Hufschmitt
hercules-ci/error-cc-Only-suggest-show-trace-when-truncated-trace-items-would-be-pri error.cc: Only suggest `--show-trace` when relevant
2023-03-23error.cc: Only suggest show-trace when truncated trace items would be printedRobert Hensing
Otherwise, a trace consisting of frame frame frame non-frame ... would reach the non-frame and print the suggestion, even though it would have ignored the non-frame anyway. This resulted in a peculariar situation where --show-trace would have no apparent effect, as the trace was actually already complete.
2023-03-23TweaksEelco Dolstra
2023-03-23Register LocalStore to ensure it's included in the manualEelco Dolstra
2023-03-23Document store URLsEelco Dolstra
2023-03-23Factor out the generation of the profile/channel directoryThéophane Hufschmitt
Make sure that all the code paths use the same one, and that the backwards-compatibility measures are probably in place when needed
2023-03-23nix-channel: Restore the old root channels directoryThéophane Hufschmitt
2023-03-23Update src/libstore/local-store.mdEelco Dolstra
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-03-23Fix SSHStoreEelco Dolstra
2023-03-23Fix clang buildEelco Dolstra
2023-03-22Merge pull request #8078 from obsidiansystems/profile-mdJohn Ericson
Fix `nix profile --help`
2023-03-22Improve store setting descriptions / Markdown formattingEelco Dolstra
2023-03-21Fix rendering of fetchGit documentationEelco Dolstra
stripIndentation() doesn't support tabs, so the entire markdown ended up indented and thus rendered as a code block.
2023-03-21Add a "help" categoryEelco Dolstra
This makes the help commands show up prominently at the top of the 'nix' manpage.
2023-03-21Move store docs to 'nix help-stores'Eelco Dolstra
Why not 'nix help stores'? Well, 'nix help <arg>' already means 'show help on the "arg" subcommand'.
2023-03-21Support per-store Markdown documentationEelco Dolstra
2023-03-21nix describe-stores: RemoveEelco Dolstra
This command was intended for docs generation, but it was never used for that and we don't need it.
2023-03-21nix store --help: Include store type documentationEelco Dolstra
2023-03-21Fix misrendering of 'nix store --help'Eelco Dolstra
There are no categories underneath 'nix store', so having 'nix store copy-log' in a category rendered as ':'.
2023-03-20Fix `nix profile --help`John Ericson
The documentation hadn't be updated to reflect the new default profile location.
2023-03-20CleanupEelco Dolstra
2023-03-20Open slave pseudoterminal before CLONE_NEWUSEREelco Dolstra
Otherwise, when running as root and user namespaces are enabled, opening the slave fails with EPERM. Fixes "opening pseudoterminal slave: Permission denied" followed by a hang (https://hydra.nixos.org/build/213104244), and "error: getting sandbox mount namespace: No such file or directory" (#8072), which happens when the child fails very quickly and consequently reading /proc/<child>/ns fails.
2023-03-20Fix handling of experimental features mid-parseJohn Ericson
If we conditionally "declare" the argument, as we did before, based upon weather the feature is enabled, commands like nix --experimental-features=foo ... --thing-gated-on-foo won't work, because the experimental feature isn't enabled until *after* we start parsing. Instead, allow arguments to also be associated with experimental features (just as we did for builtins and settings), and then the command line parser will filter out the experimental ones. Since the effects of arguments (handler functions) are performed right away, we get the required behavior: earlier arguments can enable later arguments enabled! There is just one catch: we want to keep non-positional flags...non-positional. So if nix --experimental-features=foo ... --thing-gated-on-foo works, then nix --thing-gated-on-foo --experimental-features=foo ... should also work. This is not my favorite long-term solution, but for now this is implemented by delaying the requirement of needed experimental features until *after* all the arguments have been parsed.
2023-03-20Mark experimental features on settingsJohn Ericson
We hide them in various ways if the experimental feature isn't enabled. To do this, we had to move the experimental features list out of libnixstore, because the setting machinary itself depends on it. To do that, we made a new `ExperimentalFeatureSettings`.
2023-03-20Move enabled experimental feature to libutil structJohn Ericson
This is needed in subsequent commits to allow the settings and CLI args infrastructure itself to read this setting.
2023-03-19docs: quote URL literalsfigsoda
2023-03-17Add a setting for configuring the SSL certificates fileEelco Dolstra
This provides a platform-independent way to configure the SSL certificates file in the Nix daemon. Previously we provided instructions for overriding the environment variable in launchd, but that obviously doesn't work with systemd. Now we can just tell users to add ssl-cert-file = /etc/ssl/my-certificate-bundle.crt to their nix.conf.
2023-03-17Merge pull request #7891 from mupdt/shared-fs-out-linksJohn Ericson
no-op refactor: extract outLink generation into a function
2023-03-16Move value-only methods to `InstallableValue`John Ericson
These methods would previously fail on the other `Installable`s, so moving them to this class is more correct as to where they actually work. Additionally, a `InstallableValueCommand` is created to make it easier (or rather no worse than before) to write commands that just work on `InstallableValue`s. Besides being a cleanup to avoid failing default methods, this gets us closer to https://github.com/NixOS/rfcs/pull/134.
2023-03-16Merge pull request #8049 from edolstra/unexpected-eofEelco Dolstra
Fix "unexpected EOF" errors on macOS
2023-03-16LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed buildsLinus Heckemann
2023-03-15Merge pull request #7750 from obsidiansystems/no-args-prepareJohn Ericson
Make command infra less stateful and more regular
2023-03-15Make command infra less stateful and more regularJohn Ericson
Already, we had classes like `BuiltPathsCommand` and `StorePathsCommand` which provided alternative `run` virtual functions providing the implementation with more arguments. This was a very nice and easy way to make writing command; just fill in the virtual functions and it is fairly clear what to do. However, exception to this pattern were `Installable{,s}Command`. These two classes instead just had a field where the installables would be stored, and various side-effecting `prepare` and `load` machinery too fill them in. Command would wish out those fields. This isn't so clear to use. What this commit does is make those command classes like the others, with richer `run` functions. Not only does this restore the pattern making commands easier to write, it has a number of other benefits: - `prepare` and `load` are gone entirely! One command just hands just hands off to the next. - `useDefaultInstallables` because `defaultInstallables`. This takes over `prepare` for the one case that needs it, and provides enough flexiblity to handle `nix repl`'s idiosyncratic migration. - We can use `ref` instead of `std::shared_ptr`. The former must be initialized (so it is like Rust's `Box` rather than `Option<Box>`, This expresses the invariant that the installable are in fact initialized much better. This is possible because since we just have local variables not fields, we can stop worrying about the not-yet-initialized case. - Fewer lines of code! (Finally I have a large refactor that makes the number go down not up...) - `nix repl` is now implemented in a clearer way. The last item deserves further mention. `nix repl` is not like the other installable commands because instead working from once-loaded installables, it needs to be able to load them again and again. To properly support this, we make a new superclass `RawInstallablesCommand`. This class has the argument parsing and completion logic, but does *not* hand off parsed installables but instead just the raw string arguments. This is exactly what `nix repl` needs, and allows us to instead of having the logic awkwardly split between `prepare`, `useDefaultInstallables,` and `load`, have everything right next to each other. I think this will enable future simplifications of that argument defaulting logic, but I am saving those for a future PR --- best to keep code motion and more complicated boolean expression rewriting separate steps. The "diagnostic ignored `-Woverloaded-virtual`" pragma helps because C++ doesn't like our many `run` methods. In our case, we don't mind the shadowing it all --- it is *intentional* that the derived class only provides a `run` method, and doesn't call any of the overridden `run` methods. Helps with https://github.com/NixOS/rfcs/pull/134
2023-03-15Merge pull request #7690 from ShamrockLee/nix-hash-sriJohn Ericson
nix-hash: support base-64 and SRI format
2023-03-16nix-hash: support base-64 and SRI formatYueh-Shun Li
Add the --base64 and --sri flags for the Base64 and SRI format output. Add the --base16 flag to explicitly specify the hexadecimal format. Add the --to-base64 and --to-sri flag to convert a hash to the above mentioned format.
2023-03-15respect allRefs=1 when using `nix flake prefetch`figsoda
2023-03-15Remove a variable in LocalDerivationGoalEelco Dolstra
2023-03-15Change builderOut from Pipe to AutoCloseFDEelco Dolstra