common: profiles: migrate laptop
This commit is contained in:
parent
a68c26c6ef
commit
b1be9f20d9
4 changed files with 28 additions and 24 deletions
|
|
@ -5,5 +5,6 @@
|
||||||
./bluetooth
|
./bluetooth
|
||||||
./devices
|
./devices
|
||||||
./gtk
|
./gtk
|
||||||
|
./laptop
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
27
modules/common/profiles/laptop/default.nix
Normal file
27
modules/common/profiles/laptop/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, lib, _class, ... }:
|
||||||
|
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 (_class == "homeManager") {
|
||||||
|
# Enable battery notifications
|
||||||
|
my.home.power-alert.enable = true;
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.optionalAttrs (_class == "nixos") {
|
||||||
|
# Enable touchpad support
|
||||||
|
services.libinput.enable = true;
|
||||||
|
|
||||||
|
# Enable TLP power management
|
||||||
|
my.services.tlp.enable = true;
|
||||||
|
|
||||||
|
# Enable upower power management
|
||||||
|
my.hardware.upower.enable = true;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./laptop
|
|
||||||
./wm
|
./wm
|
||||||
./x
|
./x
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -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.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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue