split home-manager into their own submodules
This commit is contained in:
10
modules/shell/multimedia/common.nix
Normal file
10
modules/shell/multimedia/common.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs }:
|
||||
{
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
ffmpeg
|
||||
imagemagick
|
||||
ffpb
|
||||
;
|
||||
};
|
||||
}
|
||||
62
modules/shell/multimedia/home.nix
Normal file
62
modules/shell/multimedia/home.nix
Normal 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
|
||||
''
|
||||
);
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
27
modules/shell/multimedia/nixos.nix
Normal file
27
modules/shell/multimedia/nixos.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user