home: Add waifu2x-photo

This commit is contained in:
Simon Bruder 2021-01-01 13:55:47 +01:00
parent fa8323bddc
commit dc3a5f5d2e
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -1,5 +1,27 @@
{ config, lib, pkgs, ... }:
let
waifu2x-photo-models = pkgs.stdenv.mkDerivation {
name = "waifu2x-photo-models";
src = pkgs.fetchFromGitHub {
owner = "nagadomi";
repo = "waifu2x";
rev = "v0.13.2";
sha256 = "1dqyp1gvw53gs3a1mfylxhj2kghwb3gx1ybsynzbanq84vx6grs2";
};
dontBuild = true;
installPhase = ''
cp -r $src/models/vgg_7/photo $out
'';
};
# waifu2x-converter-cpp wrapper for real life images
waifu2x-photo = pkgs.writeShellScriptBin "waifu2x-photo" ''
${pkgs.unstable.waifu2x-converter-cpp}/bin/waifu2x-converter-cpp \
--model-dir ${waifu2x-photo-models} \
$@
'';
in
{
home.packages = with pkgs; [
# top like tools
@ -111,6 +133,7 @@
mediainfo # show information about media files
mkvtoolnix-cli # matroska (de-)muxing
unstable.waifu2x-converter-cpp # super-resolution for anime-style images
waifu2x-photo # waifu2x-converter-cpp for real life photos
youtube-dl # universal video downloader
# audio