Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kreyren: Attempt to Fix Flameshot #115

Draft
wants to merge 1 commit into
base: central
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 16 additions & 4 deletions src/nixos/users/kreyren/home/modules/apps/flameshot/flameshot.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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
}
5 changes: 2 additions & 3 deletions src/nixos/users/kreyren/home/modules/system/dconf/dconf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "<Control>Print";
};

# Background
Expand Down