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
switch-to-configuration: use Net::DBus to retrieve the list of units #28206
Conversation
@volth The library won't be absent - it's part of the Nix store, and included by its store path, just like |
nixos-infect just runs it from the store, using the same shebang line it would use on NixOS, and hence the same interpreter and libraries: https://github.com/elitak/nixos-infect/blob/769dce60c939add8fae5bc9f03fc96d8661a76a7/nixos-infect#L235 |
Looks fine to me. @edolstra might have opinions? |
58324bc
to
6ebae06
Compare
@@ -127,7 +127,7 @@ let | |||
configurationName = config.boot.loader.grub.configurationName; | |||
|
|||
# Needed by switch-to-configuration. | |||
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl"; | |||
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl -I${pkgs.perlPackages.NetDBus}/lib/perl5/site_perl -I${pkgs.perlPackages.XMLParser}/lib/perl5/site_perl -I${pkgs.perlPackages.XMLTwig}/lib/perl5/site_perl"; |
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.
Can be cleaned up to ${concatStringsSep " " (map (lib: "-I${lib}/${pkgs.perl.libPrefix}") (with pkgs.perlPackages; [ FileSlurp NetDBus XMLParser XMLTwig ]))}
. Is not there an existing function (like python.withPackages
) for that?
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.
I don't know of one, and digging around naively didn't find me it. I could most definitely write one, though.
This resolves the FIXME, and opens up the possibility of using more of the systemd DBus interface to make things more robust.
6ebae06
to
2fa1165
Compare
Honestly looks good to me. It's usually good to merge these things before they go stale. Any objections? @GrahamcOfBorg eval |
Any remaining objections? |
This is breaking something: https://hydra.nixos.org/build/73531916/nixlog/1 Reverted in ca30c5e |
@@ -127,7 +127,8 @@ let | |||
configurationName = config.boot.loader.grub.configurationName; | |||
|
|||
# Needed by switch-to-configuration. | |||
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl"; | |||
|
|||
perl = "${pkgs.perl}/bin/perl " + (concatMapStringsSep " " (lib: "-I${lib}/${pkgs.perl.libPrefix}") (with perlPackages; [ FileSlurp NetDBus XMLParser XMLTwig ])); |
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.
Right, this should probably be pkgs.perlPackages
.
Whoops, apparently what I tested wasn't exactly what I pushed. I've fixed that and tested evaluation now. Sorry for the inconvenience. |
Motivation for this change
This resolves the FIXME, and opens up the possibility of using more of
the systemd DBus interface to make things more robust.
Things done