nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
Jan Tojnar 5efd65b2d9
inkscape-with-extension: make enabling all extensions easier
Previously, we needed something like

	inkscape-with-extensions.override { inkscapeExtensions = builtins.filter lib.isDerivation (builtins.attrValues inkscape-extensions); }

Now, we can just do

	inkscape-with-extensions.override { inkscapeExtensions = null; }
2021-06-25 12:41:11 +02:00

28 lines
673 B
Nix

{ lib
, inkscape
, symlinkJoin
, makeWrapper
, inkscapeExtensions ? [ ]
, inkscape-extensions
}:
let
allExtensions = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues inkscape-extensions);
selectedExtensions = if inkscapeExtensions == null then allExtensions else inkscapeExtensions;
in
symlinkJoin {
name = "inkscape-with-extensions-${lib.getVersion inkscape}";
paths = [ inkscape ] ++ selectedExtensions;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
rm -f $out/bin/inkscape
makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
'';
inherit (inkscape) meta;
}