dotfiles/modules/nixos/desktop/addons/swaylock/default.nix

30 lines
744 B
Nix
Raw Normal View History

2023-03-26 15:36:56 +00:00
{
options,
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.aa.desktop.addons.swaylock;
2023-03-30 05:58:04 +00:00
user_cfg = config.home-manager.users.${config.aa.user.name};
2023-03-26 15:36:56 +00:00
in {
options.aa.desktop.addons.swaylock = with types; {
enable = mkEnableOption "swaylock";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [swaylock];
2023-03-30 05:58:04 +00:00
aa.home.extraOptions = {
programs.swaylock.settings = {
image = "${user_cfg.xdg.dataHome}/${config.aa.desktop.sway.wallpaperPath}";
};
};
2023-03-26 15:36:56 +00:00
# Workaround for https://github.com/NixOS/nixpkgs/issues/158025
# This comment specifically: https://github.com/NixOS/nixpkgs/issues/158025#issuecomment-1344766809
security.pam.services.swaylock = {};
};
}