pimalaya / neverest

CLI to synchronize, backup and restore emails
https://pimalaya.org
MIT License
194 stars 7 forks source link

Flake outputs are misleading. #3

Open shymega opened 2 months ago

shymega commented 2 months ago

The Flake is misleading. Packages should be system-specific, and not expose attrs of more systems.

Below is a screenshot. I would propose arm64-linux and x86_64-windows to be moved up a level.

notright

shymega commented 2 months ago

NB: I'm happy to make a PR. The issue is reproducible with Himalaya as well.

soywod commented 2 months ago

The structure is not well documented yet, but the first level correspond to host platforms, the second the cross platforms. From x86_64-linux, you can cross compile for x86_64-linux, arm64-linux and also x86_64-windows. I like the structure, it took me a while to set it up correctly. It just needs to be better documented and fixed (somehow does not work properly since last upgrade).

shymega commented 2 months ago

Ah... I see. Okay. That makes sense. Maybe, just to make it clear for people, you could add - either a prefix or a suffix - -cross.

That way it's obvious it's for cross-compiling. What are your thoughts on that?

soywod commented 2 months ago

It allows this kind of things in CI, which I find great and I would like to keep it. It makes builds more predictable and reproducible.

shymega commented 2 months ago

Agreed. Wouldn't a suffix/prefix be relatively easy to adjust in CI as well, though? I mean, it wouldn't be 'typical' user-facing, only for those like me who inspect the Flake, and even then, with documentation in the flake, it would be explained.

soywod commented 2 months ago

Maybe, just to make it clear for people, you could add - either a prefix or a suffix - -cross.

Yes indeed, I like the proposition!

shymega commented 2 months ago

Would you like me to make a PR?

Actually, I think it's best you do this. The Flake looks rather complex.

soywod commented 2 months ago

As you wish. It should not take long for me to fix it, I already put my nose in recently. Thank you for proposing, feel free to submit other PRs if you want!

shymega commented 2 months ago

I've been thinking about this some more.

I may be wrong, but I believe nix/nixpkgs does support system attributes, such as: x86_64-windows, and aarch64-darwin.

We could refactor the Flake here (and on the other projects) to export the nested attributes up a level. It should work with Nix, but you may want to check on the forums.

I think this would be simpler than the current approach and/or adding a -cross suffix.

I suppose the ultimate goal is to upstream to Nixpkgs, right?

soywod commented 2 months ago

Sorry, I realized I've never replied to you.

I think this would be simpler than the current approach and/or adding a -cross suffix.

Should be definitely enough, would you like to propose a PR?

I suppose the ultimate goal is to upstream to Nixpkgs, right?

It's already available on Nixpkgs, but with another derivation. The best would be to use the same between both, do you think it's doable?