summaryrefslogtreecommitdiffstats
path: root/nixos/modules/programs/oblogout.nix
diff options
context:
space:
mode:
authorJosé Romildo Malaquias <malaquias@gmail.com>2016-10-23 07:45:30 -0200
committerJörg Thalheim <joerg@higgsboson.tk>2016-10-23 11:45:30 +0200
commit8b7e3c3537da9ea6f254365cd582c71830f0211e (patch)
treeabbc7109e94aadc2b747df4d79274efd74a1287e /nixos/modules/programs/oblogout.nix
parentde7f231f6c0524933ed553888c212ab7cd5e713c (diff)
oblogout: init at 2009-11-18
Diffstat (limited to 'nixos/modules/programs/oblogout.nix')
-rw-r--r--nixos/modules/programs/oblogout.nix160
1 files changed, 160 insertions, 0 deletions
diff --git a/nixos/modules/programs/oblogout.nix b/nixos/modules/programs/oblogout.nix
new file mode 100644
index 000000000000..79a8ddb7ce37
--- /dev/null
+++ b/nixos/modules/programs/oblogout.nix
@@ -0,0 +1,160 @@
+# Global configuration for oblogout.
+
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let cfg = config.programs.oblogout;
+
+in
+{
+ ###### interface
+
+ options = {
+
+ programs.oblogout = {
+
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Whether to install OBLogout and create <filename>/etc/oblogout.conf</filename>.
+ See <filename>${pkgs.oblogout}/share/doc/README</filename>.
+ '';
+ };
+
+ opacity = mkOption {
+ type = types.int;
+ default = 70;
+ description = ''
+ '';
+ };
+
+ bgcolor = mkOption {
+ type = types.str;
+ default = "black";
+ description = ''
+ '';
+ };
+
+ buttontheme = mkOption {
+ type = types.str;
+ default = "simplistic";
+ description = ''
+ '';
+ };
+
+ buttons = mkOption {
+ type = types.str;
+ default = "cancel, logout, restart, shutdown, suspend, hibernate";
+ description = ''
+ '';
+ };
+
+ cancel = mkOption {
+ type = types.str;
+ default = "Escape";
+ description = ''
+ '';
+ };
+
+ shutdown = mkOption {
+ type = types.str;
+ default = "S";
+ description = ''
+ '';
+ };
+
+ restart = mkOption {
+ type = types.str;
+ default = "R";
+ description = ''
+ '';
+ };
+
+ suspend = mkOption {
+ type = types.str;
+ default = "U";
+ description = ''
+ '';
+ };
+
+ logout = mkOption {
+ type = types.str;
+ default = "L";
+ description = ''
+ '';
+ };
+
+ lock = mkOption {
+ type = types.str;
+ default = "K";
+ description = ''
+ '';
+ };
+
+ hibernate = mkOption {
+ type = types.str;
+ default = "H";
+ description = ''
+ '';
+ };
+
+ clogout = mkOption {
+ type = types.str;
+ default = "openbox --exit";
+ description = ''
+ '';
+ };
+
+ clock = mkOption {
+ type = types.str;
+ default = "";
+ description = ''
+ '';
+ };
+
+ cswitchuser = mkOption {
+ type = types.str;
+ default = "";
+ description = ''
+ '';
+ };
+ };
+ };
+
+ ###### implementation
+
+ config = mkIf cfg.enable {
+ environment.systemPackages = [ pkgs.oblogout ];
+
+ environment.etc."oblogout.conf".text = ''
+ [settings]
+ usehal = false
+
+ [looks]
+ opacity = ${toString cfg.opacity}
+ bgcolor = ${cfg.bgcolor}
+ buttontheme = ${cfg.buttontheme}
+ buttons = ${cfg.buttons}
+
+ [shortcuts]
+ cancel = ${cfg.cancel}
+ shutdown = ${cfg.shutdown}
+ restart = ${cfg.restart}
+ suspend = ${cfg.suspend}
+ logout = ${cfg.logout}
+ lock = ${cfg.lock}
+ hibernate = ${cfg.hibernate}
+
+ [commands]
+ shutdown = systemctl poweroff
+ restart = systemctl reboot
+ suspend = systemctl suspend
+ hibernate = systemctl hibernate
+ logout = ${cfg.clogout}
+ lock = ${cfg.clock}
+ switchuser = ${cfg.cswitchuser}
+ '';
+ };
+}