Downgrade CopyQ app doesn't work

Hello Nix wizards
I would like to downgrade CopyQ from the unstable channel that my NixOS is on to the version of CopyQ from the stable channel.

https://search.nixos.org/packages?channel=22.11&from=0&size=50&sort=relevance&type=packages&query=copyq

So far I did put this in to my configuration.nix:

nixpkgs.overlays = [
  (self: super: {
    myCopyQ = super.stdenv.mkDerivation {
      pname = "CopyQ";
      version = "6.3.2";
      src = super.fetchFromGitHub {
        owner = "hluk";
        repo = "CopyQ";
        rev = "v6.3.2";
        hash = "sha256-Ge/TD9Llq4YTAqaL9LBEsgNI9qrf2jLDt7q2ZTI9rmE=";
      };
      nativeBuildInputs = [ super.cmake super.extra-cmake-modules ];
      buildInputs = [
        super.qtbase
        super.qtscript
        super.libXfixes
        super.libXtst
        super.qtx11extras
        super.knotifications
        super.qtwayland
        super.wayland
      ];
      postPatch = ''
        substituteInPlace shared/com.github.hluk.copyq.desktop.in \
          --replace copyq "$out/bin/copyq"
      '';
      meta = with super.lib; {
        homepage = "https://hluk.github.io/CopyQ";
        description = "Clipboard Manager with Advanced Features";
        license = licenses.gpl3Only;
        maintainers = with maintainers; [ artturin ];
        platforms = platforms.linux;
      };
    };
  })
];

But it doesn’t seem to change the version of CopyQ.

Would be lovely if someone could help me out, as I never messed with overlays before …

You shouldn’t need an overlay for that. You can simply “pin Nixpkgs” to the stable channel and install the package from there.

1 Like

cool, thank you, I will look in to that!

Added the stable channel alongside the unstable: https://nixos.wiki/wiki/Nix_channels

Added this to my nixpkgs.config:

#+BEGIN_SRC nix
nixpkgs.config = {
  # Allow proprietary packages
  allowUnfree = true;

  # Create an alias for the stable channel, make sure to add the said channel
  packageOverrides = pkgs: {
    stable = import <nixos-22.11> {                 # pass the nixpkgs config to the stable alias
      config = config.nixpkgs.config;
    };
  };
};

then added the “stable” alias to environment.systemPackages:

  environment.systemPackages = with pkgs; [
    # User Applications
    firefox
    thunderbird
    keepassxc
    stable.copyq
    alacritty
    libreoffice-fresh

 ];

now when I $copyq --version in the therminal it says:

CopyQ Clipboard Manager 6.3.2

and no longer

CopyQ Clipboard Manager 7.0.0 as it did on the unstable channel

Thank you emmanuelrose for the hint!

Found the solution here https://nixos.wiki/wiki/Cheatsheet → Customizing Packages

1 Like