Open tomberek opened 1 year ago
https://github.com/NixOS/nix/pull/7740 / https://github.com/NixOS/nix/issues/5638 being hard I think it something to think about prior to command stabilization.
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
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.
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
Two topics (with my PR fixes, if we like my solution) that I think would be good to track:
--help
--- https://github.com/NixOS/nix/pull/7611(My middle PR, https://github.com/NixOS/nix/pull/7610, corresponds to https://github.com/NixOS/nix/issues/7820 already listed here, so there is no need to link the issue directly.)
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
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
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!)
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-04-14-nix-team-meeting-minutes-48/27358/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-team-report-2022-10-2023-03/27486/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-08-28-nix-team-meeting-minutes-83/32290/1
Meeting notes 2023-09-01
nix store gc
What about the gc-related queries?
--dry-run
and --json
to nix store gc
?nix store delete
nix store ping
What does --json
return?
Why does trusted
return an int? Change to bool-or-null
TODO copy note from comment on issue
Rename to nix store info
.
nix store add-file
add-path
?
@edolstra: benefit of explicit add-file
is that it matches fetchurl
@ericson2314: a single command with multiple modes, flags seems more sensible
@thufschmitt: what's the use case?
@edolstra: generally prefetching
@roberth: also RFC 92 dynamic derivations?
@thufschmitt: seem similar
@ericsion2314: the varying hashing methods have always been a source of confusion to me. Making this explicit is helpful for learning
@edolstra: names?
@roberth: match the code?
Too long and inconvenient
@roberth: short flags that are neatly categorized in the docs?
@edolstra: should match derivation attr recursive
, flat
@roberth: recursive
should be the default?
Make it match the language? Then it should be recursive
or flat
@roberth: ~recursive-or-flat
as a mode?~ ~It names the language behavior~ wrong! The language uses recursive
in its string coercions.
Should it match outputHashAlgo
/ outputHashMethod
?
@thufschmitt: It would be great for the language and CLI to agree
@ericson2314: I think it is very good if the CLI is "subliminally" teaching people the most compressed/efficient mental model by never missing and opportunity to connect things that are the same. (The less users need to consult the docs the better.) So if recursive hashing is deeply related to NAR hashing, they should share a name. (I took a lot of time to "academically" understand Nix and refine my mental model, but most users won't take the time to "relearn" that way. So we want to give them the right mental model from the beginning.)
@thufschmitt: Do we want key-value options or flags? (--method=foo
or --foo
)
@edolstra: Prefer brief options. Would like to avoid string-value for enums.
@roberth: This command is for scripts and power users, so brevity is not a priority.
@tomberek: What should be the CLI guideline?
@edolstra: enum key-value options can always be turned into single flags
@ericson2314: such flags are naturally booleans, whereas we're dealing with an enum
@roberth: key-value matches the language, matches derivations
@edolstra: We have precendent for flattening enum-valued options to mutually exclusive flags, e.g. sandbox
@roberth: for tab completion we want a consistent prefix
@edolstra: Implementation effort may be higher for enum case
@roberth: Should be close: either you specify more flags, or you specify a string mapping
@ericson2314: Would be happy to implement infra for enum options if still needed.
@ericson3214: Support text
for manually adding derivations in aterm format (e.g. for RFC 92, or just for complete coverage)
@tomberek: Let's also update / clarify the CLI guidelines.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-09-01-nix-team-meeting-minutes-84/32466/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nixcon-governance-workshop/32705/9
- Maybe add
--dry-run
and--json
tonix store gc
?
I would argue that almost all of the commands in the new CLI need a --dry-run
flag (#7227)
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-09-25-nix-team-meeting-minutes-89/33489/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-10-09-nix-team-meeting-minutes-93/34388/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/stabilising-the-new-nix-command-line-interface/35531/1
Just had a conversation on mastodon, where nix store gc
was compared to the legacy command with -d
(after some confusion).
The lack of generation deletion is somewhat of a regression from the user perspective, so we can only really claim parity when we have a nix profile
subcommand that does root deletion and gc.
Would nix profile collect
be a good name? My reasoning is that it doesn't collect just the garbage.
nix profile clean[up]
What is it supposed to collect?
Although in any case it can be slightly misleading because if that command does the same as nix-collect-garbage -d
, users may be unpleasantly surprised that other things not rooted in stale profiles also get collected. So maybe, in fact, that's what the command should do?
@roberth : I think it would make sense to have both (a nix store gc
that doesn't care about the profiles and nix profile collect/cleanup
that also removes the old profiles (maybe in a more targeted way building on top of #7239?).
maybe in a more targeted way building on top of https://github.com/NixOS/nix/issues/7239
Exactly! We should address the mechanism first before piling up policy.
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
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
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
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
nix daemon
nix nar
nix hash
nix hash convert [--type sha256] --from (base16|...|sri) --to base64 strings...
nix hash path
nix key
nix config
nix store
nix store gc
https://github.com/NixOS/nix/pull/7608min-free
andmax-free
config options, and remove--max
flag--max
is closer to the understanding of--min
and can/should also be idempotent relative to disk space?nix store ping
https://github.com/NixOS/nix/issues/8914nix store info
nix store add-file
,nix store add-path
https://github.com/NixOS/nix/issues/8915--recursive
should be the default due to history and to match string-interpolation behavior--key value
orcreate PR to CLI guidelines--value1|--value2
Not a blocker for stabilisationnix store import
,nix store export
nix store delete
provide better information about why something was not deletedNot required for stabilisationhttps://github.com/NixOS/nix/issues/9475Not required for stabilisationnix store optimise
To be discussed
Stuff that hasn't been processed yet
[ ]
nix copy
[x]
nix describe-stores
nix help-stores
[ ]
nix path-info
[ ]
nix build
[ ]
nix develop
[ ]
nix print-dev-env
[ ]
nix shell
[ ]
nix run
[ ]
nix search
[ ]
nix repl
[ ]
nix eval
[ ]
nix bundle
[ ]
nix edit
[ ]
nix fmt
[ ]
nix log
[ ]
nix registry
[ ]
nix why-depends
[ ]
nix derivation
[ ]
nix profile
: https://github.com/NixOS/nix/issues/7966[ ]
nix realisation
[ ]
nix upgrade-nix
[ ]
nix flake
Global concerns
Blocked on installables
nix shell
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
sigs-needed
only takes into account the cryptographic portion of the key, not the namenix store sign
-r
)--key-file -
to read key from stdin, exclusive with--stdin
, but then how to pass both via pipe?--pipe FD
for which--stdin
is alias for--pipe /dev/fd/0
?References
CLI Guidelines legacy CLI mapping