Add cmus as own module with desktop file (not linked out of box)
This commit is contained in:
parent
114d72cd23
commit
c41a367660
7
home.nix
7
home.nix
|
@ -1,6 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./home/modules/programs/cmus.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "daniels";
|
||||
|
@ -56,6 +60,9 @@
|
|||
};
|
||||
tmux = import ./home/programs/tmux.nix {
|
||||
};
|
||||
|
||||
# Media
|
||||
cmus.enable = true;
|
||||
};
|
||||
|
||||
home.file = {
|
||||
|
|
39
home/modules/programs/cmus.nix
Normal file
39
home/modules/programs/cmus.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
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";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.cmus;
|
||||
defaultText = literalExpression "pkgs.cmus";
|
||||
description = "Cmus package to install.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = optional cfg.enable (hiPrio desktopItem);
|
||||
};
|
||||
};
|
||||
}
|
|
@ -84,6 +84,9 @@ List of manual needed changes for various reasons.
|
|||
|
||||
* robo3t desktop file is not linked, that's done by hand for now.
|
||||
|
||||
* I now create a desktop file for cmus (first module ;) yeay)
|
||||
But that is not linked as well, done by hand now …
|
||||
|
||||
Todos
|
||||
-----
|
||||
|
||||
|
|
Loading…
Reference in a new issue