Networking for dekstop
This commit is contained in:
parent
797411f44a
commit
5c236b5c33
2 changed files with 44 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
43
modules/desktop/networking.nix
Normal file
43
modules/desktop/networking.nix
Normal 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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue