about summary refs log tree commit diff stats
path: root/modules/by-name/ly
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-13 02:27:19 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-03-13 02:27:19 +0100
commitbffd335408cd2361e6bcc70ec019f6dee8c08c6c (patch)
tree1c0de17b8a64e7d903482c7053a45318991016af /modules/by-name/ly
parentmodules/river: Add a .desktop file for river (diff)
downloadnixos-config-bffd335408cd2361e6bcc70ec019f6dee8c08c6c.zip
modules/ly: Init
Diffstat (limited to 'modules/by-name/ly')
-rw-r--r--modules/by-name/ly/ly/module.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/by-name/ly/ly/module.nix b/modules/by-name/ly/ly/module.nix
new file mode 100644
index 00000000..6d9a2d0a
--- /dev/null
+++ b/modules/by-name/ly/ly/module.nix
@@ -0,0 +1,57 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{
+  lib,
+  config,
+  libraries,
+  ...
+}: let
+  cfg = config.soispha.services.ly;
+in {
+  options.soispha.services.ly = {
+    enable = libraries.base.options.mkEnable "ly";
+
+    batteryName = lib.mkOption {
+      type = lib.types.nullOr lib.types.str;
+      example = "BAT0";
+      default = null;
+      description = "The name of the battery, if null, will not show a batter percentage.";
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+    services.displayManager.ly = {
+      enable = true;
+      x11Support = false;
+
+      settings = {
+        battery_id = cfg.batteryName;
+
+        # Stop animations after 10 secs.
+        animation_timeout_sec = 60;
+
+        animation = "gameoflife";
+
+        # Clear the password on failure.
+        clear_password = true;
+
+        clock = "%c";
+
+        hibernate_cmd = "systemctl hibernate";
+        inactivity_cmd = "systmectl suspend-then-hibernate";
+        restart_cmd = "reboot";
+        shutdown_cmd = "shutdown $PLATFORM_SHUTDOWN_ARG now";
+        sleep_cmd = "systemctl suspend";
+
+        inactivity_delay = 30; # unit is seconds
+      };
+    };
+  };
+}