Skip to content

CLI stabilization effort #7701

Open
Open

Description

@tomberek

This is a DRAFT
Tracking for the stabilizing effort:

Tasks

  1. consider feature mappings with legacy CLI (not expected to be 1-1)
  2. review correctness of command
  3. do all --help options make sense
  4. create any issues or PRs to resolve the above, we will link it here for tracking
  5. verify "ready for stabilization"

The goal isn't to stabilize the whole CLI at once. A bunch of less-frequent commands can wait for a bit while we focus on the most important ones.

First batch of stabilization

To be discussed

Stuff that hasn't been processed yet

Global concerns

Blocked on installables

To stabilise in a later batch

These are low priority and have more involved background issues we have to clarify first

  • nix store cat
  • nix store ls
  • nix store copy-log
  • nix store copy-sigs
  • nix store diff-closures
  • nix store make-content-addressed
  • nix store path-from-hash-part
  • nix store prefetch-file
  • nix store repair
  • nix store verify
    • document the defaults for the options
    • ensure that sigs-needed only takes into account the cryptographic portion of the key, not the name
  • nix store sign
    • see previous: Unsigned derivations uploaded to S3 #6960 (comment)
    • QUESTION: sign only until other signatures encountered (limited -r)
    • --key-file - to read key from stdin, exclusive with --stdin, but then how to pass both via pipe?
    • QUESTION: add a --pipe FD for which --stdin is alias for --pipe /dev/fd/0?

References

CLI Guidelines
legacy CLI mapping

