73 lines
1.8 KiB
Nix
73 lines
1.8 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./hardware.nix
|
|
../../system
|
|
../../system/security/thinkpad.nix
|
|
];
|
|
|
|
networking.hostName = "violet";
|
|
|
|
services.power-profiles-daemon.enable = true;
|
|
services.hardware.bolt.enable = true;
|
|
services.logind = {
|
|
settings = {
|
|
Login.HandleLidSwitch = "ignore";
|
|
Login.lidSwitchDocked = "ignore";
|
|
Login.lidSwitchExternalPower = "ignore";
|
|
};
|
|
};
|
|
|
|
services.input-remapper.enable = true;
|
|
|
|
system.stateVersion = "26.05";
|
|
|
|
boot.kernelModules = [ "bnep" ];
|
|
|
|
networking.interfaces.bnep0.ipv4.addresses = [{
|
|
address = "10.0.0.2";
|
|
prefixLength = 24;
|
|
}];
|
|
|
|
networking.firewall.interfaces."bnep0".allowedUDPPorts = [ 4242 ];
|
|
|
|
systemd = {
|
|
services = {
|
|
bt-pan-client = {
|
|
description = "Bluetooth PAN Client Connection to Device A";
|
|
after = [ "bluetooth.service" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
# Replace XX:XX:XX:XX:XX:XX with Device B's actual Bluetooth MAC Address
|
|
ExecStartPre = "${pkgs.bluez}/bin/bluetoothctl trust 84:D1:C1:A9:EE:52";
|
|
ExecStart = "${pkgs.bluez-tools}/bin/bt-network -c 84:D1:C1:A9:EE:52 bnep";
|
|
Restart = "always";
|
|
RestartSec = 10; # Retry every 10 seconds if Device B goes out of range
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
services.tlp = {
|
|
enable = false;
|
|
settings = {
|
|
USB_AUTOSUSPEND = 0;
|
|
|
|
# AC
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
SOUND_POWER_SAVE_ON_AC = 0;
|
|
PCIE_ASPM_ON_AC = "default";
|
|
CPU_BOOST_ON_BAT = 0;
|
|
|
|
# Battery
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
|
SOUND_POWER_SAVE_ON_BAT = 1;
|
|
PCIE_ASPM_ON_BAT = "powersupersave";
|
|
CPU_BOOST_ON_AC = 1;
|
|
};
|
|
};
|
|
}
|