Skip to content

flake.nix: add macOS (Darwin) support#393

Open
randomizedcoder wants to merge 2 commits intoespotek-org:masterfrom
randomizedcoder:darwin
Open

flake.nix: add macOS (Darwin) support#393
randomizedcoder wants to merge 2 commits intoespotek-org:masterfrom
randomizedcoder:darwin

Conversation

@randomizedcoder
Copy link
Copy Markdown
Contributor

G'day Chris,

I just created the nixpkgs pull request, so it will be easy for people to see Labrador is supported by Nixpkgs. Once merged it will also sort of make the Flake redundant.
NixOS/nixpkgs#477199

However, I noticed that I would also improve the platform support adding Darwin to the flake.

  • Add platform detection for Darwin vs Linux
  • Handle different libdfuprog paths and extensions (.so/.dylib)
  • Use appropriate library path env var (LD_LIBRARY_PATH/DYLD_LIBRARY_PATH)
  • Handle binary name differences (labrador/Labrador)
  • Install icons and desktop files only on Linux
  • Use sysctl fallback for CPU count on macOS
  • Update platforms to include darwin

I don't have a recent Apples devices, so this is untested.

Thanks,
Dave

- Add platform detection for Darwin vs Linux
- Handle different libdfuprog paths and extensions (.so/.dylib)
- Use appropriate library path env var (LD_LIBRARY_PATH/DYLD_LIBRARY_PATH)
- Handle binary name differences (labrador/Labrador)
- Install icons and desktop files only on Linux
- Use sysctl fallback for CPU count on macOS
- Update platforms to include darwin
@EspoTek
Copy link
Copy Markdown
Collaborator

EspoTek commented Jan 5, 2026

If it's not possible to test on macOS, I think we just keep support limited to Linux.

@randomizedcoder
Copy link
Copy Markdown
Contributor Author

Makes sense. If we do find somebody with Darwin, then it would be great to test it!

@mi-hol
Copy link
Copy Markdown
Contributor

mi-hol commented Jan 6, 2026

find somebody with Darwin,

While this is "developer speak" I believe it means any macOS or iOS version should work for testing.
@EspoTek I though you'd own at least one device running macOS

@mi-hol
Copy link
Copy Markdown
Contributor

mi-hol commented Feb 17, 2026

@randomizedcoder I have never heard of NixOS before and had just a little bit of reading.

Therefore I ask myself:
How will this package find its way into the official NixOS repo so the search https://search.nixos.org/flakes?channel=25.11&query=Labrador will find it?

@randomizedcoder
Copy link
Copy Markdown
Contributor Author

If you are still using a non-deterministic operation system (e.g. Debian or Ubuntu), then it's definitely time to try NixOS

I submitted the pull request a while back
NixOS/nixpkgs#477199

Looks like I need to fix the pull request

@EspoTek
Copy link
Copy Markdown
Collaborator

EspoTek commented Feb 19, 2026

Let us know when both PRs are ready to go and we can merge them together.

@mi-hol
Copy link
Copy Markdown
Contributor

mi-hol commented Mar 20, 2026

@EspoTek as the PR has no negative impact on Labrador I'd suggest to merge it now.
Please raise any objections by 27Mar.

@turboencabulator
Copy link
Copy Markdown
Contributor

  1. The latest merge needs to be redone, it still mentions libdfuprog binaries that are now gone. It should be simpler now that it doesn't have to deal with the library handling differences.
  2. installPhase has a lot of manual steps, is it possible to replace them with something like make INSTALL_ROOT=$out install? (I'm not sure if $out is the correct thing to use there since it's the same as PREFIX.)
  3. Are these scripts something that ultimately belongs in the NixOS/nixpkgs repo instead of here? I'm not familiar with how it does things, but typically most projects don't tend to incorporate distro-specific packaging scripts (due to the effort involved by the distro to put their scripts everywhere, and again the effort involved if the distro needs to make a breaking change to those scripts).

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.

4 participants