-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nixos/systemd: move systemd-provided NSS modules to systemd module #86940
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -827,6 +827,27 @@ in | |
|
||
system.build.units = cfg.units; | ||
|
||
# Systemd provides various NSS modules to look up dynamic users, locally | ||
# configured IP adresses and local container hostnames. | ||
# On NixOS, these can only be passed to the NSS system via nscd (and its | ||
# LD_LIBRARY_PATH), which is why it's usually a very good idea to have nscd | ||
# enabled (also see the config.nscd.enable description). | ||
# While there is already an assertion in place complaining loudly about | ||
# having nssModules configured and nscd disabled, for some reason we still | ||
# check for nscd being enabled before adding to nssModules. | ||
Comment on lines
+835
to
+837
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @florianjacob as the author of e370e97, can you elaborate on why we silently disable these nss modules if nscd is disabled, even though there's an assertion in https://github.com/NixOS/nixpkgs/pull/86940/files#diff-5796c52b71eee35842f408f4126430d6R126-R127 which should complain if nss modules are present, but nscd disabled (so nssModules are not respected)? Maybe instead of silently ignoring these (and breaking dynamic user support, as well as other NSS modules), can't we ask the user to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really like your idea. There is no reason for the current behaviour and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope @florianjacob can shed some light on this. I think we should never have to add vague comments like |
||
system.nssModules = optional config.services.nscd.enable systemd.out; | ||
system.nssDatabases = mkIf config.services.nscd.enable { | ||
hosts = (mkMerge [ | ||
[ "mymachines" ] | ||
(mkOrder 1600 [ "myhostname" ] # 1600 to ensure it's always the last | ||
) | ||
]); | ||
passwd = (mkMerge [ | ||
[ "mymachines" ] | ||
(mkAfter [ "systemd" ]) | ||
]); | ||
}; | ||
|
||
environment.systemPackages = [ systemd ]; | ||
|
||
environment.etc = let | ||
|
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.
This isn't enough. We need to mkOrder in such a way that we're sure
dns
followsresolve
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.
dns
is still added with(mkAfter [ "dns" ])
- trynix-build nixos/tests/networking.nix --arg networkd true -A dhcpOneIf.driver && result/bin/nixos-run-vms
andcat /etc/nsswitch.conf
on the client: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.
perfect