postgrest icon indicating copy to clipboard operation
postgrest copied to clipboard

Make default.nix configurable

Open dbaynard opened this issue 1 year ago • 10 comments
trafficstars

The default.nix defines various values that consumers may which to override, such as the nixpkgs version. These variables can be declared instead in the arguments to the top level function, with the current values set as defaults.

Part of #3026

dbaynard avatar Mar 31 '24 16:03 dbaynard

@wolfgangwalther I would need to confirm that the change to applyPatches (specifically, the removal of overlays from the import) does reduce the instantations of nixpkgs in the store. It certainly does no harm, though it wouldn't be worth a PR on its own.

It's very annoying that patching nixpkgs requires importing from a source derivation. Hopefully fixes to https://github.com/NixOS/nixpkgs/issues/286285 (and patching nixpkgs in flakes) will be forthcoming.

dbaynard avatar Mar 31 '24 17:03 dbaynard

Hopefully fixes to https://github.com/NixOS/nixpkgs/issues/286285 (and patching nixpkgs in flakes) will be forthcoming.

The fix relevant for us was already merged to master, we're just blocked from updating to it at the moment (see other comment).

wolfgangwalther avatar Mar 31 '24 17:03 wolfgangwalther

I've marked as ready for review — I guess you can drop the second commit, or wait until upstream is fixed.

dbaynard avatar Mar 31 '24 17:03 dbaynard

or wait until upstream is fixed.

I just gave an update in the blocking PR upstream. Will wait a bit to see how that turns out.

I like the approach you took here.

wolfgangwalther avatar Mar 31 '24 17:03 wolfgangwalther

A nice benefit of this is it makes it straightforward to test with different versions of nixpkgs and GHC.

dbaynard avatar Mar 31 '24 17:03 dbaynard

A nice benefit of this is it makes it straightforward to test with different versions of nixpkgs and GHC.

Yes. I imagine a future, where cross-compiling will also work nicely... and a simple github actions matrix job will just build for different platforms and GHC versions, all via nix. :heart:

wolfgangwalther avatar Mar 31 '24 17:03 wolfgangwalther

I replied in the thread but this should be top level: the current dependency on overlays in nixpkgs-patched might be what is busting the cachix cache. This PR removes that dependency.

dbaynard avatar Mar 31 '24 19:03 dbaynard

@dbaynard #3365 is merged, you can rebase.

wolfgangwalther avatar Apr 20 '24 15:04 wolfgangwalther

Congratulations on getting (many) of your upstream PRs merged. This is much cleaner, without the patching.


I've pushed a basic flake to https://github.com/fore-stun/postgrest/tree/flake-2 and you can run a build with the following.

nix build -L 'github:fore-stun/postgrest/flake-2'

Or, using the revision,

nix build -L 'github:fore-stun/postgrest/1a61b4d1c4ee0ec52468052719af38e832c43d74'

I've only tested on MacOS (and it builds).

dbaynard avatar Apr 20 '24 22:04 dbaynard

I already merged the commit here after rebase + slighty formatting change in 28aac08. Somehow couldn't push to this PR, even though the " Maintainers are allowed to edit this pull request. " setting is there. Might be, because this is coming from the fore-stun:main branch - that could make a difference.

I will leave this PR open for a moment, though, because there are still two comments above, that I would like to follow up on for myself. Thus I assigned myself here - nothing else to be done here.

wolfgangwalther avatar May 09 '24 20:05 wolfgangwalther