Updated multiple configuration files to replace the user option type with a unified `usersOptionType`, enhancing consistency in user management across applications and services. This change simplifies the user configuration process and improves maintainability.
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
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";
|
|
users = lib.mkOption {
|
|
type = inputs.self.lib.usersOptionType lib;
|
|
default = config.my.toggleUsers.apps;
|
|
description = "Users to install multimedia packages for";
|
|
};
|
|
videoEditing = {
|
|
enable = lib.mkEnableOption "video editing applications";
|
|
users = lib.mkOption {
|
|
type = inputs.self.lib.usersOptionType lib;
|
|
default = config.my.toggleUsers.apps;
|
|
description = "Users to install video editing packages for";
|
|
};
|
|
};
|
|
};
|
|
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)
|
|
];
|
|
};
|
|
}
|