This implements https://github.com/NixOS/rfcs/pull/136. This issue is agreed-upon by the https://github.com/orgs/NixOS/teams/nix-team - merge `nix store add-file` and `nix store add-path` into one `nix store add` and expose the underlying store options - expose as `--key value` or `--value1|--value2` - make PR to CLI guidelines to encode the convention - replace `--recursive` with `--mode nar|flat|drv|git` (denoting the output hash mode) - hash types following https://github.com/NixOS/nix/issues/8876 - make `--mode nar` the default due to history and to match path-to-string coercion behavior in the language - `flat` is for consuming a single file - `drv` (later) for implementing RFC 92; hashing mode to support adding `.drv` files - `git` (later) for implementing RFC 133 - TODO: clarify how to expose `outputHashMode`, `outputHashAlgo`, etc. on the command line - refactoring: nicer names for the concepts in `addToStore`: https://github.com/NixOS/nix/blob/master/src/libstore/store-api.hh#L517
This implements NixOS/rfcs#136. This issue is agreed-upon by the https://github.com/orgs/NixOS/teams/nix-team
nix store add-fileandnix store add-pathinto onenix store addand expose the underlying store options--key valueor--value1|--value2--recursivewith--mode nar|flat|drv|git(denoting the output hash mode)nix hashand subcommands #8876--mode narthe default due to history and to match path-to-string coercion behavior in the languageflatis for consuming a single filedrv(later) for implementing RFC 92; hashing mode to support adding.drvfilesgit(later) for implementing RFC 133outputHashMode,outputHashAlgo, etc. on the command lineaddToStore: https://github.com/NixOS/nix/blob/master/src/libstore/store-api.hh#L517