power-button: module init
This commit is contained in:
parent
eb4e36de4f
commit
9aa9ce6dfe
2 changed files with 21 additions and 0 deletions
|
@ -14,4 +14,5 @@ in
|
|||
snowhawk.audio.enable = lib.mkDefault true;
|
||||
snowhawk.env.enable = lib.mkDefault true;
|
||||
snowhawk.sops.enable = lib.mkDefault true;
|
||||
snowhawk.power-button.enable = lib.mkDefault true;
|
||||
}
|
||||
|
|
20
modules/power-button.nix
Normal file
20
modules/power-button.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
|
||||
cfg = config.snowhawk.power-button;
|
||||
in
|
||||
{
|
||||
options.snowhawk.power-button = {
|
||||
enable = mkEnableOption "power-button nixos module";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.logind = {
|
||||
powerKey = "suspend";
|
||||
powerKeyLongPress = "poweroff";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue