feat: add module for media consumption packages

This commit is contained in:
Nydragon 2024-09-21 20:37:33 +02:00
parent 190e3dfa73
commit e0c1e40f27
Signed by: nydragon
SSH key fingerprint: SHA256:iQnIC12spf4QjWSbarmkD2No1cLMlu6TWoV7K6cYF5g
5 changed files with 50 additions and 7 deletions

View file

@ -10,8 +10,9 @@
cat = "bat"; cat = "bat";
sd = ''cd "$(dirname "$HOME/$(env --chdir ~ fzf)")"''; sd = ''cd "$(dirname "$HOME/$(env --chdir ~ fzf)")"'';
mkdir = "mkdir --parent"; mkdir = "mkdir --parent";
cp = "cp -i"; cp = "cp -vi";
mv = "mv -i"; mv = "mv -vi";
rm = "rm -v";
}; };
functions = { functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv"; gitignore = "curl -sL https://www.gitignore.io/api/$argv";

View file

@ -86,5 +86,7 @@
pop-icon-theme pop-icon-theme
]; ];
media.enableAll = true;
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -41,7 +41,6 @@
loupe loupe
seahorse seahorse
gimp gimp
vlc
pavucontrol pavucontrol
thunderbird thunderbird
keepassxc keepassxc
@ -49,13 +48,12 @@
protonmail-bridge-gui protonmail-bridge-gui
varia varia
signal-desktop signal-desktop
calibre
tagger tagger
soundconverter
foliate
kid3
prismlauncher prismlauncher
kid3
soundconverter
# proprietary # proprietary
obsidian obsidian

41
options/media.nix Normal file
View file

@ -0,0 +1,41 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.media;
mkMedia = defPackages: {
enable = lib.mkOption { default = cfg.enableAll; };
packages = lib.mkOption { default = defPackages; };
};
in
{
options.media = {
enableAll = lib.mkEnableOption "";
audio = mkMedia [
pkgs.feishin
pkgs.lollypop
];
video = mkMedia [
pkgs.vlc
];
ebook = mkMedia [
pkgs.calibre
pkgs.foliate
];
};
config = {
environment.systemPackages = lib.flatten (
lib.map (opt: opt.packages) (
lib.filter (opt: opt.enable) [
cfg.audio
cfg.video
cfg.ebook
]
)
);
};
}

View file

@ -27,6 +27,7 @@
"${self}/hosts/${hostname}/configuration.nix" "${self}/hosts/${hostname}/configuration.nix"
"${self}/options" "${self}/options"
"${self}/options/pulseview.nix" "${self}/options/pulseview.nix"
"${self}/options/media.nix"
{ networking.hostName = hostname; } { networking.hostName = hostname; }
] ++ extraModules; ] ++ extraModules;
specialArgs = { specialArgs = {