mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
Merge pull request #296465 from Janik-Haag/networkmanager-ensure-profiles
nixos/networkmanager: ensure-profiles, make sure networkmanager is running
This commit is contained in:
commit
5ebdb3eda7
@ -584,6 +584,7 @@ in
|
||||
description = "Ensure that NetworkManager declarative profiles are created";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
before = [ "network-online.target" ];
|
||||
after = [ "NetworkManager.service" ];
|
||||
script = let
|
||||
path = id: "/run/NetworkManager/system-connections/${id}.nmconnection";
|
||||
in ''
|
||||
@ -593,9 +594,7 @@ in
|
||||
${pkgs.envsubst}/bin/envsubst -i ${ini.generate (lib.escapeShellArg profile.n) profile.v} > ${path (lib.escapeShellArg profile.n)}
|
||||
'') (lib.mapAttrsToList (n: v: { inherit n v; }) cfg.ensureProfiles.profiles)
|
||||
+ ''
|
||||
if systemctl is-active --quiet NetworkManager; then
|
||||
${pkgs.networkmanager}/bin/nmcli connection reload
|
||||
fi
|
||||
'';
|
||||
serviceConfig = {
|
||||
EnvironmentFile = cfg.ensureProfiles.environmentFiles;
|
||||
|
Loading…
Reference in New Issue
Block a user