Trying to make a libreoffice overlay to skip checks. Because I want to complicate my life

Hello! I am using a nixos system with a few interesting flags:

  nixpkgs = {
    config = {
      allowUnfree = true;
      localSystem = {
        system = "x86_64-linux";
        gcc.arch = "znver3";
        gcc.tune = "znver3";
      };
    };
    hostPlatform = {
      config = "x86_64-unknown-linux-gnu";
      system = "x86_64-linux";
      gcc.arch = "znver3";
      gcc.tune = "znver3";
    };
  };

this basically makes me compile my packages to my architecture, wich is fine and exactly what I wanted (trying to run into some errors so I can learn a bit more)

and the most common problem are some packages checks… so much so that I needed a few overlays and some packages overrides:

{ inputs,  ... }:
{
  nixpkgs.overlays = [
    inputs.neorg-overlay.overlays.default
    (final: prev:{
      libreoffice-qt6-fresh = prev.libreoffice-qt6-fresh.overrideAttrs (oldAttrs: {
        doCheck = false;
      });
      pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
        (pyfinal: pyprev: {
          numpy = pyprev.numpy.overridePythonAttrs (oldAttrs: {
            postPatch = ''
              rm numpy/core/tests/test_cython.py
              rm numpy/core/tests/test_umath_accuracy.py
              rm numpy/core/tests/test_*.py

              patchShebangs numpy/_build_utils/*.py

              substituteInPlace numpy/meson.build \
                --replace 'py.full_path()' "'python'"

              substituteInPlace pyproject.toml \
                --replace-fail "meson-python>=0.15.0,<0.16.0" "meson-python"
            '';
            doCheck = false;
            doInstallCheck = false;
            dontCheck = true;
            disabledTests = [
              "test_math"
              "test_umath_accuracy"
              "test_validate_transcendentals"
            ];
          });
        })
      ];
    })
  ];
  nixpkgs.config.packageOverrides = pkgs: {
    haskellPackages = pkgs.haskellPackages.override {
      overrides = hsSelf: hsSuper: {
        crypton = pkgs.haskell.lib.overrideCabal hsSuper.crypton (oa: {
          doCheck = false;
        });
        tls = pkgs.haskell.lib.overrideCabal hsSuper.tls (oa: {
          doCheck = false;
        });
        crypton-x509-validation = pkgs.haskell.lib.overrideCabal hsSuper.crypton-x509-validation (oa: {
          doCheck = false;
        });

        cryptonite = pkgs.haskell.lib.overrideCabal hsSuper.cryptonite (oa: {
          doCheck = false;
        });
        x509-validation = pkgs.haskell.lib.overrideCabal hsSuper.x509-validation (oa: {
          doCheck = false;
        });
      };
    };
  };
}

now… the python and haskell stuff, came from another person here on discourse with similar issues to mine, I added a few lines to fix some errors I got, mainly the meson-python version and the haskel crypton and tls packages overrides… but following those breadcrumbs…

i have read the nixpkgs reference manual section on overrides and the overlays sections, already tryed putting an override and a overlay, to no avail… I think it is because I want the package libreoffice-qt6-fresh and there are some shenanigans with the libreoffice package and multiple kinds, but I wasn’t able to make either an override or an overlay…

can anyone point my mistakes? the overlay is supposed to be for libreoffice or libreoffice-qt6-fresh? why is it that when i try to check the source, it shows me only the libreoffice package? I saw those conditions for fresh, qt or still, but whick one am I supposed to make the overlay pkg? is it supposed to be an overlay or just a nixpkgs.config.packageOverrides ?

I have tryed with qt6-fresh and libreoffice packages btw…

I think you are overriding the parameters of the wrapper (a small script to set up stuff like dictionaries that should not require rebuild). You probably want to first build libreoffice.unwrapped with overrides (and then look in all-packages.nix to see how to re-wrap it, or override the wrapped version passing the unwrapped version without the checks)

so in all-packages.nix, there is this:


  libreoffice-qt6-fresh = lowPrio (callPackage ../applications/office/libreoffice/wrapper.nix {
    unwrapped = kdePackages.callPackage ../applications/office/libreoffice {
      kdeIntegration = true;
      variant = "fresh";
    };
  });

and this:

libreoffice-qt6-fresh-unwrapped = libreoffice-qt6-fresh.unwrapped;

meaning I need to override libreoffice-qt6-fresh-unwrapped for it to work?

trying that… I’ll get back to you soon.

I haven’t done overlays, but the first question is to build the unwrapped version with the override, for that override on libreoffice-qt6-fresh-unwrapped will work. Re-wrapping is the cheap part in any case.

I wasn’t able to do it… some time in the future, ill try again, for now I’ll just use onlyoffice in the browser…

I was able to override unwrapped libreoffice like this: libreoffice: add korean · honnip/dotfiles@3bbdaf3 · GitHub

interesting, will take a look