45 lines
1.3 KiB
Nix
45 lines
1.3 KiB
Nix
{
|
|
description = "Clip Studio Paint thumbnailer for GNOME/Nautilus";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
outputs = { self, nixpkgs }:
|
|
let
|
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
|
in
|
|
{
|
|
packages = forAllSystems (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
pythonEnv = pkgs.python3.withPackages (ps: [ ps.pillow ]);
|
|
in
|
|
{
|
|
clip-thumbnailer = pkgs.stdenvNoCC.mkDerivation {
|
|
pname = "clip-thumbnailer";
|
|
version = "0.1.2";
|
|
|
|
src = self;
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm755 ${./clip-thumbnailer.py} $out/bin/clip-thumbnailer
|
|
substituteInPlace $out/bin/clip-thumbnailer --replace \
|
|
"#!/usr/bin/env python" "#!${pythonEnv}/bin/python3"
|
|
ln -s $out/bin/clip-thumbnailer $out/bin/clip-extract-preview
|
|
install -Dm644 ${./clip.thumbnailer} $out/share/thumbnailers/clip.thumbnailer
|
|
install -Dm644 ${./clip-studio.xml} $out/share/mime/packages/clip-studio.xml
|
|
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
|
|
default = self.packages.${system}.clip-thumbnailer;
|
|
}
|
|
);
|
|
};
|
|
}
|