mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-21 20:49:52 +03:00
Merge pull request #69422 from arianvp/fix-machinectl
nixos/systemd: Make machinectl work with NixOS
This commit is contained in:
commit
e24526d38e
@ -113,11 +113,21 @@ in {
|
|||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
units = mapAttrs' (n: v: let nspawnFile = "${n}.nspawn"; in nameValuePair nspawnFile (instanceToUnit nspawnFile v)) cfg;
|
units = mapAttrs' (n: v: let nspawnFile = "${n}.nspawn"; in nameValuePair nspawnFile (instanceToUnit nspawnFile v)) cfg;
|
||||||
in mkIf (cfg != {}) {
|
in
|
||||||
|
mkMerge [
|
||||||
environment.etc."systemd/nspawn".source = generateUnits "nspawn" units [] [];
|
(mkIf (cfg != {}) {
|
||||||
|
environment.etc."systemd/nspawn".source = mkIf (cfg != {}) (generateUnits "nspawn" units [] []);
|
||||||
systemd.targets.multi-user.wants = [ "machines.target" ];
|
})
|
||||||
};
|
{
|
||||||
|
systemd.targets.multi-user.wants = [ "machines.target" ];
|
||||||
|
|
||||||
|
# Workaround for https://github.com/NixOS/nixpkgs/pull/67232#issuecomment-531315437 and https://github.com/systemd/systemd/issues/13622
|
||||||
|
# Once systemd fixes this upstream, we can re-enable -U
|
||||||
|
systemd.services."systemd-nspawn@".serviceConfig.ExecStart = [
|
||||||
|
"" # deliberately empty. signals systemd to override the ExecStart
|
||||||
|
# Only difference between upstream is that we do not pass the -U flag
|
||||||
|
"${pkgs.systemd}/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth --settings=override --machine=%i"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user