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

Package bumblebee-status for nixos #821

Closed
Deep-Six opened this issue Sep 28, 2021 · 30 comments
Closed

Package bumblebee-status for nixos #821

Deep-Six opened this issue Sep 28, 2021 · 30 comments

Comments

@Deep-Six
Copy link

Feature Request

It'd be great to have bumblebee-status within the NixOS ecosystem, I'm relatively new to NixOS so am unfortunately familiar enough to support this.

@tobi-wan-kenobi
Copy link
Owner

Yes, that would be great! Unfortunately, I have never used NixOS, so I have no idea how to package for it.

@Deep-Six
Copy link
Author

https://www.youtube.com/watch?v=jXd-hkP4xnU This is something I've tried to grok, but it's a bit much for me at this time. Maybe it'd help you?

@tobi-wan-kenobi
Copy link
Owner

Nice video 👍

I've also started reading https://nixos.wiki/wiki/Packaging/Tutorial and https://nixos.org/manual/nixpkgs/stable/#chap-quick-start, but frankly, it seems this goes way beyond the time I am - unfortunately - able to dedicate to this right now.

I have tagged the issue with "help wanted", so maybe somebody with more NixOS knowledge can jump in.

Thanks a lot for raising the issue!

@Deep-Six
Copy link
Author

Deep-Six commented Jul 3, 2022

@tobi-wan-kenobi I have managed to learn enough to stumble through the packaging process, but in the process I had to patch the themes path, is there a reason why you're not using the $XDG_DATA_DIRS convention for the themes?

@tobi-wan-kenobi
Copy link
Owner

The only reason I can bring forth is missing knowledge on my part. Does make a lot of sense to use that convention.

I will add that, thanks for raising it! (might take a while though, due to Covid messing up my schedule quite a bit roght now)

@Deep-Six
Copy link
Author

Deep-Six commented Jul 3, 2022

Ironically it was COVID (recovery) that gave me the free time to finally dig into this. Stay safe!

@Tonus1
Copy link

Tonus1 commented Jul 3, 2022

The only reason I can bring forth is missing knowledge on my part. Does make a lot of sense to use that convention.

I will add that, thanks for raising it! (might take a while though, due to Covid messing up my schedule quite a bit roght now)

Recover soon and well !

tobi-wan-kenobi added a commit that referenced this issue Jul 3, 2022
read theme information from
$XDG_DATA_DIRS/bumblebee-status/themes

see #821
@tobi-wan-kenobi
Copy link
Owner

@Deep-Six Does this change work for you? I tested it locally and it seems to do what is intended, but I am not 100% sure the subdirectories (bumblebee-status/themes/ are what you need.

@Deep-Six
Copy link
Author

Deep-Six commented Jul 3, 2022

@tobi-wan-kenobi I can work with it, I need to also patch up the modules path, is there an equivalent to PATHS for modules?

@tobi-wan-kenobi
Copy link
Owner

Yes, there is, but of course, I forgot about it. :)

How did you patch the themes, i.e. what would be your preferred solution?

@Deep-Six
Copy link
Author

Deep-Six commented Jul 3, 2022

let me post my code, nix is a bit interesting in that everything ends up as a hashed directory under the /nix/store path a bunch of things go into deriving the hash, (me blanketing over the stuff I don't know) but the calculation is part of the derivation process available as the variable $out. In this case I patch your source (bumblebee_status/core/theme.py with an @out@ template , and then substitute it thereafter, with the result of $out. See https://pastebin.com/TDCnM6yL and https://pastebin.com/hfJwHPzP respectively.

@tobi-wan-kenobi
Copy link
Owner

Ah, I see, so the XDG_DATA_DIRS diesn't actually help, or am I missing something? (still nice, though)

Also: bumblebee searches also paths relative to the executable, maybe that would be an ok solution as well? (ie if you can keep the same relative paths as the repo, theme and module lookup should work)

Thanks a lot for your work!

@Deep-Six
Copy link
Author

Deep-Six commented Jul 3, 2022

It does, as I think there's native support for XDG_DATA_DIRS so I think it does help, it does seem to preserve relative paths, (see belowe) on my system the build process hashed to this zpsc... directory. Which I think will be true for anyone using an x86-64 arch and running 2.1.5 though, I think I will have to modify my derivation as I suspect I'll need to include all the module dependencies, which will change the hash value.
/nix/store/zpsc456y1njjvhk9pk0hnc8iznjj3nrj-python3.9-bumblebee-status-2.1.5  ls
bin lib nix-support share
but, I'm wondering if it's relative to the symlink which is in ~/.nix-profile/bin eg.
ls -la bumblebee-status
lrwxrwxrwx 97 root 31 Dec 1969  bumblebee-status -> /nix/store/zpsc456y1njjvhk9pk0hnc8iznjj3nrj-python3.9-bumblebee-status-2.1.5/bin/bumblebee-status

@Deep-Six
Copy link
Author

Deep-Six commented Jul 6, 2022

@tobi-wan-kenobi looking a little deeper at the code, would it make more sense to patch discovery.py? Adding in the /nix/store path to utility()? I'm not intimately familiar with the code yet though, so if it makes sense to patch core/module.py I presume it'd need to be load() that get's patched.

Thanks!

@tobi-wan-kenobi
Copy link
Owner

Hmm, possibly, although I think just adding more paths in the lookup like in the last diff should be sufficient...

@Deep-Six
Copy link
Author

Deep-Six commented Jul 6, 2022

@tobi-wan-kenobi hrmm... can you expand on where I'd need to add the paths? Again, not super familiar with your code yet.

@tobi-wan-kenobi
Copy link
Owner

For modules, I am not sure myself and need to look that up in the code, will probably take a couple of days, since I am still recuperating :)

@Deep-Six
Copy link
Author

@tobi-wan-kenobi how you healing up? I hope you're ok!

@tobi-wan-kenobi
Copy link
Owner

@Deep-Six yes, fully functional again, thanks for asking! And apologies, I completely forgot about this one.

You are completely right, adding the utility function in bumblebee_status/discover.py should be sufficient.

Again, sorry for taking so long to simply respond "yup, looks good"!

@Deep-Six
Copy link
Author

@tobi-wan-kenobi not a problem, I had the dreaded C, myself glad to hear you're on the mend.

@tobi-wan-kenobi
Copy link
Owner

@Deep-Six Hope you are also doing well again!

Would you be able to walk me through how you are setting up bumblebee-status in nix? If I can reproc it, I might be able to actually fix those issues myself.

@Deep-Six
Copy link
Author

Deep-Six commented Aug 29, 2022 via email

@Souliboi
Copy link

Souliboi commented Sep 7, 2023

any news in regards to this? asking because i like this package and would love to continue using it on NixOS

@Deep-Six
Copy link
Author

Deep-Six commented Sep 7, 2023 via email

@augustebaum
Copy link

Hi, I decided to have a go at this myself: NixOS/nixpkgs#254772.
@Deep-Six do have a look to see if that resembles your work -- I invite you to add yourself as a maintainer also.

Next up is a NixOS/Home-manager module!

@tobi-wan-kenobi
Copy link
Owner

@augustebaum very cool, thanks! i will close this ticket as soon as that PR is merged.

@adgai19
Copy link
Contributor

adgai19 commented Sep 12, 2023

@tobi-wan-kenobi Do you mind closing the ticket after the PR changes are in nixos-unstable? Due to the way nixpkgs is set up, it takes some time for the changes to propagate into nixos-unstable. Here's the tracker nixos PR Tracker

@tobi-wan-kenobi
Copy link
Owner

sounds good, will do! thanks for the heads up

@augustebaum
Copy link

This is done in NixOS/nixpkgs#254772!

@tobi-wan-kenobi
Copy link
Owner

Thank you!!! Very cool news!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants