common: profiles: migrate laptop

This commit is contained in:
Bruno BELANYI 2024-01-03 17:05:16 +00:00
parent 9f82f2a7e8
commit 53594d2fb4
4 changed files with 28 additions and 24 deletions

View file

@ -5,5 +5,6 @@
./bluetooth
./devices
./gtk
./laptop
];
}

View file

@ -0,0 +1,27 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.laptop;
in
{
options.my.profiles.laptop = with lib; {
enable = mkEnableOption "laptop profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
# Enable battery notifications
my.home.power-alert.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
# Enable touchpad support
services.xserver.libinput.enable = true;
# Enable TLP power management
my.services.tlp.enable = true;
# Enable upower power management
my.hardware.upower.enable = true;
})
]);
}

View file

@ -2,7 +2,6 @@
{ ... }:
{
imports = [
./laptop
./wm
./x
];

View file

@ -1,23 +0,0 @@
{ config, lib, ... }:
let
cfg = config.my.profiles.laptop;
in
{
options.my.profiles.laptop = with lib; {
enable = mkEnableOption "laptop profile";
};
config = lib.mkIf cfg.enable {
# Enable touchpad support
services.xserver.libinput.enable = true;
# Enable TLP power management
my.services.tlp.enable = true;
# Enable upower power management
my.hardware.upower.enable = true;
# Enable battery notifications
my.home.power-alert.enable = true;
};
}