dotfiles

My PC Dotfiles & Website
commit 394d9bb908721874160534b737790265c555d3c0
parent f641bfca607195d8a9dff021a1a8094260df850d
Author: maydayv7 <maydayv7@gmail.com>
Date:   Wed,  1 May 2024 12:23:16 +0530

feat: Laptop Power Management

Use `powertop` and ditch `thermald`
Also fix Netlify checks and QEMU UEFI Support (See https://github.com/NixOS/nixpkgs/issues/115996)

Diffstat:

5 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/checks/netlify.toml b/checks/netlify.toml @@ -2,7 +2,7 @@ publish = "build" command = """ export NP_GIT=$(which git) -wget -nv https://github.com/DavHau/nix-portable/releases/latest/download/nix-portable +curl -L https://github.com/DavHau/nix-portable/releases/latest/download/nix-portable-$(uname -m) > ./nix-portable chmod +x nix-portable ./nix-portable nix build --impure --expr "with import <nixpkgs> {}; callPackage ./site { site = ${DEPLOY_PRIME_URL}; }" ./nix-portable nix shell nixpkgs#bash -c "bash" -c "cp -rL result build" diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -41,19 +41,15 @@ "/var/lib/bluetooth" ]; - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - networking = { networkmanager.enable = true; firewall.enable = true; }; - # Power Management - services.thermald.enable = true; - powerManagement.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; # Memory systemd.oomd.enable = false; @@ -70,6 +66,7 @@ enable = true; enableSSHSupport = true; }; + user.persist.directories = [ { directory = ".gnupg"; @@ -84,6 +81,7 @@ PasswordAuthentication = true; PermitRootLogin = lib.mkForce "no"; }; + hostKeys = [ { comment = "Host SSH Key"; diff --git a/modules/base/security.nix b/modules/base/security.nix @@ -92,13 +92,13 @@ networking.extraHosts = builtins.readFile (pkgs.fetchurl { # Shady Sites - url = "https://raw.githubusercontent.com/shreyasminocha/shady-hosts/fc9cc4020e80b3f87024c96178cba0f766b95e7a/hosts"; - sha256 = "jbsEiIcOjoglqLeptHhwWhvL/p0PI3DVMdGCzSXFgNA="; + url = "https://raw.githubusercontent.com/shreyasminocha/shady-hosts/a5647df22b0dc5ff6c866f21ee2d8b588682626a/hosts"; + sha256 = "sha256-f6xCphzFHFYfOhMv+488amAMy+rSyHxQs/21nyvBtiU="; }) + builtins.readFile (pkgs.fetchurl { # Crypto Scams - url = "https://raw.githubusercontent.com/MetaMask/eth-phishing-detect/3be0b9594f0bc6e3e699ee30cb2e809618539597/src/hosts.txt"; - sha256 = "b3HvaLxnUJZOANUL/p+XPNvu9Aod9YLHYYtCZT5Lan0="; + url = "https://raw.githubusercontent.com/MetaMask/eth-phishing-detect/78e727318a77fd62521d220e25871cdb65b8f00d/src/hosts.txt"; + sha256 = "sha256-b3HvaLxnUJZOANUL/p+XPNvu9Aod9YLHYYtCZT5Lan0="; }); }; } diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix @@ -9,11 +9,17 @@ in { ## Laptop Configuration ## config = lib.mkIf enable { - # Lid - services.logind.extraConfig = '' - HandleLidSwitch=lock - HandleLidSwitchExternalPower=lock - ''; + services.logind = { + killUserProcesses = true; + + # Power Button + powerKey = "poweroff"; + powerKeyLongPress = "reboot"; + + # Lid + lidSwitch = "lock"; + lidSwitchDocked = "ignore"; + }; # Audio user.homeConfig.home.file.".config/autostart/audio-tweaks.desktop".text = '' @@ -40,5 +46,11 @@ in { accelSpeed = "0.7"; }; }; + + # Battery + powerManagement = { + enable = true; + powertop.enable = true; + }; }; } diff --git a/modules/hardware/virtualisation/default.nix b/modules/hardware/virtualisation/default.nix @@ -51,7 +51,7 @@ in { swtpm.enable = true; ovmf = { enable = true; - packages = [pkgs.OVMFFull]; + packages = [pkgs.OVMFFull.fd]; }; }; };