diff --git a/files/scripts/brightness-down.sh b/files/scripts/brightness-down.sh new file mode 100755 index 0000000..1f01021 --- /dev/null +++ b/files/scripts/brightness-down.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec brightnessctl set 5%- diff --git a/files/scripts/brightness-up.sh b/files/scripts/brightness-up.sh new file mode 100755 index 0000000..b01b496 --- /dev/null +++ b/files/scripts/brightness-up.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec brightnessctl set +5% diff --git a/files/scripts/volume-down.sh b/files/scripts/volume-down.sh new file mode 100755 index 0000000..4b3dd55 --- /dev/null +++ b/files/scripts/volume-down.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Running volume-down.sh at $(date)" >> /tmp/dwl-script.log +echo "USER=$USER" >> /tmp/dwl-script.log +echo "PATH=$PATH" >> /tmp/dwl-script.log +exec pactl set-sink-volume @DEFAULT_SINK@ -5% diff --git a/files/scripts/volume-mute.sh b/files/scripts/volume-mute.sh new file mode 100755 index 0000000..cf4ecb2 --- /dev/null +++ b/files/scripts/volume-mute.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec pactl set-sink-mute @DEFAULT_SINK@ toggle diff --git a/files/scripts/volume-up.sh b/files/scripts/volume-up.sh new file mode 100755 index 0000000..75aaec2 --- /dev/null +++ b/files/scripts/volume-up.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Running volume-up.sh at $(date)" >> /tmp/dwl-script.log +echo "USER=$USER" >> /tmp/dwl-script.log +echo "PATH=$PATH" >> /tmp/dwl-script.log +exec pactl set-sink-volume @DEFAULT_SINK@ +5% diff --git a/flake.lock b/flake.lock index 3309065..b203a0c 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1754514691, - "narHash": "sha256-/KgE/0DAMTOEIwubGoEcFSO3HP0peOdJEHoe7gOCO/8=", + "lastModified": 1754696903, + "narHash": "sha256-H+qoDZddFhYq8lT2E3NahF7wiDJLMYE6Pe0E6izz+cg=", "ref": "refs/heads/main", - "rev": "c35ba0afa76a7a7143bede61e4cb1caf63efc52e", - "revCount": 1329, + "rev": "3ac2d7261d747ee5cf6721a570993fdcd2300726", + "revCount": 1335, "type": "git", "url": "https://codeberg.org/FabricSoul/dwl" }, @@ -48,11 +48,11 @@ ] }, "locked": { - "lastModified": 1754420989, - "narHash": "sha256-3e4wHzNwTMg7GaeLH9A091DMaO9AfFxUjpfqbddCUeo=", + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f38f25a44023a21a504bd3fd9d4f41c4a39f55c", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", "type": "github" }, "original": { @@ -104,11 +104,11 @@ ] }, "locked": { - "lastModified": 1754503522, - "narHash": "sha256-V0iiDcYvNeMOP2FyfgC4H8Esx+JodXEl80lD4hFD4SI=", + "lastModified": 1754613544, + "narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=", "owner": "nix-community", "repo": "home-manager", - "rev": "13461dec40bf03d9196ff79d1abe48408268cc35", + "rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f", "type": "github" }, "original": { @@ -164,11 +164,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1754340878, - "narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=", + "lastModified": 1754651824, + "narHash": "sha256-aB7ft6njy9EJfuW+rdToNChfRrHNRw/yTg5cSEnG+HI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cab778239e705082fe97bb4990e0d24c50924c04", + "rev": "b069b7c1e2fe1a3a24221428558bf44128d3d5c8", "type": "github" }, "original": { @@ -204,11 +204,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1754506651, - "narHash": "sha256-LcpDSjGtTVU0S+aWJPE3/8RONQV0q8dDuanfCj7mAW0=", + "lastModified": 1754682350, + "narHash": "sha256-4Dgf0cA/ZJtj9eTzG0yNMRBcd5fll3hhWx2WdwltAP8=", "owner": "nix-community", "repo": "nixvim", - "rev": "085ef66994f94226dd3d62921e1d48bf731b663a", + "rev": "832de87d40f9a40430372552ab0b583680187cf3", "type": "github" }, "original": { diff --git a/home/fabric/default.nix b/home/fabric/default.nix index 7223a92..236a4bf 100644 --- a/home/fabric/default.nix +++ b/home/fabric/default.nix @@ -67,7 +67,7 @@ ripgrep fd lsd - pulseaudio + brightnessctl nerd-fonts.fira-mono diff --git a/hosts/common/global/default.nix b/hosts/common/global/default.nix index 7fd2c65..0920637 100644 --- a/hosts/common/global/default.nix +++ b/hosts/common/global/default.nix @@ -27,6 +27,7 @@ zsh home-manager findutils + pulseaudio ]; # Enable the OpenSSH daemon @@ -53,9 +54,10 @@ system.stateVersion = "25.05"; security.rtkit.enable = true; + services.pulseaudio.enable = false; services.pipewire = { enable = true; alsa.enable = true; - pulse.enable = true; # <-- This is the crucial part + pulse.enable = true; }; } diff --git a/hosts/common/optional/auto-cpufreq.nix b/hosts/common/optional/auto-cpufreq.nix new file mode 100644 index 0000000..32d4695 --- /dev/null +++ b/hosts/common/optional/auto-cpufreq.nix @@ -0,0 +1,32 @@ +{...}: { + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 20; + + # Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + }; + }; + # services.auto-cpufreq.enable = true; + # services.auto-cpufreq.settings = { + # battery = { + # governor = "powersave"; + # turbo = "never"; + # }; + # charger = { + # governor = "performance"; + # turbo = "auto"; + # }; + # }; +} diff --git a/hosts/solaris/default.nix b/hosts/solaris/default.nix index 5358444..b842a86 100644 --- a/hosts/solaris/default.nix +++ b/hosts/solaris/default.nix @@ -15,6 +15,7 @@ ../common/optional/bluetooth.nix ../common/optional/kmonad.nix + ../common/optional/auto-cpufreq.nix ]; # Bootloader @@ -33,7 +34,7 @@ users.users.fabric = { isNormalUser = true; description = "fabric"; - extraGroups = ["networkmanager" "wheel" "docker"]; + extraGroups = ["networkmanager" "wheel" "video"]; shell = pkgs.zsh; }; @@ -66,5 +67,8 @@ foot usbutils ntfs3g + powertop ]; + + powerManagement.powertop.enable = true; } diff --git a/hosts/solaris/hardware-configuration.nix b/hosts/solaris/hardware-configuration.nix index c237bfc..a39645b 100644 --- a/hosts/solaris/hardware-configuration.nix +++ b/hosts/solaris/hardware-configuration.nix @@ -1,32 +1,36 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["acpi_cpufreq"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/cd452eaf-7765-4bc2-b5dd-a846c47701e8"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/cd452eaf-7765-4bc2-b5dd-a846c47701e8"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6026-C63E"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6026-C63E"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/1cc175bd-0071-4d76-a8a6-ae483ca56aac"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/1cc175bd-0071-4d76-a8a6-ae483ca56aac";} + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's