bumblebee-status icon indicating copy to clipboard operation
bumblebee-status copied to clipboard

Package bumblebee-status for nixos

Open Deep-Six opened this issue 3 years ago • 22 comments

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.

Deep-Six avatar Sep 28 '21 20:09 Deep-Six

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

tobi-wan-kenobi avatar Sep 28 '21 20:09 tobi-wan-kenobi

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?

Deep-Six avatar Sep 28 '21 21:09 Deep-Six

Nice video :+1:

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!

tobi-wan-kenobi avatar Sep 29 '21 06:09 tobi-wan-kenobi

@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?

Deep-Six avatar Jul 03 '22 09:07 Deep-Six

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)

tobi-wan-kenobi avatar Jul 03 '22 10:07 tobi-wan-kenobi

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

Deep-Six avatar Jul 03 '22 10:07 Deep-Six

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 !

Tonus1 avatar Jul 03 '22 11:07 Tonus1

@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.

tobi-wan-kenobi avatar Jul 03 '22 11:07 tobi-wan-kenobi

@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?

Deep-Six avatar Jul 03 '22 19:07 Deep-Six

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

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

tobi-wan-kenobi avatar Jul 03 '22 19:07 tobi-wan-kenobi

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.

Deep-Six avatar Jul 03 '22 20:07 Deep-Six

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!

tobi-wan-kenobi avatar Jul 03 '22 20:07 tobi-wan-kenobi

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 avatar Jul 03 '22 20:07 Deep-Six

@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!

Deep-Six avatar Jul 06 '22 07:07 Deep-Six

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

tobi-wan-kenobi avatar Jul 06 '22 07:07 tobi-wan-kenobi

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

Deep-Six avatar Jul 06 '22 07:07 Deep-Six

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 :)

tobi-wan-kenobi avatar Jul 06 '22 07:07 tobi-wan-kenobi

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

Deep-Six avatar Aug 29 '22 09:08 Deep-Six

@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"!

tobi-wan-kenobi avatar Aug 29 '22 09:08 tobi-wan-kenobi

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

Deep-Six avatar Aug 29 '22 09:08 Deep-Six

@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.

tobi-wan-kenobi avatar Aug 29 '22 09:08 tobi-wan-kenobi

Sure, I'll have to get back to you on that though, I have some pressing work matters at hand. I'll definitely circle back with you though in the next while.

Thanks!


From: tobi-wan-kenobi @.> Sent: August 29, 2022 2:50 AM To: tobi-wan-kenobi/bumblebee-status @.> Cc: Jayson Henkel @.>; Mention @.> Subject: Re: [tobi-wan-kenobi/bumblebee-status] Package bumblebee-status for nixos (#821)

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

@Deep-Sixhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDeep-Six&data=05%7C01%7Cjhenkel%40lululemon.com%7C11c7b02ee94d4df7de8208da89a3d775%7C59762c1455e84b58806ef6cc47d75b19%7C0%7C0%7C637973634029381515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QaAV4MWl5fJujrUWj3HbxE2TXRcm%2Bc5MugwmK4uAq7Q%3D&reserved=0 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.

— Reply to this email directly, view it on GitHubhttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftobi-wan-kenobi%2Fbumblebee-status%2Fissues%2F821%23issuecomment-1230038743&data=05%7C01%7Cjhenkel%40lululemon.com%7C11c7b02ee94d4df7de8208da89a3d775%7C59762c1455e84b58806ef6cc47d75b19%7C0%7C0%7C637973634029537672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DAhbvc5jEsi7k3FN0KTr2K%2BbURO3fWldcY7jHbcTM6c%3D&reserved=0, or unsubscribehttps://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFR63V3GQQTYYCDS3AJSYA3V3SBURANCNFSM5E6ICSKQ&data=05%7C01%7Cjhenkel%40lululemon.com%7C11c7b02ee94d4df7de8208da89a3d775%7C59762c1455e84b58806ef6cc47d75b19%7C0%7C0%7C637973634029537672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=S%2B8o7g8w3N6qTY3gXSjDm4rqIXimlnrIznnU%2Bwagf3M%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

Deep-Six avatar Aug 29 '22 09:08 Deep-Six

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

Souliboi avatar Sep 07 '23 21:09 Souliboi

I had it completed, but ultimately lost the work in a hd crash..and haven't had time to re-visit it. It was pretty straightforward, let me know if you want to collaborate on it!


From: Soul @.> Sent: September 7, 2023 2:54 PM To: tobi-wan-kenobi/bumblebee-status @.> Cc: Jayson Henkel @.>; Mention @.> Subject: Re: [tobi-wan-kenobi/bumblebee-status] Package bumblebee-status for nixos (#821)

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.

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

— Reply to this email directly, view it on GitHubhttps://github.com/tobi-wan-kenobi/bumblebee-status/issues/821#issuecomment-1710814461, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFR63V5KWGT2UYN72YNLUO3XZI7AVANCNFSM5E6ICSKQ. You are receiving this because you were mentioned.Message ID: @.***>

Deep-Six avatar Sep 07 '23 21:09 Deep-Six

Hi, I decided to have a go at this myself: https://github.com/NixOS/nixpkgs/pull/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!

augustebaum avatar Sep 12 '23 15:09 augustebaum

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

tobi-wan-kenobi avatar Sep 12 '23 16:09 tobi-wan-kenobi

@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

adgai19 avatar Sep 12 '23 17:09 adgai19

sounds good, will do! thanks for the heads up

tobi-wan-kenobi avatar Sep 12 '23 17:09 tobi-wan-kenobi

This is done in https://github.com/NixOS/nixpkgs/pull/254772!

augustebaum avatar Nov 26 '23 15:11 augustebaum

Thank you!!! Very cool news!

tobi-wan-kenobi avatar Nov 26 '23 16:11 tobi-wan-kenobi