by 96bcaa76-0f27-45e7-9aa3-65c535e53a05

Nixos Always Latest V2

Another day another prusa-slicer update. This is a more complex example of overriding a nixos package. at both the attribute, and override level. Showing you can run anything on nix. Including old old old curl so that prusa-slicer can use it properly.

  mog_prusa-slicer = (pkgs.prusa-slicer.overrideAttrs (old: rec {
  version = "2.9.0-beta1";
  src = pkgs.fetchFromGitHub {
    owner = "prusa3d";
    repo = "PrusaSlicer";
#    hash = lib.fakeHash;
    hash = "sha256-2QbSeOHBQDrfsNOq1SjhmhyMSRyhPTMew7MNC1P1cRk=";
    rev = "version_${version}";
  };

  buildInputs = old.buildInputs ++ [ pkgs.webkitgtk_4_0 ];

  patches = [
    (pkgs.writeText "boost-filesystem.patch" ''
       --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
       +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
       @@ -120,7 +120,7 @@ BackgroundSlicingProcess::~BackgroundSlicingProcess()
               std::string prefix = boost::filesystem::path(m_temp_output_path).filename().string();
               prefix = prefix.substr(0, prefix.find('_'));
            for (const auto& entry : boost::filesystem::directory_iterator(temp_dir)) {
       -        if (entry.is_regular_file()) {
       +        if (boost::filesystem::is_regular_file(entry.path())) {
                    const std::string filename = entry.path().filename().string();
                    if (boost::starts_with(filename, prefix) && boost::ends_with(filename, ".gcode"))
                        boost::filesystem::remove(entry);
    '')
  ];
})).override{
    boost = pkgs.boost183;
    curl = pkgs.curl.overrideAttrs {
      version = "7.88.1";
      src = pkgs.fetchurl {
        url = "https://curl.se/download/curl-7.88.1.tar.xz";
        hash = "sha256-Ha4xsqfB/iad6ZwMMbtIg0aqs0WbX/ypCdaTgkmuQV8=";
      };
      patches = [];
    };
    opencascade-occt_7_6 = pkgs.opencascade-occt_7_6.overrideAttrs {
      version = "7.6.1";
      src = pkgs.fetchurl {
        name = "occt-V7_6_1.tar.gz";
        url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_6_1;sf=tgz";
        hash = "sha256-PZVrLSbR7nWsArIeg47YtHMdnpFAHK5K80VbVrAA9W0=";
      };
    };
};