Port the flags of nix-daemon to nix daemon#8788
Conversation
The new `nix daemon` command didn't accept the same flags that `nix-daemon` did.
b3649b6 to
2c94ac5
Compare
Co-authored-by: Eelco Dolstra <[email protected]>
Ericson2314
left a comment
There was a problem hiding this comment.
We can declaratively mark flags as experimental with the new CLI
Co-authored-by: John Ericson <[email protected]>
Co-authored-by: John Ericson <[email protected]>
Co-authored-by: John Ericson <[email protected]>
@Ericson2314 I'm getting the following warning, which, I believe, is just fixed by switching src/nix/daemon.cc:518:13: warning: ISO C++ requires field designators to be specified in declaration order; field 'experimentalFeature' will be initialized after field 'handler' [-Wreorder-init-list]
.handler = {[&]() {
^~~~~~~~~~~~~~~~~~~
src/nix/daemon.cc:517:36: note: previous initialization for field 'experimentalFeature' is here
.experimentalFeature = Xp::DaemonTrustOverride,
^~~~~~~~~~~~~~~~~~~~~~~However, what I find more concerning, when I now run the Before: $ ./outputs/out/bin/nix --extra-experimental-features nix-command daemon --force-untrusted --stdio
error: experimental Nix feature 'daemon-trust-override' is disabled; use '--extra-experimental-features daemon-trust-override' to overrideAfter: $ # Simply waits for input it seems like
$ ./outputs/out/bin/nix --extra-experimental-features nix-command daemon --force-untrusted --stdio
|
src/nix/daemon.cc
Outdated
|
|
||
| addFlag({ | ||
| .longName = "force-trusted", | ||
| .description = "Forces the daemon to trust connecting clients, forwarding the connection without the receiving daemon processing it.", |
There was a problem hiding this comment.
Does this actually forward the connection? I assume that depends on nix daemon's own --store parameter: If it's "local", then it won't forward to another daemon.
There was a problem hiding this comment.
That is true. Forcing untrusted does make not force in the --stdio case when --store is a RemoteStore subclass, but forcing trusted (if I am reading the code above right) doesn't seem to affect when forwarding happens.
There was a problem hiding this comment.
So, just "Forces the daemon to trust connecting clients." would be enough as a description in this case?
src/nix/daemon.cc
Outdated
|
|
||
| addFlag({ | ||
| .longName = "force-untrusted", | ||
| .description = "Forces the daemon to not trust connecting clients, the connection will be processed by the receiving daemon before forwarding commands.", |
There was a problem hiding this comment.
| .description = "Forces the daemon to not trust connecting clients, the connection will be processed by the receiving daemon before forwarding commands.", | |
| .description = "Force the daemon to not trust connecting clients. The connection will be processed by the receiving daemon before forwarding commands.", |
|
Reviewed in Nix team meeting for stabilisation effort:
|
@fricklerhandwerk Wouldn't mind giving it a shot. Where can I find examples/docs of this? |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Some of these are a bit after the specified time period, but I also believe some of these items are difficult to gauge how much "impact" they had. Helped organize, host, and run, the Summer of Nix Lecture Series 2022 - https://www.youtube.com/playlist?list=PLt4-_lkyRrOMWyp5G-m_d1wtTcbBaOxZk - NixOS/infra#213 Helped organize, and host infra for, the Summer of Nix Lecture Series 2023 - https://www.youtube.com/playlist?list=PLt4-_lkyRrOPcBuz_tjm6ZQb-6rJjU3cf - NixOS/infra#240 Helped organize, host, and was responsible for livestreaming infra during, NixCon Paris 2022 - https://www.youtube.com/playlist?list=PLgknCdxP89ReD6gxl755B6G_CI65z4J2e Maintenance of some nixpkgs packages - NixOS/nixpkgs#340223 (contribution after 2024-05-01) - NixOS/nixpkgs#290084 - NixOS/nixpkgs#170089 Organized, and assembled a team for the FOSDEM 2023 Nix/NixOS Devroom - https://discourse.nixos.org/t/fosdem-2023-nix-and-nixos-devroom/23133 Organizer & sole maintainer of the Config Management Camp Nix track - https://discourse.nixos.org/t/config-management-camp-2023-ghent/23455 - https://discourse.nixos.org/t/config-management-camp-2024-ghent/33852 - https://discourse.nixos.org/t/cfgmgmtcamp-2025-is-looking-for-nix-presentations/51658 (contribution after 2024-05-01) Public speaking & spreading awareness of Nix/NixOS - https://youtu.be/gUjvnZ9ZwMs?si=nDiZTCpQj53wwq8P - https://www.youtube.com/watch?v=hNcYPH5Q_pA&t=862s The occasional dabble into the Nix C++ code base - NixOS/nix#11494 (contribution after 2024-05-01) - NixOS/nix#11490 (contribution after 2024-05-01) - NixOS/nix#11489 (contribution after 2024-05-01) - NixOS/nix#11349 (contribution after 2024-05-01) - NixOS/nix#11241 (contribution after 2024-05-01) - NixOS/nix#9557 - NixOS/nix#8788 - NixOS/nix#8212 - NixOS/nix#5147 General evangelism Pretty much every event I attend, I'm talking about Nix, showing off Nix/NixOS, and just trying to get people to see how awesome this tool is.
Motivation
The new
nix daemoncommand doesn't accept the same flags thatnix-daemondoes.Context
Ref #8785
Fixes #7128
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.shsrc/*/teststests/nixos/*Priorities
Add 👍 to pull requests you find important.