diff --git a/src/nixos/users/kreyren/home/machines/sinnenfreude/home-configuration.nix b/src/nixos/users/kreyren/home/machines/sinnenfreude/home-configuration.nix index 69475d87..f03befce 100644 --- a/src/nixos/users/kreyren/home/machines/sinnenfreude/home-configuration.nix +++ b/src/nixos/users/kreyren/home/machines/sinnenfreude/home-configuration.nix @@ -22,6 +22,7 @@ programs.nix-index.enable = true; services.gpg-agent.enable = true; + services.flameshot.enable = true; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ # FIXME(Krey): Using vscodium, no idea why this needs 'vscode' set diff --git a/src/nixos/users/kreyren/home/modules/apps/flameshot/flameshot.nix b/src/nixos/users/kreyren/home/modules/apps/flameshot/flameshot.nix index 650b0c37..160666f1 100644 --- a/src/nixos/users/kreyren/home/modules/apps/flameshot/flameshot.nix +++ b/src/nixos/users/kreyren/home/modules/apps/flameshot/flameshot.nix @@ -1,6 +1,8 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: let + inherit (lib) mkIf; + # Wayland fix https://github.com/NixOS/nixpkgs/issues/292700#issuecomment-1974953531 flameshotGrim = pkgs.flameshot.overrideAttrs (oldAttrs: { src = pkgs.fetchFromGitHub { @@ -15,8 +17,18 @@ let ]; buildInputs = oldAttrs.buildInputs ++ [ pkgs.libsForQt5.kguiaddons ]; }); -in { - services.flameshot = { - package = flameshotGrim; +in mkIf config.services.flameshot.enable { + services.flameshot.package = flameshotGrim; # Set the patched flameshot as our flameshot + + # Workaround for Unit tray.target required by flameshot (https://github.com/nix-community/home-manager/issues/2064) + xsession.enable = true; + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Wants = [ "graphical-session-pre.target" ]; + }; }; + + # FIXME-QA(Krey): This should be a wrapper + home.packages = [ pkgs.grim ]; # Add the dependency } diff --git a/src/nixos/users/kreyren/home/modules/system/dconf/dconf.nix b/src/nixos/users/kreyren/home/modules/system/dconf/dconf.nix index 3c86ab38..8be36791 100644 --- a/src/nixos/users/kreyren/home/modules/system/dconf/dconf.nix +++ b/src/nixos/users/kreyren/home/modules/system/dconf/dconf.nix @@ -3,7 +3,6 @@ let inherit (lib) mkForce; inherit (lib.hm.gvariant) mkTuple; - flameshot-gui = pkgs.writeShellScriptBin "flameshot-gui" "${pkgs.flameshot}/bin/flameshot gui"; in { # Use `$ dconf dump /` to get these # dconf2nix, can be used to make this process easier -- https://github.com/gvolpe/dconf2nix @@ -121,8 +120,8 @@ in { ## Flameshot GUI "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4" = { name = "Flameshot GUI"; - command = "${flameshot-gui}/bin/flameshot-gui"; - binding = "Print"; + command = "flameshot gui"; + binding = "Print"; }; # Background