-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port the flags of nix-daemon to nix daemon #8788
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 <edolstra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can declaratively mark flags as experimental with the new CLI
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: John Ericson <git@JohnEricson.me>
@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 override After: $ # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, just "Forces the daemon to trust connecting clients." would be enough as a description in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think that is good
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.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: https://discourse.nixos.org/t/2023-08-28-nix-team-meeting-minutes-83/32290/1 |
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 daemon
command doesn't accept the same flags thatnix-daemon
does.Context
Ref #8785
Fixes #7128
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.