nixos/modules/power-button.nix

21 lines
341 B
Nix
Raw Permalink Normal View History

2024-09-17 10:54:43 +00:00
{ config, lib, ... }:
2024-09-17 10:54:00 +00:00
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";
};
};
}