nixos/gtklock: init

Fugi 65a759f7 949fb7f3

Changed files
+80 -1
nixos
doc
manual
release-notes
modules
programs
wayland
+1 -1
nixos/doc/manual/release-notes/rl-2511.section.md
···
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
-
- Create the first release note entry in this section!
+
- [gtklock](https://github.com/jovanlanik/gtklock), a GTK-based lockscreen for Wayland. Available as [programs.gtklock](#opt-programs.gtklock.enable).
## Backward Incompatibilities {#sec-release-25.11-incompatibilities}
+1
nixos/modules/module-list.nix
···
./programs/vivid.nix
./programs/wavemon.nix
./programs/wayland/cardboard.nix
+
./programs/wayland/gtklock.nix
./programs/wayland/hyprland.nix
./programs/wayland/hyprlock.nix
./programs/wayland/labwc.nix
+78
nixos/modules/programs/wayland/gtklock.nix
···
+
{
+
config,
+
lib,
+
pkgs,
+
...
+
}:
+
let
+
cfg = config.programs.gtklock;
+
configFormat = pkgs.formats.ini {
+
listToValue = builtins.concatStringsSep ";";
+
};
+
+
inherit (lib)
+
types
+
mkOption
+
mkEnableOption
+
mkPackageOption
+
;
+
in
+
{
+
options.programs.gtklock = {
+
enable = mkEnableOption "gtklock, a GTK-based lockscreen for Wayland";
+
+
package = mkPackageOption pkgs "gtklock" { };
+
+
config = mkOption {
+
type = configFormat.type;
+
example = lib.literalExpression ''
+
{
+
main = {
+
idle-hide = true;
+
idle-timeout = 10;
+
};
+
}'';
+
description = ''
+
Configuration for gtklock.
+
See [`gtklock(1)`](https://github.com/jovanlanik/gtklock/blob/master/man/gtklock.1.scd) man page for details.
+
'';
+
};
+
+
style = mkOption {
+
type = with types; nullOr str;
+
default = null;
+
description = ''
+
CSS Stylesheet for gtklock.
+
See [gtklock's wiki](https://github.com/jovanlanik/gtklock/wiki#Styling) for details.
+
'';
+
};
+
+
modules = mkOption {
+
type = with types; listOf package;
+
default = [ ];
+
example = lib.literalExpression ''
+
with pkgs; [
+
gtklock-playerctl-module
+
gtklock-powerbar-module
+
gtklock-userinfo-module
+
]'';
+
description = "gtklock modules to load.";
+
};
+
};
+
+
config = lib.mkIf cfg.enable {
+
programs.gtklock.config.main = {
+
style = lib.mkIf (cfg.style != null) "${pkgs.writeText "style.css" cfg.style}";
+
+
modules = lib.mkIf (cfg.modules != [ ]) (
+
map (pkg: "${pkg}/lib/gtklock/${lib.removePrefix "gtklock-" pkg.pname}.so") cfg.modules
+
);
+
};
+
+
environment.etc."xdg/gtklock/config.ini".source = configFormat.generate "config.ini" cfg.config;
+
+
environment.systemPackages = [ cfg.package ];
+
+
security.pam.services.gtklock = { };
+
};
+
}