diff --git a/modules/desktop/addons/swaylock/default.nix b/modules/desktop/addons/swaylock/default.nix index 76b2691..c19db47 100644 --- a/modules/desktop/addons/swaylock/default.nix +++ b/modules/desktop/addons/swaylock/default.nix @@ -7,6 +7,7 @@ }: 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"; @@ -15,6 +16,12 @@ in { 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/desktop/sway/default.nix b/modules/desktop/sway/default.nix index 26a4f3e..818a952 100644 --- a/modules/desktop/sway/default.nix +++ b/modules/desktop/sway/default.nix @@ -108,7 +108,6 @@ in { # TODO: Should this live at the system configuration level? output = { # TODO: Set up wallpaper - # "*".bg = "${wallpaper} fill"; "*".bg = "${user_cfg.xdg.dataHome}/${cfg.wallpaperPath} fill"; "eDP-1".scale = "1"; @@ -175,8 +174,6 @@ in { "${modifier}+c" = "kill"; "${modifier}+p" = "exec ${menu}"; "${modifier}+z" = "reload"; - # TODO: Reintroduce this. Failing because config.home.homeDirectory is not set - # "${modifier}+x" = "exec swaylock -i ${config.home.homeDirectory}/dotfiles/users/alejandro/sway/wallpaper.png"; "${modifier}+x" = "exec swaylock"; # Volume control