diff --git a/.config/nix/lib/mkCommon.nix b/.config/nix/lib/mkCommon.nix index 2821289..8b4b60d 100644 --- a/.config/nix/lib/mkCommon.nix +++ b/.config/nix/lib/mkCommon.nix @@ -8,7 +8,7 @@ let py.dnspython ])); }; - custom.inkscape = if pkgs.stdenv.isDarwin then pkgs.brewCasks.inkscape else (pkgs.inkscape.override { python3 = custom.python; }); + custom.inkscape = if pkgs.stdenv.isDarwin then pkgs.inkscape-bin else (pkgs.inkscape.override { python3 = custom.python; }); in { inherit custom; packages = [ diff --git a/.config/nix/overlays/darwin/inkscape.nix b/.config/nix/overlays/darwin/inkscape.nix new file mode 100644 index 0000000..4fbdd88 --- /dev/null +++ b/.config/nix/overlays/darwin/inkscape.nix @@ -0,0 +1,45 @@ +# REF: https://github.com/bandithedoge/nixpkgs-firefox-darwin/blob/ceaca2359e5371ccef3f92a36baf7c438b354afb/overlay.nix +final: prev: + +let + inkscapePackage = version: + final.stdenv.mkDerivation rec { + pname = "Inkscape"; + inherit version; + + buildInputs = [ final.pkgs.undmg ]; + sourceRoot = "."; + phases = [ "unpackPhase" "installPhase" ]; + installPhase = '' + runHook preInstall + + mkdir -p $out/Applications + cp -r Inkscape*.app "$out/Applications/" + + runHook postInstall + ''; + + src = final.fetchurl { + name = "Inkscape-${version}.dmg"; + url = "https://media.inkscape.org/dl/resources/file/Inkscape-${version}_${if final.stdenv.isAarch64 then "arm64" else "x86_64"}.dmg"; + sha256 = if final.stdenv.isAarch64 then "c2d89809ad8d85021e7784e72e28aee2231b0b8675ec3ede3e6fb9f1ffedb4b3" else "e3f968e131e5c3577ee21809da487eafe2a9b42370e2bf408e5811b6f965912e"; + }; + + meta = with final.lib; { + description = "Vector graphics editor"; + homepage = "https://www.inkscape.org"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.jtojnar ]; + platforms = platforms.all; + mainProgram = "inkscape"; + longDescription = '' + Inkscape is a feature-rich vector graphics editor that edits + files in the W3C SVG (Scalable Vector Graphics) file format. + + If you want to import .eps files install ps2edit. + ''; + }; + }; +in { + inkscape-bin = inkscapePackage "1.4.028868"; +} diff --git a/.config/nix/systems/darwin/default.nix b/.config/nix/systems/darwin/default.nix index 417f3db..15f4c3a 100644 --- a/.config/nix/systems/darwin/default.nix +++ b/.config/nix/systems/darwin/default.nix @@ -21,6 +21,7 @@ in extraOverlays = [ inputs.firefox-darwin.overlay inputs.brew-nix.overlays.default + (import ../../overlays/darwin/inkscape.nix) ]; } ) system pkgs pkgs-unstable; @@ -45,6 +46,7 @@ in extraOverlays = [ inputs.firefox-darwin.overlay inputs.brew-nix.overlays.default + (import ../../overlays/darwin/inkscape.nix) ]; } ) system pkgs pkgs-unstable;