Converted swaylock to a home module

This commit is contained in:
alejandro-angulo 2024-08-02 20:49:25 -07:00
parent 6cf34c66c8
commit dae4076857
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
5 changed files with 30 additions and 30 deletions

View file

@ -19,6 +19,7 @@
gpg.enable = true;
kitty.enable = true;
rofi.enable = true;
swaylock.enable = true;
};
tools = {

View file

@ -0,0 +1,24 @@
{
config,
lib,
namespace,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.programs.swaylock;
in {
options.${namespace}.programs.swaylock = {
enable = mkEnableOption "swaylock";
};
config = mkIf cfg.enable {
programs.swaylock = {
enable = true;
settings = {
# TODO: Set wallpaper
# image = "${config.xdg.dataHome}/${config.${namespace}.desktop.sway.wallpaperPath}";
};
};
};
}

View file

@ -1,29 +0,0 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.aa.desktop.addons.swaylock;
user_cfg = config.home-manager.users.${config.aa.user.name};
in {
options.aa.desktop.addons.swaylock = with types; {
enable = mkEnableOption "swaylock";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [swaylock];
aa.home.extraOptions = {
programs.swaylock.settings = {
image = "${user_cfg.xdg.dataHome}/${config.aa.desktop.sway.wallpaperPath}";
};
};
# 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 = {};
};
}

View file

@ -40,7 +40,6 @@ in {
gammastep.enable = true;
playerctl.enable = true;
swayidle.enable = true;
swaylock.enable = true;
# TODO
# light

View file

@ -17,5 +17,10 @@ in {
sway.enable = true;
};
};
# The following fixes an issue with using swaylcock as a home module
# 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 = {};
};
}