configure laptop (thunderbolt, ip, sleep, wol)
This commit is contained in:
4
modules/no-sleep-lid-closed.nix
Normal file
4
modules/no-sleep-lid-closed.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
{
|
||||
services.logind.lidSwitchExternalPower = "ignore";
|
||||
}
|
||||
@@ -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
29
modules/static-ip.nix
Normal 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
7
modules/thunderbolt.nix
Normal 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"
|
||||
'';
|
||||
}
|
||||
@@ -3,5 +3,5 @@ let
|
||||
interface = vars.interface;
|
||||
in
|
||||
{
|
||||
networking.interfaces.${interface}.wakeOnLan.enable;
|
||||
networking.interfaces.${interface}.wakeOnLan.enable = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user