thumbnailing
This commit is contained in:
parent
34f1d4593f
commit
15ba326af3
2 changed files with 34 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ in {
|
|||
{
|
||||
modules.desktop.fonts.enable = true;
|
||||
modules.desktop.fonts.baseFonts = true;
|
||||
modules.desktop.thumbnailers.enable = true;
|
||||
|
||||
# enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
|
|
|||
33
modules/desktop/thumbnailers.nix
Normal file
33
modules/desktop/thumbnailers.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.thumbnailers;
|
||||
in {
|
||||
options.modules.desktop.thumbnailers = {
|
||||
enable = mkEnableOption "Enable a collection of thumbnailers";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.home.packages = let
|
||||
mkThumbnailer = { name, mime, exec }: pkgs.writeTextFile {
|
||||
name = "${name}-thumbnailer";
|
||||
destination = "/share/thumbnailers/${name}.thumbnailer";
|
||||
text = ''
|
||||
[Thumbnailer Entry]
|
||||
Exec=${exec}
|
||||
MimeType=${mime}
|
||||
'';
|
||||
};
|
||||
in [
|
||||
# videos
|
||||
pkgs.ffmpegthumbnailer
|
||||
# krita
|
||||
(mkThumbnailer {
|
||||
name = "kra";
|
||||
mime = "application/x-krita";
|
||||
exec = "sh -c \"${pkgs.unzip}/bin/unzip -p %i preview.png > %o\"";
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue