Networking for dekstop

This commit is contained in:
pazpi 2024-09-11 22:49:46 +02:00
parent 797411f44a
commit 5c236b5c33
No known key found for this signature in database
GPG key ID: 0942571C4B9966BE
2 changed files with 44 additions and 0 deletions

View file

@ -5,6 +5,7 @@
./esphome.nix ./esphome.nix
./gnome.nix ./gnome.nix
./i18n.nix ./i18n.nix
./networking.nix
./plasma.nix ./plasma.nix
./plymouth.nix ./plymouth.nix
./steam.nix ./steam.nix

View file

@ -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"
];
};
};
}