diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 08ef60d..cbbd969 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -5,6 +5,7 @@ ./esphome.nix ./gnome.nix ./i18n.nix + ./networking.nix ./plasma.nix ./plymouth.nix ./steam.nix diff --git a/modules/desktop/networking.nix b/modules/desktop/networking.nix new file mode 100644 index 0000000..156408c --- /dev/null +++ b/modules/desktop/networking.nix @@ -0,0 +1,43 @@ +{ lib +, config +, pkgs +, ... +}: +let + cfg = config.my.desktop.networking; +in +{ + options.my.desktop.networking = { + enable = lib.mkEnableOption "Enable networking on desktop"; + + hostname = lib.mkOption { + type = lib.types.str; + description = "The PC hostname"; + default = "desktop-123"; + }; + + localDNS = lib.mkOption { + type = lib.types.listOf lib.types.str; + description = "The local DNS resolver (es. PiHole)"; + default = [ "192.168.1.1" ]; + }; + }; + + config = lib.mkIf cfg.enable { + networking = { + hostName = cfg.hostname; + + # Enable networking + networkmanager = { + enable = true; + wifi.powersave = false; + }; + + nameservers = cfg.localDNS ++ [ + "1.1.1.1" + "8.8.8.8" + ]; + }; + }; + +}