This commit is contained in:
2026-03-13 10:24:07 +00:00
parent 6c33f7f53e
commit 8229f20975
3 changed files with 71 additions and 6 deletions

View File

@@ -12,6 +12,20 @@
modules.tuigreet modules.tuigreet
<modules/common/laptop-power-management> <modules/common/laptop-power-management>
modules.fonts modules.fonts
(modules.tdp {
batt = {
cpu = {
long-term = 10;
short-term = 15;
};
};
ac = {
cpu = {
long-term = 120;
short-term = 120;
};
};
})
]; ];
nixos = nixos =
{ pkgs, config, ... }: { pkgs, config, ... }:
@@ -20,7 +34,7 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest # boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest
boot.kernelPackages = pkgs.linuxPackages_zen; # Unpinned the linux version for now.. as i am not using hibernate that often boot.kernelPackages = pkgs.linuxPackages_latest; # Unpinned the linux version for now.. as i am not using hibernate that often
networking.hostName = "doloro-nixos-laptop"; # Define your hostname. networking.hostName = "doloro-nixos-laptop"; # Define your hostname.
security.rtkit.enable = true; security.rtkit.enable = true;

View File

@@ -0,0 +1,51 @@
{ modules, den, ... }:
{
modules.tdp = settings: {
nixos =
{ pkgs, ... }:
let
batt-tdp = pkgs.writeShellScript "batt-cpu-tdp" ''
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.batt.cpu.long-term * 1000000)
}
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.batt.cpu.short-term * 1000000)
}
'';
ac-tdp = pkgs.writeShellScript "ac-cpu-tdp" ''
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.ac.cpu.long-term * 1000000)
}
${pkgs.powercap}/bin/powercap-set intel-rapl -z 0 -c 0 -l ${
toString (settings.ac.cpu.short-term * 1000000)
}
'';
in
{
systemd.services.tdp-on-batt = {
enable = true;
before = [ "battery.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${batt-tdp}";
RemainAfterExit = true;
};
wantedBy = [ "battery.target" ];
partOf = [ "battery.target" ];
};
systemd.services.tdp-on-ac = {
enable = true;
before = [ "ac.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${ac-tdp}";
RemainAfterExit = true;
};
wantedBy = [ "ac.target" ];
partOf = [ "ac.target" ];
};
};
};
}

View File

@@ -26,7 +26,7 @@ Item {
name: "FOCUSED" name: "FOCUSED"
PropertyChanges { PropertyChanges {
target: content target: content
width: 10 implicitWidth: 10
scale: 1 scale: 1
} }
}, },
@@ -34,7 +34,7 @@ Item {
name: "EXISTS" name: "EXISTS"
PropertyChanges { PropertyChanges {
target: content target: content
width: 10 implicitWidth: 10
scale: 0.85 scale: 0.85
} }
}, },
@@ -42,15 +42,15 @@ Item {
name: "NOT" name: "NOT"
PropertyChanges { PropertyChanges {
target: content target: content
width: 10 implicitWidth: 10
scale: 0.75 scale: 0.75
} }
} }
] ]
height: 15 height: 15
Rectangle { Rectangle {
width: parent.width implicitWidth: parent.width
height: parent.height implicitHeight: parent.height
radius: 2.5 radius: 2.5
color: { color: {
if (HyprlandHelpers.getHyprlandWorkspaceById(index + 1) != null) { if (HyprlandHelpers.getHyprlandWorkspaceById(index + 1) != null) {