{ description = "Sewing Tools"; inputs = { nixpkgs.url = "github:nixos/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self , nixpkgs , flake-utils }: (flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in { packages.valentina-061 = pkgs.libsForQt512.callPackage pkgs/valentina-0.6.1.nix { }; packages.valentina = self.packages.${system}.valentina-061; packages.seamly2d = pkgs.libsForQt5.callPackage pkgs/seamly2d-2022-06-13.nix { }; # nix build packages.default = self.packages.${system}.valentina; # TODO: Legacy attribute, drop soon defaultPackage = self.packages.${system}.default; devShells.default = pkgs.mkShell { buildInputs = [ # building seamly2d and valentina pkgs.qt5.full pkgs.qtcreator pkgs.libGL pkgs.qt5.qtsvg pkgs.poppler_utils pkgs.qt5.qtxmlpatterns pkgs.qt5.qt3d pkgs.qt5.qmake # poster pkgs.imagemagick pkgs.ghostscript # A4 is 2480 x 3508 Pixel # A4 with 100px space on top bottom left and right is : 2280 x 3308 Pixel (pkgs.writers.writeBashBin "posterize" '' ${pkgs.imagemagick}/bin/convert -density 300 -depth 8 -quality 85 input.pdf input.png ${pkgs.imagemagick}/bin/convert input.png -crop 2280x3308 +repage output_a4_%02d.png for file in output_a4_* do ${pkgs.imagemagick}/bin/convert \ $file \ -gravity center \ -background gray \ -extent 2480x3508 \ final_$file done ${pkgs.imagemagick}/bin/convert final_*.png -quality 100 output.pdf rm -rf *.png '') ]; }; })); }