profiles/desktop: Migrate from configuration
This commit is contained in:
50
profiles/desktop/power.nix
Normal file
50
profiles/desktop/power.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
config = mkIf config.profiles.clerie.desktop.enable {
|
||||
|
||||
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
|
||||
services.logind = {
|
||||
lidSwitch = "suspend-then-hibernate";
|
||||
};
|
||||
systemd.sleep.extraConfig = ''
|
||||
HibernateDelaySec=30m
|
||||
'';
|
||||
|
||||
services.upower = {
|
||||
percentageLow = 20;
|
||||
percentageCritical = 10;
|
||||
percentageAction = 8;
|
||||
};
|
||||
|
||||
programs.dconf.profiles = {
|
||||
user.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/settings-daemon/plugins/power" = {
|
||||
power-button-action = "hibernate";
|
||||
power-saver-profile-on-low-battery = false;
|
||||
sleep-inactive-ac-type = "nothing";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
gdm.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/settings-daemon/plugins/power" = {
|
||||
power-button-action = "hibernate";
|
||||
power-saver-profile-on-low-battery = false;
|
||||
sleep-inactive-ac-type = "nothing";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user