Daniel Siepmann
30015279ba
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.
37 lines
741 B
Nix
37 lines
741 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.cmus;
|
|
in {
|
|
options.programs.cmus = {
|
|
enable = mkEnableOption "Cmus";
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.cmus;
|
|
description = "Cmus package to install.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home = {
|
|
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"
|
|
];
|
|
};
|
|
};
|
|
}
|