diff options
| -rw-r--r-- | hosts/by-name/apzu/configuration.nix | 1 | ||||
| -rw-r--r-- | modules/by-name/ly/ly/module.nix | 57 |
2 files changed, 58 insertions, 0 deletions
diff --git a/hosts/by-name/apzu/configuration.nix b/hosts/by-name/apzu/configuration.nix index a5b10e9f..479d7e50 100644 --- a/hosts/by-name/apzu/configuration.nix +++ b/hosts/by-name/apzu/configuration.nix @@ -43,6 +43,7 @@ services = { unison.foreign.address = "tiamat.fritz.box"; upower.enable = true; + ly.batteryName = "BAT0"; }; nixpkgs = { 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 + }; + }; + }; +} |
