input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
558 stars 240 forks source link

Mac & Linux support of Flake template #1825

Open peterbecich opened 1 year ago

peterbecich commented 1 year ago

Is your feature request related to a problem? Please describe. My understanding is that a haskell.nix Flake does not work in exactly the same way on Mac and Linux. Based on this comment https://github.com/input-output-hk/haskell.nix/issues/1401#issuecomment-1266236471 and some testing, it looks like a haskell.nix Flake can be used on both Mac and Linux by:

Describe the solution you'd like The haskell.nix Flake in this project https://github.com/input-output-hk/cicero-pipe appears to use a fourth solution. nix build and nix develop run on Mac and Linux, without using any of the three solutions above. I have tested this on an amd64-linux and amd64-mac.

The key may be the materialization: https://github.com/input-output-hk/cicero-pipe/tree/master/nix/materialized

Can the approach taken in the cicero-pipe Flake be copied into the haskell.nix Flake template, to improve the ease-of-use of the Flake template?

Additional context

Discussion about builtins.currentSystem: https://github.com/input-output-hk/haskell.nix/issues/1401

Thank you for this project, haskell.nix has been very useful to me!

peterbecich commented 1 year ago

I think the materialization in cicero-pipe prevents Mac/Linux errors in nix develop, nix build and nix run.

These issues concern nix flake show and nix flake check:

nix flake show should be filterable by the current system #6985 https://github.com/NixOS/nix/issues/6985

nix flake check is running checks for all systems in checks #6806 https://github.com/NixOS/nix/issues/6806

nix flake check breaks on IFD in multi-platform flake #4265 https://github.com/NixOS/nix/issues/4265

PR:

nix flake show: don't evaluate derivations for foreign systems by default #6988 https://github.com/NixOS/nix/pull/6988

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hamishmack commented 1 year ago

Would it make sense to add ciEvalSystem (like evalSystem, but only for flake hydraJobs)?