fufexan/nix-gaming

Cannot install osu-stable and osu-lazer at the same time

Opened this issue ยท 11 comments

I'm not sure what's going on :(

(installed via home-manager)

{config, pkgs, inputs, ...}: {
  home.packages = [
    pkgs.osu-lazer-bin
    (inputs.nix-gaming.packages.${pkgs.stdenv.hostPlatform.system}.osu-stable.override {
      location = "${config.xdg.dataHome}/osu-stable";
    })
  ];
}

nixos-rebuild --flake . switch

error: builder for '/nix/store/qh4c8byaicwdfdx656k7kf227gjjl8cj-home-manager-path.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/d1c12asygbw7c2ccxrqgyd329vcazl54-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8x5a9a0vc79g0wnzjhbhn5hxrbpnvvmp-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6f4g0d78ldryr0cwv3j1gs8i9nld765w-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1h4hzk2jz625kxmgpsshkpa1hmqq4qmw-nixos-system-Aristotle-24.05.20240102.bd645e8.drv' failed to build

nix log /nix/store/8w7yz2w0fbcnxih200gi04b1bywqx5bd-home-manager-path.drv

warning: different permissions in `/nix/store/qmilf5gjzf09f65xc1nj32s9jdf514xq-osu-stable/share/icons/hicolor/16x16/apps/osu!.png' and `/nix/store/x1w93kxfizzxwjf8xfk6l26i0kh1li2y-osu-lazer-bin-2023.1229.0/share/icons/hicolor/16x16/apps/osu!.png': 0444 <-> 0555 at /nix/store/w1qzwvqwv127nblp4hjydp8c9hhmb7zk-builder.pl line 103.
error: collision between `/nix/store/x1w93kxfizzxwjf8xfk6l26i0kh1li2y-osu-lazer-bin-2023.1229.0/share/icons/hicolor/16x16/apps/osu!.png' and `/nix/store/qmilf5gjzf09f65xc1nj32s9jdf514xq-osu-stable/share/icons/hicolor/16x16/apps/osu!.png'

I think both icons should come from osu-mime. @dixslyf do you know more about this?

Hmm, seems like using osu-lazer-bin from nix-gaming works...

Also BTW, quick question: what is the difference between this repo's osu-lazer-bin and nixpkgs's osu-lazer-bin?

I think at the moment the only difference is that ours is updated daily.

I think at the moment the only difference is that ours is updated daily.

Hmmmm, I think we can do it through overlays and I think it might be a cleaner solution.

Here is how nixpkgs-wayland did it. https://github.com/nix-community/nixpkgs-wayland/blob/master/flake.nix

(I'm not familiar with Nix and I don't really know what's going on, you might want to check additional resources, and sorry for my broken english)

You sent an entire flake file, what exactly am I looking at? and why would overlays be a cleaner solution?

You sent an entire flake file, what exactly am I looking at? and why would overlays be a cleaner solution?

Oops, I meant to send the repo, accidentally copied the wrong link

why would overlays be a cleaner solution?

Well, since the only thing changing here is the version, why copy the whole file? I think you can use the package from nixpkgs and only change the url and hash

Oh, I think you misunderstood. osu-lazer-bin has been packaged here long before it existed in Nixpkgs. We just never removed it. Also no point in removing it now, since it works fine.

If I understand it correctly, the collision happens between Nixpkgs' osu-lazer-bin and our osu-stable, right?

Nixpkgs' osu-lazer-bin uses the icon from the AppImage (src) whereas we generate the icons using SVG files from the osu-web repo (in our osu-mime package, which is shared by our osu-lazer-bin and osu-stable). In both Nixpkgs' osu-lazer-bin and our osu-stable, the icons are placed under share/icons/hicolor/16x16/apps/osu!.png (and the respective locations for other resolutions of course). Since the icons are different (permissions and contents), we get the collision error.


Also BTW, quick question: what is the difference between this repo's osu-lazer-bin and nixpkgs's osu-lazer-bin?

I think at the moment the only difference is that ours is updated daily.

Another difference is that the osu! packages here handle MIME types. AFAICT, the ones in Nixpkgs don't.

In the long-term, it might be worthwhile to just override Nixpkgs' package definition, though it might not be trivial since the Nixpkgs' package is conditional and depends on architecture and OS.


For a fix, we could rename the icons here so that the collision doesn't happen, but that seems more like a workaround.

Another possibility is to use the same icon from the AppImage so that the collisions don't happen (technically, they'll still happen, but will be ignored as the file contents are the same). Assuming the icon in the AppImage is the same as this, we wouldn't have to go through the hassle of extracting it from the AppImage. This approach feels flimsy though โ€” if the icon in the Nixpkgs package changes, we'll get the collision again.

I'm sure there are better ways to resolve this, but I can't think of one right now. Ideas?

Oops, I completely forgot about this issue...

For a fix, we could rename the icons here so that the collision doesn't happen, but that seems more like a workaround.

IMO renaming the icons is fine, since eventually osu!stable will be replaced by osu!lazer.

And after a recent update, osu!stable's icon and osu!lazer's icon is different.


In the long-term, it might be worthwhile to just override Nixpkgs' package definition, though it might not be trivial since the Nixpkgs' package is conditional and depends on architecture and OS.

I just made a overrideAttrs version of osu-stable-bin and somehow made the update script working.
It's not perfect, but it works for me.
I don't really know anything about bash, so I probably need someone that knows bash to help me a little bit.

EDIT:
I'm stupid and I'm completely insane,
first of all, how did I didn't realize this PR didn't even work,
second of all, there a update script in nixpkgs... its right there and I completely didn't thought about it.

I changed the icon's name in the PR, didn't test it yet because it is late for me and I'm tired.