Add custom font management and multimedia video editing support

Enhanced the configuration by introducing a custom font management system, allowing for the installation of additional fonts. Updated multimedia settings to include video editing applications, enabling users to manage multimedia and video editing packages more effectively. Removed the deprecated fonts module to streamline the configuration.
This commit is contained in:
Danilo Reyes
2026-01-16 13:28:18 -06:00
parent cbe7c25812
commit cceb4da041
6 changed files with 74 additions and 70 deletions

View File

@@ -1,44 +0,0 @@
{
config,
lib,
pkgs,
inputs,
...
}:
let
customFonts = pkgs.stdenvNoCC.mkDerivation {
name = "custom-fonts";
src = inputs.fonts;
installPhase = ''
mkdir -p $out/share/fonts
find $src -type f \( \
-name "*.ttf" -o \
-name "*.otf" -o \
-name "*.woff" -o \
-name "*.woff2" \
\) -exec cp {} $out/share/fonts/ \;
'';
};
in
{
options.my.apps.fonts.enable = lib.mkEnableOption "additional fonts and typography";
config = lib.mkIf config.my.apps.fonts.enable {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "corefonts" ];
fonts.packages = builtins.attrValues {
inherit customFonts;
inherit (pkgs)
symbola
comic-neue
cascadia-code
corefonts
;
inherit (pkgs.nerd-fonts)
caskaydia-cove
open-dyslexic
comic-shanns-mono
iosevka
agave
;
};
};
}

View File

@@ -5,6 +5,30 @@
pkgs,
...
}:
let
cfg = config.my.apps.multimedia;
attrValuesIf = cond: attrs: if cond then builtins.attrValues attrs else [ ];
multimediaPackages = attrValuesIf cfg.enable {
inherit (pkgs)
curtail # image compressor
easyeffects # equalizer
identity # compare images or videos
mousai # poor man shazam
shortwave # listen to world radio
tagger # tag music files
;
};
videoEditingPackages = attrValuesIf cfg.videoEditing.enable {
inherit (pkgs)
davinci-resolve
shotcut
pitivi
;
inherit (pkgs.kdePackages)
kdenlive
;
};
in
{
options.my.apps.multimedia = {
enable = lib.mkEnableOption "multimedia applications and media players";
@@ -13,21 +37,19 @@
default = config.my.toggleUsers.apps;
description = "Users to install multimedia packages for";
};
videoEditing = {
enable = lib.mkEnableOption "video editing applications";
users = lib.mkOption {
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
default = config.my.toggleUsers.apps;
description = "Users to install video editing packages for";
};
};
};
config = lib.mkIf config.my.apps.multimedia.enable {
users.users =
let
packages = builtins.attrValues {
inherit (pkgs)
curtail # image compressor
easyeffects # equalizer
identity # compare images or videos
mousai # poor man shazam
shortwave # listen to world radio
tagger # tag music files
;
};
in
inputs.self.lib.mkUserPackages lib config.my.apps.multimedia.users packages;
config = lib.mkIf (cfg.enable || cfg.videoEditing.enable) {
users.users = lib.mkMerge [
(inputs.self.lib.mkUserPackages lib cfg.users multimediaPackages)
(inputs.self.lib.mkUserPackages lib cfg.videoEditing.users videoEditingPackages)
];
};
}