Activity

  1. converted this from a draft issue on Jan 27, 2023
  2. Ericson2314 commented on Feb 3, 2023

    @Ericson2314
    Member

    #7740 / #5638 being hard I think it something to think about prior to command stabilization.

  3. changed the title [-]stabilization effort[/-] [+]CLI stabilization effort[/+] on Feb 7, 2023
  4. added
    new-cli
    on Feb 7, 2023
  5. moved this to ⏰ Postponed in Nix teamon Feb 10, 2023
  6. nixos-discourse commented on Feb 13, 2023

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/2023-01-27-nix-team-meeting-minutes-27/25434/1

  7. fricklerhandwerk commented on Feb 13, 2023

    @fricklerhandwerk
    Contributor

    Discussed in the Nix team meeting 2023-02-10:

    Decision: work through one complete command at a time and write down the process. once finished and everyone is confident to reproduce that process on one's own, do the rest of the work in parallel.

    Complete discussion
    • @tomberek will clarify the exact things to do
      • @Ericson2314: the idea was to take one command at a time to figure out these things to begin with
      • @fricklerhandwerk: why don't we do it together for one command?
      • @Ericson2314: we already started with nix store gc
      • @fricklerhandwerk: let's take one hour together in the work meetings to attack this and write down what we do. when one command is finished (it is likely to take months at that pace), and everyone is confident to reproduce the process on one's own given the documentation we write, we can parallelise it for all the other commands
        • agreement
        • @roberth: several months are a blip in relation to how long it took to develop the new CLI anyway
      • @thufschmitt: will make a PR to put on the agenda for next time
        • won't be there myself though
  8. nixos-discourse commented on Feb 13, 2023

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/2023-02-10-nix-team-meeting-minutes-31/25438/1

  9. Ericson2314 commented on Feb 13, 2023

    @Ericson2314
    Member

    Two topics (with my PR fixes, if we like my solution) that I think would be good to track:

    (My middle PR, #7610, corresponds to #7820 already listed here, so there is no need to link the issue directly.)

  10. nixos-discourse commented on Feb 13, 2023

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/2023-02-10-nix-team-meeting-minutes-32/25442/1

  11. nixos-discourse commented on Feb 17, 2023

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/tweag-nix-dev-update-44/25546/1

  12. fricklerhandwerk commented on Mar 22, 2023

    @fricklerhandwerk
    Contributor

    Discussed general design considerations in Nix team meeting 2023-03-20:

    @Ericson2314 and @fricklerhandwerk prefer to have a clean separation of composable "plumbing" commands (reflecting architectural separation of store and evaluation layers) and convenient "porcelain" commands that aim for brevity and common use cases. Specifically it should be nix store copy[-(closure|path|...)] <store path> and nix copy <installable>. @edolstra noted that the original goal of the CLI redesign was not to have that distinction, and that this has been decided long ago. The merit of this was disputed. We also briefly touched upon perceived problems with nix-env, where one can observe a similar tension.

    There was no conclusion.

    Although apparently this has been talked about multiple times in the past years, and @edolstra is (rightly) annoyed about rehashing the arguments, there seems to be no record of the prior discussions. (Help digging them out highly appreciated!)

    Complete discussion
    • @thufschmitt: last time we decided to stabilise a subset of nix copy to bring back nix-push functionality
      • possibly adding a nix-push wrapper just to have the interface in place
    • @fricklerhandwerk: nix copy seems to only operate at the store level, why is it not nix store copy?
      • @thufschmitt: one reason is that it's very important
      • @edolstra: the question is how often one uses this command
        • don't think it's that common
      • @thufschmitt: nix store copy sounds like you'd copy a store
      • @Ericson2314: we have nix store copy-log
    • @Ericson2314: nix copy is hard to stabilise in general
      • we'd probably need a stable store (to/from) syntax first
      • we also haven't looked over the store options that much yet
    • @thufschmitt: two approaches
      1. re-write nix-push in terms of old CLI idioms
      2. stabilise a smallest possible subset of nix copy
        • challenge is how to make that subset not awkward
    • @Ericson2314: we could have a nix store copy command that only works on paths
      • it would be good to have commands that do one thing well
      • @edolstra: disagree. we had that in the old CLI, while that was architecturally nice, it's not good for the user
        • if users want to operate on store paths, they should pass store paths
        • I want to be able to do nix copy nixpkgs#hello
        • @Ericson2314: just as we'd have a top-level nix gc we could also have that
          • want to separate porcelain from plumbing
          • @edolstra: the porcelain here is in the installables
            • @Ericson2314: that is actually the problem. there is an incongruency in behavior for different types of installables
              • for CA derivations, if you specify something higher-level where it has to figure out "realizations", it will do different things than just for store paths
          • @fricklerhandwerk: I see the problem that installables are polymorphic, and it's not clear for beginners at all what the common properties are
            • @Ericson2314: polymorphism is probably okay, as long as the downcast is unconditional for all of them and it always has the same result
              • @fricklerhandwerk: passing -E '1+1' as an installable will throw an error that doesn't help anywone who doesn't know how the underlying mechanism works
                • why you should know what a derivation even is, just because it's possible to pass something to nix copy that is not in general copyable?
              • @edolstra: this ship has sailed a long time ago
                • the new CLI is all about not having separate commands for the store layer and the expression layer
    • (some discussion about CLI design and how the old and the new relate)
    • (some more debate around how nix-env apparently creates confusion, which is related to the interface design issue)
    • no conclusion, but apparently we may have to agree on priorities
  13. pinned this issue on Apr 14, 2023
  14. 19 remaining items

  15. added this to Nix team and removed this from Nix teamon Dec 20, 2023
  16. nixos-discourse commented on Jan 16, 2024

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/tweag-nix-dev-update-52/38343/1

  17. nixos-discourse commented on Jan 31, 2024

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/contribute-to-the-nix-2023-recap/37484/13

  18. moved this from Defined work to In discussion in Nix implementation boardon Feb 29, 2024
  19. nixos-discourse commented on Oct 27, 2024

    @nixos-discourse
  20. nixos-discourse commented on Oct 29, 2024

    @nixos-discourse
  21. poly2it commented on Dec 26, 2024

    @poly2it

    Why should nix run --file imply impure? Is it any more impure than passing an --expr? As I see it, it has been provided explicitly as an input by the user.

  22. nixos-discourse commented on Mar 8, 2025

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/determinate-nix-3-0/61202/105

  23. sdht0 commented on May 7, 2025

    @sdht0

    What's the latest news on this effort? The last update here seems to be from October.

  24. edolstra commented on Sep 12, 2025

    @edolstra
    Member

    Added replacements for nix-store --export/--import in #13969.

  25. x10an14 commented on Oct 12, 2025

    @x10an14

    How does (if it does at all) this issue address the nix-build --attrs flag which I can't (perhaps in error) find an equivalent for in man nix3-build?

    $ nix run nixpkgs#nix-info -- -m
     - system: `"x86_64-linux"`
     - host os: `Linux 6.16.9, NixOS, 25.11 (Xantusia), 25.11.20251002.7df7ff7`
     - multi-user?: `yes`
     - sandbox: `yes`
     - version: `nix-env (Nix) 2.28.5`
     - channels(root): `"nixos"`
     - channels(x10an14): `""`
     - nixpkgs: `/nix/store/9v6qa656sq3xc58vkxslqy646p0ajj61-source`
    
  26. nixos-discourse commented on Jul 13, 2026

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/discussion-of-flakes-from-2025-nixos-community-survey-report/78853/53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

RFCnew-cli

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions