swaylock: Add module (#3003)
This commit is contained in:
parent
64ab7d6e8d
commit
70824bb5c7
9 changed files with 79 additions and 0 deletions
32
modules/programs/swaylock.nix
Normal file
32
modules/programs/swaylock.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let cfg = config.programs.swaylock;
|
||||
in {
|
||||
meta.maintainers = [ lib.hm.maintainers.rcerc ];
|
||||
|
||||
options.programs.swaylock.settings = lib.mkOption {
|
||||
type = with lib.types; attrsOf (oneOf [ bool float int str ]);
|
||||
default = { };
|
||||
description = ''
|
||||
Default arguments to <command>swaylock</command>. An empty set
|
||||
disables configuration generation.
|
||||
'';
|
||||
example = {
|
||||
color = "808080";
|
||||
font-size = 24;
|
||||
indicator-idle-visible = false;
|
||||
indicator-radius = 100;
|
||||
line-color = "ffffff";
|
||||
show-failed-attempts = true;
|
||||
};
|
||||
};
|
||||
|
||||
config.xdg.configFile."swaylock/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = lib.concatStrings (lib.mapAttrsToList (n: v:
|
||||
if v == false then
|
||||
""
|
||||
else
|
||||
(if v == true then n else n + "=" + builtins.toString v) + "\n")
|
||||
cfg.settings);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue