Add laptop module
This commit is contained in:
parent
2888303bb0
commit
559a477e05
5 changed files with 49 additions and 13 deletions
|
@ -20,9 +20,7 @@ in rec {
|
||||||
hostname = "morty";
|
hostname = "morty";
|
||||||
username = "ephase";
|
username = "ephase";
|
||||||
hostConfig = {
|
hostConfig = {
|
||||||
gaming = true;
|
|
||||||
desktop = true;
|
desktop = true;
|
||||||
laptop = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -37,9 +35,7 @@ in rec {
|
||||||
hostname = "mrmeeseeks";
|
hostname = "mrmeeseeks";
|
||||||
username = "ephase";
|
username = "ephase";
|
||||||
hostConfig = {
|
hostConfig = {
|
||||||
gaming = true;
|
|
||||||
desktop = true;
|
desktop = true;
|
||||||
laptop = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -54,9 +50,7 @@ in rec {
|
||||||
hostname = "luci";
|
hostname = "luci";
|
||||||
username = "ephase";
|
username = "ephase";
|
||||||
hostConfig = {
|
hostConfig = {
|
||||||
gaming = false;
|
|
||||||
desktop = true;
|
desktop = true;
|
||||||
laptop = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
config.modules.gaming.steam.enable = true;
|
config.modules.gaming.steam.enable = true;
|
||||||
|
config.modules.hardware.laptop.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,6 @@ _:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./gaming/steam
|
./gaming/steam
|
||||||
|
./hardware/laptop
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
47
modules/nixos/hardware/laptop/default.nix
Normal file
47
modules/nixos/hardware/laptop/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.laptop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.hardware.laptop = {
|
||||||
|
enable = mkEnableOption "Install Laptop utils";
|
||||||
|
|
||||||
|
governor_battery = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "powersave";
|
||||||
|
};
|
||||||
|
turbo_battery = mkOption {
|
||||||
|
type = types.enum ["always" "never" "auto"];
|
||||||
|
default = "never";
|
||||||
|
};
|
||||||
|
governor_ac = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "schedutil";
|
||||||
|
};
|
||||||
|
turbo_ac = mkOption {
|
||||||
|
type = types.enum ["always" "never" "auto"];
|
||||||
|
default = "never";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Wifi is installed on laptops
|
||||||
|
networking.wireless.iwd.enable = true;
|
||||||
|
|
||||||
|
# And cpufreq
|
||||||
|
services.auto-cpufreq = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
battery = {
|
||||||
|
governor = cfg.governor_battery;
|
||||||
|
turbo = cfg.turbo_battery;
|
||||||
|
};
|
||||||
|
charger = {
|
||||||
|
governor = cfg.governor_ac;
|
||||||
|
turbo = cfg.turbo_ac;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -22,13 +22,6 @@
|
||||||
./includes/desktop/xdg-portal.nix
|
./includes/desktop/xdg-portal.nix
|
||||||
]
|
]
|
||||||
else []
|
else []
|
||||||
) ++ (
|
|
||||||
if hostConfig.laptop then
|
|
||||||
[
|
|
||||||
./includes/hardware/iwd.nix
|
|
||||||
./includes/hardware/cpufreq.nix
|
|
||||||
]
|
|
||||||
else []
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue