Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord: add patch for discord. #56954

Closed
wants to merge 1 commit into from
Closed

Conversation

moredhel
Copy link
Member

@moredhel moredhel commented Mar 6, 2019

Motivation for this change

Crostini compatibility

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions (Crostini)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Crostini compatibility
exec = "Discord";
icon = pname;
exec = "@out@/bin/Discord";
icon = "@out@/share/pixmaps/discord.png";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the icon with an absolute path is going to break custom icons in themes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah damn, it currently only works like this in ChromeOs.

I believe the Slack package we use the default pixmap.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/slack/default.nix#L91

I'm not sure if this is just something that was missed though.
If this is the case, then I may start a downstream library with the desktopfiles patched to work in Crostini.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, icon is not supposed to be a full path but many places do that anyway. You should be able to add the /share directory to XDG_DATA_DIRS. Here's someone who looks like they got it to work:

https://www.reddit.com/r/Crostini/comments/9lazhn/environment_variables_for_launcher_applications/e769u4y/

As an aside, it would be great to have someone document using Nixpkgs with Crostini on the wiki: https://nixos.wiki

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewbauer I agree, I think it's a good idea to put some docs up regarding running Nix in Crostini. I have put up a very quick page (something that can be worked on and refined as things progress).

I think I need to spend some more time figuring out where Crostini is going with image recognition as there are a few limitations I have come across in this process.

  • only supports .png
  • can only pick up images in the pixmaps directory (ie. vlc/xterm not supported)
  • links to executables should be absolute (although this now works if using the above reddit advice).

I'm not sure what the correct course of action here is, I understand the want for custom themes, so don't want to rule that out, I will play around more with it, and see if I can create a better user-story for using Nix within Crostini (it's already pretty decent tbh).

Link: https://nixos.wiki/wiki/Installing_on_Crostini

@moredhel
Copy link
Member Author

I feel like the wiki page described above is fine. I'll approach rycee/home-manager and add a module for crostini I think.

There weren't many things that required changes, but I'll add them into the module too.

@moredhel moredhel closed this Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants