Install cider with AppImage

Hello there, im trying to install cider-2; its on nixpkgs but when i was building i got this message:

Unfortunately, we cannot download file cider-linux-x64.AppImage automatically.
Please go to https://cidercollective.itch.io/cider to download it yourself, and add it to the Nix store
using either
  nix-store --add-fixed sha256 cider-linux-x64.AppImage
or
  nix-prefetch-url --type sha256 file:///path/to/cider-linux-x64.AppImage

I went and bought cider-2 and added to nix store using nix-prefetch-url, now how should i proceed?

I tried rebuilding and the same error appears.

i tried remaking the package but im not sure how to proceed, this is what i mustered:

{
  lib,
  config,
  pkgs,
  ...
}:
let
  cfg = config.modules.cider;
in
{
  options.modules.cider = with lib; {
    enable = mkEnableOption ''enable cider module'';
    pkg = mkOption {
      type = types.enum [
        "cider"
        "cider-2"
      ];
      default = "cider";
      description = ''
        Choose the cider package to use, either the paid (2) or the free version
      '';
    };
  };

  config =
    let
      cider-2 = import (
        {
          pkgs ? import <nixpkgs> { },
          lib ? pkgs.lib,
          appimageTools ? pkgs.appimageTools,
          makeWrapper ? pkgs.makeWrapper,
        }:

        appimageTools.wrapType2 rec {
          pname = "cider-2";
          version = "2.6.1";

          src = {
            name = "cider-linux-x64.AppImage";
            url = "https://cidercollective.itch.io/cider";
            sha256 = "18by764idifnjs5h2cydv4qjm7w95lzdlxjkscp289w3jdpbmd05";
          };

          nativeBuildInputs = [ makeWrapper ];

          extraInstallCommands =
            let
              contents = appimageTools.extract {
                inherit version src;
                # HACK: this looks for a ${pname}.desktop, where `cider-2.desktop` doesn't exist
                pname = "Cider";
              };
            in
            ''
              wrapProgram $out/bin/${pname} \
                 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
                 --add-flags "--no-sandbox --disable-gpu-sandbox" # Cider 2 does not start up properly without these from my preliminary testing

              install -m 444 -D ${contents}/Cider.desktop $out/share/applications/${pname}.desktop
              substituteInPlace $out/share/applications/${pname}.desktop \
                --replace-warn 'Exec=Cider' 'Exec=${pname}'
              install -Dm444 ${contents}/usr/share/icons/hicolor/256x256/cider.png \
                             $out/share/icons/hicolor/256x256/apps/cider.png
            '';

          meta = with lib; {
            description = "Powerful music player that allows you listen to your favorite tracks with style";
            homepage = "https://cider.sh";
            license = licenses.unfree;
            mainProgram = "cider-2";
            maintainers = with maintainers; [ itsvic-dev ];
            platforms = platforms.linux;
          };
        }
      );
    in
    lib.mkIf cfg.enable {
      environment.systemPackages =
        if cfg.pkg == "cider" then
          [ pkgs.cider ]
        else if cfg.pkg == "cider-2" then
          [ cider-2 ]
        else
          [ ];
    };
}

its not working btw

I got it to work

{
  lib,
  config,
  pkgs,
  ...
}:
let
  cfg = config.modules.cider;
in
{
  options.modules.cider = with lib; {
    enable = mkEnableOption ''enable cider module'';
    pkg = mkOption {
      type = types.enum [
        "cider"
        "cider-2"
      ];
      default = "cider";
      description = ''
        Choose the cider package to use, either the paid (2) or the free version
      '';
    };
  };

  config =
    let
      cider-2 = pkgs.appimageTools.wrapType2 rec {
        pname = "cider-2";
        version = "2.6.1";

        src = pkgs.fetchurl {
          name = "cider-linux-x64.AppImage";
          url = "https://cidercollective.itch.io/cider";
          sha256 = "18by764idifnjs5h2cydv4qjm7w95lzdlxjkscp289w3jdpbmd05";
        };

        nativeBuildInputs = [ pkgs.makeWrapper ];

        extraInstallCommands =
          let
            contents = pkgs.appimageTools.extract {
              inherit version src;
              # HACK: this looks for a ${pname}.desktop, where `cider-2.desktop` doesn't exist
              pname = "Cider";
            };
          in
          ''
            wrapProgram $out/bin/${pname} \
               --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
               --add-flags "--no-sandbox --disable-gpu-sandbox" # Cider 2 does not start up properly without these from my preliminary testing

            install -m 444 -D ${contents}/Cider.desktop $out/share/applications/${pname}.desktop
            substituteInPlace $out/share/applications/${pname}.desktop \
              --replace-warn 'Exec=Cider' 'Exec=${pname}'
            install -Dm444 ${contents}/usr/share/icons/hicolor/256x256/cider-linux----arch-------version---.png \
                           $out/share/icons/hicolor/256x256/apps/cider.png
          '';

        meta = with lib; {
          description = "Powerful music player that allows you listen to your favorite tracks with style";
          homepage = "https://cider.sh";
          license = licenses.unfree;
          mainProgram = "cider-2";
          maintainers = with maintainers; [ itsvic-dev ];
          platforms = platforms.linux;
        };
      };
    in
    lib.mkIf cfg.enable {
      environment.systemPackages =
        if cfg.pkg == "cider" then
          [ pkgs.cider ]
        else if cfg.pkg == "cider-2" then
          [ cider-2 ]
        else
          [ ];
    };
}