diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index cae4d1a..f23782d 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -19,6 +19,7 @@ gpg.enable = true; kitty.enable = true; rofi.enable = true; + swaylock.enable = true; }; tools = { diff --git a/modules/home/programs/swaylock/default.nix b/modules/home/programs/swaylock/default.nix new file mode 100644 index 0000000..f9e99b7 --- /dev/null +++ b/modules/home/programs/swaylock/default.nix @@ -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}"; + }; + }; + }; +} diff --git a/modules/nixos/desktop/addons/swaylock/default.nix b/modules/nixos/desktop/addons/swaylock/default.nix deleted file mode 100644 index c19db47..0000000 --- a/modules/nixos/desktop/addons/swaylock/default.nix +++ /dev/null @@ -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 = {}; - }; -} diff --git a/modules/nixos/desktop/sway/default.nix b/modules/nixos/desktop/sway/default.nix index c70995f..0f566d6 100644 --- a/modules/nixos/desktop/sway/default.nix +++ b/modules/nixos/desktop/sway/default.nix @@ -40,7 +40,6 @@ in { gammastep.enable = true; playerctl.enable = true; swayidle.enable = true; - swaylock.enable = true; # TODO # light diff --git a/modules/nixos/suites/desktop/default.nix b/modules/nixos/suites/desktop/default.nix index 4a11ec2..4dd7559 100644 --- a/modules/nixos/suites/desktop/default.nix +++ b/modules/nixos/suites/desktop/default.nix @@ -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 = {}; }; }