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
tree-wide: use systemctl of running system #88492
Conversation
Also, make the postRun script refer to that systemctl, and not just rely on $PATH for consistency.
…tly running systemd
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 haven't tested this, but diff LGTM.
This makes a bunch of things depend on the filesystem layout of NixOS. If we want to say "use the ambient systemctl", would it not be reasonable to just take it from |
In some of these cases, In terms of patching applications people might install with Nix on non-NixOS - I didn't look through all of these. The only 3 changes in this PR don't seem critical:
|
Unfortunately this blocks both channels now. There are some checks:
I used nix build -f nixos/release-small.nix nixos.tests.boot.biosCdrom.x86_64-linux to bisect to 1955982. |
NixOS#88492 flipped some references to systemctl from config.systemd.package to /run/current-system/systemd/, which udevRules obviously isn't able resolve. If we encounter such references, replace them with config.systemd.package before doing the check.
Yeah, the check in I taught |
In many different places in nixpkgs, when shelling out to
systemctl
, we referred to it as${pkgs.systemd}/bin/systemctl
or${config.systemd.package}/bin/systemctl
.While this provides a
systemctl
binary, it's not necessarily one that's fully compatible with the one that's currently running. As the systemd of the running configuration is available at/run/current-system/systemd
, we can refer tosystemctl
via/run/current-system/systemd/bin/systemctl
.This should also prevent some service restarts in the case of
systemd.package
being updated.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)