mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
nixos/gtklock: init (#383430)
This commit is contained in:
commit
aece4d7c84
3 changed files with 80 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
|||
|
||||
<!-- 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}
|
||||
|
||||
|
|
|
@ -331,6 +331,7 @@
|
|||
./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
Normal file
78
nixos/modules/programs/wayland/gtklock.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
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 = { };
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue