Document desktop entries for now

Do not create desktop item in file system, instead use proper xdg
configuration option. That way we do not need to hard code location of
file and can use a proper set with validation from module.
This commit is contained in:
Daniel Siepmann 2022-02-07 08:03:43 +01:00
parent 77f3038cde
commit 30015279ba
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 17 additions and 19 deletions

View file

@ -4,21 +4,6 @@ with lib;
let
cfg = config.programs.cmus;
desktopItem = pkgs.writeTextDir "share/applications/cmus.desktop"
(generators.toINI { } {
"Desktop Entry" = {
Type = "Application";
Exec = "${cfg.package}/bin/cmus";
Terminal = true;
Name = "C* Music Player";
Comment = "A small, fast and powerful console music player";
GenericName = "Music player";
Categories = "ConsoleOnly;Audio;Player";
Keywords = "cmus;audio;player";
};
});
in {
options.programs.cmus = {
enable = mkEnableOption "Cmus";
@ -32,7 +17,20 @@ in {
config = mkIf cfg.enable {
home = {
packages = optional cfg.enable (hiPrio desktopItem);
packages = optional cfg.enable cfg.package;
};
xdg.desktopEntries.cmus = {
type = "Application";
exec = "${cfg.package}/bin/cmus";
terminal = true;
name = "C* Music Player";
comment = "A small, fast and powerful console music player";
genericName = "Music player";
categories = [
"ConsoleOnly"
"Audio"
"Player"
];
};
};
}

View file

@ -82,10 +82,10 @@ Manual changes
List of manual needed changes for various reasons.
* robo3t desktop file is not linked, that's done by hand for now.
* .desktop files seem not to be supported by home-manager yet.
They need to manually be linked, e.g.::
* I now create a desktop file for cmus (first module ;) yeay)
But that is not linked as well, done by hand now …
cd ~/.local/share/applications && ln -s ~/.nix-profile/share/applications/* .
Todos
-----