My Nix Configuration
1{ 2 pkgs, 3 config, 4 lib, 5 ... 6}: 7let 8 cfg = config.py.programs.wlogout; 9 pkg = config.programs.wlogout.package; 10in 11{ 12 options.py.programs.wlogout.enable = lib.mkEnableOption "wlogout"; 13 config.programs.wlogout = lib.mkIf cfg.enable { 14 enable = true; 15 style = import ./style.nix { inherit pkg; }; 16 layout = [ 17 { 18 label = "hibernate"; 19 action = "systemctl hibernate"; 20 text = "Hibernate"; 21 keybind = "h"; 22 } 23 { 24 label = "reboot"; 25 action = "systemctl reboot"; 26 text = "Reboot"; 27 keybind = "r"; 28 } 29 { 30 label = "suspend"; 31 action = "systemctl suspend"; 32 text = "Suspend"; 33 keybind = "u"; 34 } 35 { 36 label = "suspend-then-hibernate"; 37 action = "systemctl suspend-then-hibernate"; 38 text = "Supend then Hibernate"; 39 keybind = "p"; 40 } 41 { 42 label = "lock"; 43 action = "${pkgs.swaylock-effects}/bin/swaylock"; 44 text = "Lock"; 45 keybind = "l"; 46 } 47 { 48 label = "shutdown"; 49 action = "systemctl poweroff"; 50 text = "Shutdown"; 51 keybind = "s"; 52 } 53 ]; 54 }; 55}