From 84e8b2aaf07dded73c0b59af3e61b496231c7b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 4 Nov 2024 14:21:03 +0100 Subject: [PATCH] add facter.dhcp.enable option --- modules/nixos/networking/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nixos/networking/default.nix b/modules/nixos/networking/default.nix index 0af40f8..e80408b 100644 --- a/modules/nixos/networking/default.nix +++ b/modules/nixos/networking/default.nix @@ -4,7 +4,11 @@ ./broadcom.nix ./intel.nix ]; - config = lib.mkIf (builtins.length (config.facter.report.network_interface or [ ]) > 0) { + + options.facter.detected.dhcp.enable = lib.mkEnableOption "Facter dhcp module" // { + default = builtins.length config.facter.report.network_interface or [ ] > 0; + }; + config = lib.mkIf config.facter.detected.dhcp.enable { networking.useDHCP = lib.mkDefault true; networking.useNetworkd = lib.mkDefault true; };