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

switch-to-configuration: use Net::DBus to retrieve the list of units #28206

Merged
merged 1 commit into from May 2, 2018

Conversation

edef1c
Copy link
Member

@edef1c edef1c commented Aug 12, 2017

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

@edef1c
Copy link
Member Author

edef1c commented Aug 13, 2017

@volth The library won't be absent - it's part of the Nix store, and included by its store path, just like File::Slurp is.

@edef1c
Copy link
Member Author

edef1c commented Aug 17, 2017

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
If you have any further concerns about this not working, please do actually test it and post error output.

@edef1c edef1c changed the title [WIP] switch-to-configuration: use Net::DBus to retrieve the list of units switch-to-configuration: use Net::DBus to retrieve the list of units Sep 8, 2017
@copumpkin
Copy link
Member

Looks fine to me. @edolstra might have opinions?

@@ -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";
Copy link
Contributor

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?

Copy link
Member Author

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.
@matthewbauer
Copy link
Member

Honestly looks good to me. It's usually good to merge these things before they go stale. Any objections?

@GrahamcOfBorg eval

@edef1c
Copy link
Member Author

edef1c commented May 2, 2018

Any remaining objections?

@matthewbauer matthewbauer merged commit e508f0e into NixOS:master May 2, 2018
@matthewbauer
Copy link
Member

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 ]));
Copy link
Contributor

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.

matthewbauer added a commit that referenced this pull request May 2, 2018
This reverts commit e508f0e, reversing
changes made to bead42d.
Synthetica9 pushed a commit to Synthetica9/nixpkgs that referenced this pull request May 3, 2018
@edef1c
Copy link
Member Author

edef1c commented May 3, 2018

Whoops, apparently what I tested wasn't exactly what I pushed. I've fixed that and tested evaluation now. Sorry for the inconvenience.

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

Successfully merging this pull request may close these issues.

None yet

6 participants