nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.36k stars 1.7k forks source link

bug: Kitty's .desktop file opens in gedit on Linux Mint w/Cinnamon #4979

Open x10an14 opened 5 months ago

x10an14 commented 5 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

When writing the following HM nix code (running on a Linux Mint w/Cinnamon) kitty shows up in the start-menu (as expected). However, when clicking on the kitty start-menu item (whose icon is not found btw), the Cinnamon code editor (gedit?) opens up with the bash script generated by nixpkgs's wrapProgram, instead of opening Kitty.

{config, lib, ...}: {
  targets.genericLinux.enable = true;
  programs.kitty.enable = true;
  xdg.desktopEntries.kitty = let
    kitty = config.programs.kitty.package;
  in {
    name = "Kitty";
    type = "Application";
    genericName = "Terminal Emulator";
    comment = "Fast, feature-rich, GPU based terminal";
    icon = "kitty";
    exec = lib.getExe kitty;
    categories = ["X-Desktop" "X-System"];
    settings = {
      TryExec = lib.getExe kitty;
      X-Version = lib.getVersion kitty;
    };
  };
}

Maintainer CC

@ncfavier @rycee @Scrumplex

System information

x10an14@laptop ❯ : nix run nixpkgs#nix-info -- -m
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.0-92-generic, Linux Mint, 21.3 (Virginia), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.16.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
x10an14 commented 5 months ago

Just confirmed it, if I

  1. copy the resulting kitty.desktop file out of /nix/store
  2. chmod +x it
  3. place the copy (or a symlink pointing to the chmodded copy)

it works. If I remove the executable bit chmod -x, it stops working.

Can this be fixed somehow?

x10an14 commented 5 months ago

Seems there's been some prior history here in the Nix/NixOS/nixpkgs eco-system: https://github.com/NixOS/nixpkgs/issues/152059

nixos-discourse commented 3 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/kde-desktop-files-on-ubuntu/7724/6

stale[bot] commented 2 weeks ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.