Stream: haskell-flake

Topic: `globalSettings` is for which package?


view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:02):

Does globalSettings apply to all the packages in basePackages?

view this post on Zulip Srid (Mar 01 2024 at 12:21):

No, just the ones specified in packages attrset.

view this post on Zulip Srid (Mar 01 2024 at 12:21):

It is badly named. Certainly not 'global'.

view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:22):

Can be fixed along with this: https://github.com/srid/haskell-flake/issues/261

view this post on Zulip Srid (Mar 01 2024 at 12:24):

Srid said:

No, just the ones specified in packages attrset.

Wait. Hmm. Let's confirm that first. Because line 83 here suggests it only applies if you have settings.<foo>.

view this post on Zulip Srid (Mar 01 2024 at 12:25):

Jesus, that code (I've written) is not super clear to read. :face_palm:

view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:29):

Srid said:

Srid said:

No, just the ones specified in packages attrset.

Wait. Hmm. Let's confirm that first. Because line 83 here suggests it only applies if you have settings.<foo>.

This is probably the case

view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:31):

shouldn’t it mapAttrs on config.packages and use config.settings.${name} to get the mod for a given package

view this post on Zulip Srid (Mar 01 2024 at 12:32):

There can be a case where you have a package in settings attrset, but not in packages.

view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:33):

Also, when we introduce different settings default here, we might need a way to test if the setting is actually applied.

view this post on Zulip Srid (Mar 01 2024 at 12:33):

Right. We want to add a dedicated test/??? for this, to check all cases.

view this post on Zulip Srid (Mar 01 2024 at 12:34):

Incidentally, as of yesterday, haskell-flake master uses Nix (flake checks) for tests. No more bash scripts. https://twitter.com/sridca/status/1763528379188265314

example/flake.nix, test/*/flake.nix are all candidates for defining these tests.

view this post on Zulip Shivaraj B H (Mar 01 2024 at 12:34):

Srid said:

There can be a case where you have a package in settings attrset, but not in packages.

Right, so merging the attribute names looks like what we need

view this post on Zulip Srid (Mar 01 2024 at 12:35):

Possibly. In any case, having clear tests cases should also be self-documenting in a way.

view this post on Zulip Srid (Mar 01 2024 at 12:35):

And allow us to freely refactor things without fear of breaking semantics (because the tests, which encode these semantics, will catch them).

view this post on Zulip Srid (Mar 01 2024 at 16:25):

FYI: https://github.com/srid/haskell-flake/commit/307961a20136dd75b761fa0e47b947a6fed757a8

haskellProjectTests is pretty nascent right now, but we can improve it to accommodate our future tests.


Last updated: Sep 16 2024 at 20:16 UTC