Skip to content
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

nix daemon vs nix-daemon #8785

Closed
2 tasks done
bryanhonof opened this issue Aug 4, 2023 · 1 comment
Closed
2 tasks done

nix daemon vs nix-daemon #8785

bryanhonof opened this issue Aug 4, 2023 · 1 comment

Comments

@bryanhonof
Copy link
Member

bryanhonof commented Aug 4, 2023

Problem

I can't see if there's a difference between the nix-daemon and nix daemon command.
The current documentation of both looks quite similar, but it doesn't seem both accept the same flags.
E.g. I can pass --stdio to nix-daemon, but not to nix daemon.

$ # Just waits for connections, or user interrupt
$ nix-daemon --stdin
$ nix daemon --stdio
error: unrecognised flag '--stdio'
Try 'nix --help' for more information.

Proposal

Clarify which flags both command accept, and what their intended use-cases are.

Checklist

Priorities

Add 👍 to issues you find important.

Ref #7128

@bryanhonof
Copy link
Member Author

The relevant code is located here, at least, I believe so.

nix/src/nix/daemon.cc

Lines 471 to 490 in 635df5e

parseCmdLine(argc, argv, [&](Strings::iterator & arg, const Strings::iterator & end) {
if (*arg == "--daemon")
; // ignored for backwards compatibility
else if (*arg == "--help")
showManPage("nix-daemon");
else if (*arg == "--version")
printVersion("nix-daemon");
else if (*arg == "--stdio")
stdio = true;
else if (*arg == "--force-trusted") {
experimentalFeatureSettings.require(Xp::DaemonTrustOverride);
isTrustedOpt = Trusted;
} else if (*arg == "--force-untrusted") {
experimentalFeatureSettings.require(Xp::DaemonTrustOverride);
isTrustedOpt = NotTrusted;
} else if (*arg == "--default-trust") {
experimentalFeatureSettings.require(Xp::DaemonTrustOverride);
isTrustedOpt = std::nullopt;
} else return false;
return true;

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

No branches or pull requests

1 participant