split home-manager into their own submodules

This commit is contained in:
Danilo Reyes
2026-03-16 15:49:43 -06:00
parent 14eed4f7f6
commit 28c8db6cb7
43 changed files with 1011 additions and 626 deletions

View File

@@ -0,0 +1,10 @@
{ pkgs }:
{
packages = builtins.attrValues {
inherit (pkgs)
ffmpeg
imagemagick
ffpb
;
};
}

View File

@@ -0,0 +1,62 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"shell"
"multimedia"
];
};
cfg = config.my.shell.multimedia;
multimedia = import ./common.nix { inherit pkgs; };
in
{
options.my.shell.multimedia.enable = lib.mkEnableOption "multimedia CLI tools and codecs";
config = lib.mkMerge [
{
my.shell.multimedia.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = multimedia.packages;
programs = {
yt-dlp = {
enable = true;
settings = {
embed-thumbnail = true;
embed-subs = true;
sub-langs = "all";
cookies-from-browser = "firefox+gnomekeyring:${config.home.homeDirectory}/.librewolf/${config.home.username}";
};
};
gallery-dl = {
enable = true;
settings = inputs.self.lib.importDotfile ../../../dotfiles/gallery-dl.nix;
};
${shellType}.initExtra = lib.mkAfter (
if osConfig == null then
""
else
''
if [ -r "${osConfig.sops.secrets."gallery-dl/secrets".path}" ]; then
set -a
source "${osConfig.sops.secrets."gallery-dl/secrets".path}"
set +a
fi
''
);
};
})
];
}

View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
...
}:
{
options.my.shell.multimedia = {
enable = lib.mkEnableOption "multimedia CLI tools and codecs";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.shell;
description = "Users to install multimedia shell tools for";
};
};
config = lib.mkIf (config.my.shell.multimedia.enable && config.my.secureHost) {
sops.secrets."gallery-dl/secrets" =
let
user = inputs.self.lib.getFirstUser config.my.shell.multimedia.users;
in
{
sopsFile = ../../../secrets/gallery.yaml;
owner = user;
mode = "0400";
};
};
}