My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/infra/libkookie/home-manager/modules/programs/swaylock.nix

32 lines
883 B

{ 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);
};
}