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

@@ -38,6 +38,7 @@
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
./systems/server/configuration.nix ./systems/server/configuration.nix
### Modules ### ### Modules ###
./modules/static-ip.nix
./modules/hdd-spindown.nix ./modules/hdd-spindown.nix
./modules/minecraft-server.nix ./modules/minecraft-server.nix
./modules/motd.nix ./modules/motd.nix
@@ -83,7 +84,11 @@
./laptop/configuration.nix ./laptop/configuration.nix
./modules/virt-manager.nix ./modules/virt-manager.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/wake-on-lan.nix #./modules/static-ip.nix
#./modules/no-sleep-lid-closed.nix
#./modules/wake-on-lan.nix
./modules/thunderbolt.nix
./modules/rdp.nix
nixos-hardware.nixosModules.dell-xps-15-7590-nvidia nixos-hardware.nixosModules.dell-xps-15-7590-nvidia
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@@ -102,6 +107,9 @@
./modules/virt-manager.nix ./modules/virt-manager.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/wake-on-lan.nix ./modules/wake-on-lan.nix
./modules/static-ip.nix
./modules/no-sleep-lid-closed.nix
./modules/thunderbolt.nix
nixos-hardware.nixosModules.dell-xps-15-7590 nixos-hardware.nixosModules.dell-xps-15-7590
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager

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.enable = true;
services.xrdp.defaultWindowManager = "startplasma-x11"; services.xrdp.defaultWindowManager = wm;
services.xrdp.openFirewall = true; services.xrdp.openFirewall = true;
} }

View File

@@ -1,6 +1,7 @@
{ config, vars, ...}: { config, vars, ...}:
let let
ip = vars.ipv4; ip = vars.ipv4;
dns = vars.dns;
interface = vars.interface; interface = vars.interface;
in in
{ {
@@ -12,7 +13,7 @@ in
allowedUDPPorts = [ 5000 ]; allowedUDPPorts = [ 5000 ];
}; };
nameservers = [ nameservers = [
"127.0.0.1" dns
"1.1.1.1" "1.1.1.1"
]; ];
interfaces = { interfaces = {

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; interface = vars.interface;
in in
{ {
networking.interfaces.${interface}.wakeOnLan.enable; networking.interfaces.${interface}.wakeOnLan.enable = true;
} }

View File

@@ -1,4 +1,7 @@
{ {
interface = "enp0s31f6"; interface = "enp10s0u1u2";
ipv4 = "192.168.0.4";
dns = "192.168.0.6";
wm = "gnome-shell";
} }

View File

@@ -12,7 +12,6 @@ in{
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./static-ip.nix
]; ];
# Bootloader. # Bootloader.

View File

@@ -1,5 +1,7 @@
{ {
interface = "enp0s31f6"; interface = "enp0s31f6";
ipv4 = "192.168.0.6"; ipv4 = "192.168.0.6";
dns = "127.0.0.1";
wireguardIp = "192.168.2.1"; wireguardIp = "192.168.2.1";
wm = "startplasma-x11";
} }