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";
sd = ''cd "$(dirname "$HOME/$(env --chdir ~ fzf)")"'';
mkdir = "mkdir --parent";
cp = "cp -i";
mv = "mv -i";
cp = "cp -vi";
mv = "mv -vi";
rm = "rm -v";
};
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";

View file

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

View file

@ -41,7 +41,6 @@
loupe
seahorse
gimp
vlc
pavucontrol
thunderbird
keepassxc
@ -49,13 +48,12 @@
protonmail-bridge-gui
varia
signal-desktop
calibre
tagger
soundconverter
foliate
kid3
prismlauncher
kid3
soundconverter
# proprietary
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}/options"
"${self}/options/pulseview.nix"
"${self}/options/media.nix"
{ networking.hostName = hostname; }
] ++ extraModules;
specialArgs = {