configure laptop (thunderbolt, ip, sleep, wol)

This commit is contained in:
Kopatz
2023-11-20 08:56:54 +01:00
parent b584dafa8c
commit 39c1759d6a
9 changed files with 35 additions and 7 deletions

View File

@@ -0,0 +1,4 @@
{
services.logind.lidSwitchExternalPower = "ignore";
}

View File

@@ -1,5 +1,9 @@
{ config, pkgs, lib, vars, ... }:
let
wm = vars.wm;
in
{
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "startplasma-x11";
services.xrdp.defaultWindowManager = wm;
services.xrdp.openFirewall = true;
}
}

29
modules/static-ip.nix Normal file
View File

@@ -0,0 +1,29 @@
{ config, vars, ...}:
let
ip = vars.ipv4;
dns = vars.dns;
interface = vars.interface;
in
{
networking = {
defaultGateway = "192.168.0.1";
useDHCP = false;
firewall = {
enable = true;
allowedUDPPorts = [ 5000 ];
};
nameservers = [
dns
"1.1.1.1"
];
interfaces = {
${interface} = {
name = "eth0";
ipv4.addresses = [{
address = ip;
prefixLength = 24;
}];
};
};
};
}

7
modules/thunderbolt.nix Normal file
View File

@@ -0,0 +1,7 @@
{
services.udev.extraRules = ''
# Always authorize thunderbolt connections when they are plugged in.
# This is to make sure the USB hub of Thunderbolt is working.
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
'';
}

View File

@@ -3,5 +3,5 @@ let
interface = vars.interface;
in
{
networking.interfaces.${interface}.wakeOnLan.enable;
networking.interfaces.${interface}.wakeOnLan.enable = true;
}