nix/modules/home-manager/desktop/sway/includes/swaylock.nix
Yorick Barbanneau c1ee8f9d50
fix(sway): add possibility to not install swaylock package
Useful when using home-manager on third-party distribution. Swaylock
from nixpkgs become unable to unlock session because PAM
incompatibilities.
2025-08-27 22:25:49 +02:00

37 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config = mkIf config.modules.desktop.sway.enable {
programs.swaylock = {
package = if cfg.swaylock.useNullPackage then null else pkgs.swaylock;
enable = true;
settings = {
image = if cfg.wallpapers.lockscreen != "" then "${cfg.wallpapers.lockscreen}" else false;
scaling = "center";
color = "000000";
indicator-radius = 70;
indicator-y-position = 150;
font = "Fira Code Nerd Font Mono";
font-size = "14";
inside-color = "00000000";
ring-color = "323232";
ring-ver-color = "1cd180";
inside-ver-color = "1cd180cc";
ring-wrong-color = "f268b3";
inside-wrong-color = "f268b3cc";
key-hl-color = "1cd180";
caps-lock-key-hl-color = "1cd180";
caps-lock-bs-hl-color = "f268b3";
bs-hl-color = "f268b3ff";
separator-color = "00000000";
ignore-empty-password = true;
show-failed-attempts = true;
daemonize = true;
line-uses-inside = true;
};
};
};
}