clean modules & add power modes
All checks were successful
nix flake show / show-flake (push) Successful in 35s
All checks were successful
nix flake show / show-flake (push) Successful in 35s
This commit is contained in:
parent
40546f121f
commit
c5ef752a66
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ...}:
|
||||
{ config, lib, ...}:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
@ -12,6 +12,7 @@ in
|
||||
config = mkIf config.smayzy.desktop.enable {
|
||||
smayzy = {
|
||||
base = true;
|
||||
power = "desktop";
|
||||
steam.enable = true;
|
||||
prism.enable = true;
|
||||
firefox.enable = true;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
@ -12,6 +12,7 @@ in
|
||||
config = mkIf config.smayzy.laptop.enable {
|
||||
smayzy = {
|
||||
base = true;
|
||||
power = "laptop";
|
||||
grub-on-lap.enable = true;
|
||||
prism.enable = true;
|
||||
firefox.enable = true;
|
||||
@ -43,6 +44,5 @@ in
|
||||
fritzing.enable = true;
|
||||
aegisub.enable = true;
|
||||
};
|
||||
services.logind.lidSwitch = "ignore";
|
||||
};
|
||||
}
|
||||
|
||||
@ -3,5 +3,6 @@
|
||||
imports = [
|
||||
./nvidia.nix
|
||||
./grub.nix
|
||||
./power.nix
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
in
|
||||
|
||||
50
modules/nix/hardware/power.nix
Normal file
50
modules/nix/hardware/power.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types mkMerge;
|
||||
validOptions = [ "desktop" "laptop" ];
|
||||
in
|
||||
{
|
||||
options.smayzy.power = mkOption {
|
||||
type = types.enum validOptions;
|
||||
default = "desktop";
|
||||
description = "chose power mode between desktop and laptop";
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf (config.smayzy.power == "desktop") {
|
||||
services.power-profiles-daemon.enable = false;
|
||||
services.auto-cpufreq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf (config.smayzy.power == "laptop") {
|
||||
services.logind.lidSwitch = "suspend";
|
||||
services.power-profiles-daemon.enable = false;
|
||||
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 = 100;
|
||||
|
||||
STOP_CHARGE_THRESH_BAT0 = 95;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
];
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user