0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/networkmanager: add a package option

this is helpful for testing module changes or making downstream patches
in a way which doesn't force large rebuilds as an overlay would.
This commit is contained in:
Colin 2024-06-02 05:57:51 +00:00
parent 9d4d21b587
commit efc3208be2

View file

@ -129,7 +129,7 @@ let
packages = packages =
[ [
pkgs.networkmanager cfg.package
] ]
++ cfg.plugins ++ cfg.plugins
++ lib.optionals (!delegateWireless && !enableIwd) [ ++ lib.optionals (!delegateWireless && !enableIwd) [
@ -161,6 +161,8 @@ in
''; '';
}; };
package = mkPackageOption pkgs "networkmanager" { };
connectionConfig = mkOption { connectionConfig = mkOption {
type = type =
with types; with types;
@ -643,7 +645,7 @@ in
${pkgs.envsubst}/bin/envsubst -i ${ini.generate (lib.escapeShellArg profile.n) profile.v} > ${path (lib.escapeShellArg profile.n)} ${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) '') (lib.mapAttrsToList (n: v: { inherit n v; }) cfg.ensureProfiles.profiles)
+ '' + ''
${pkgs.networkmanager}/bin/nmcli connection reload ${cfg.package}/bin/nmcli connection reload
''; '';
serviceConfig = { serviceConfig = {
EnvironmentFile = cfg.ensureProfiles.environmentFiles; EnvironmentFile = cfg.ensureProfiles.environmentFiles;