-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Move systemd-lib.nix and systemd-unit-options.nix into utils #146815
Conversation
One minor concern I have for this PR was that I struggled for a little while with an infinite recursion issue. Turns out my issue was putting I was thinking about removing all the uses of |
Note: This is part of my effort to put systemd in initrd; as I'm about to make another module that uses these utils. |
If it's not too much trouble I'd recommend using inherit instead of with |
@Artturin Yea, there was a discussion about that (regarding this very code) on matrix earlier today. While I generally agree with the sentiment, it's worth noting that e.g. the networkd module would have a really gross |
You could add a comment warning users above the with and use inherit elsewhere |
A lot of this could be refactored into modules. We have some underappreciated possibilities in the module system could be quite helpful for keeping things together.
This way, you won't need "utils" files as much. |
Here's an example of this kind of refactoring #82751 (comment) |
@roberth I'm not exactly following what you're suggesting. How could the module system be used in this case? |
It's probably best to wait for that issue to be resolved first. It seems that such a refactoring would make some of the rewiring in this PR obsolete, but this PR does not make the that change any harder, so there's no need to block this. |
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.
It seems to solve a problem for you.
@@ -1,4 +1,4 @@ | |||
pkgs: with pkgs.lib; | |||
{ lib, config, pkgs }: with lib; |
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.
It's not great that there's more wiring now, but I think we'll have to wait with systemd refactoring, as mentioned in the earlier comment.
I guess that's just the faith of "utils", to grow all sorts of weird dependencies, because everyone wants to use them for their own distinct purposes. I hope we'll remove it altogether in the future.
lol, turns out this broke eval internally for all our systems on the unstable channel, because we have some cursed code that does Edit: changed it to |
There are several modules that redundantly import the
systemd-lib.nix
andsystemd-unit-options.nix
files. I thought it'd be good if they all got them from the same place.Tested with:
All test results were fetched from cache, so eval is unchanged.