Even more parametric Derivation#24
Draft
sorki wants to merge 5 commits into
Draft
Conversation
Allows to use custom types for both sides of the map. The main reason for this is `hnix-store` which now uses `DSum HashAlgo Digest` which combines `hashAlgo` and `hash` fields of the `DerivationOutput` and `OutputName` type for the keys, which is similar to how the newtype is done in the mainline Nix.
Normalizes `inputsSrcs` and `inputsDrvs` into `inputs`. Similar reasons as the previous commit. Allows to embed mainline Nixes `BasicDerivation` into `Derivation` by using `inputs` type that only provides source inputs.
sorki
added a commit
to haskell-nix/hnix-store
that referenced
this pull request
Dec 7, 2023
It is already parametrized, but `name` field is too specific to accommodate i.e. `DerivationOutput StorePath` which is used by `Derivation` type. So we call it `output` instead and turn the type variable to just `a`. So * for `Realisation`s this is `DerivationOutput OutputName` * for `Derivation`s this is `DerivatonOutput StorePath` * for content addressed derivations this might be `DerivationOutput Void` as the path isn't known ahead of time. So only its shape is important. Related to Gabriella439/Haskell-Nix-Derivation-Library#24
sorki
added a commit
to haskell-nix/hnix-store
that referenced
this pull request
Dec 7, 2023
It is already parametrized, but `name` field is too specific to accommodate i.e. `DerivationOutput StorePath` which is used by `Derivation` type. So we call it `output` instead and turn the type variable to just `a`. So * for `Realisation`s this is `DerivationOutput OutputName` * for `Derivation`s this is `DerivatonOutput StorePath` * for content addressed derivations this might be `DerivationOutput Void` as the path isn't known ahead of time. So only its shape is important. Related to Gabriella439/Haskell-Nix-Derivation-Library#24
Forward port of Gabriella439#26
ConnorBaker
added a commit
to ConnorBaker/nix-output-monitor
that referenced
this pull request
Jan 25, 2024
…rary fork All credit goes to @sorki and @rickynils for their work on: - Gabriella439/Haskell-Nix-Derivation-Library#26 - Gabriella439/Haskell-Nix-Derivation-Library#24 This commit takes the changes relevant to `Nix.Derivation` and vendors them in-tree. Co-Authored-By: sorki <srk@48.io> Co-Authored-By: Rickard Nilsson <rickynils@gmail.com>
ConnorBaker
added a commit
to ConnorBaker/nix-output-monitor
that referenced
this pull request
Jan 25, 2024
…rary fork All credit goes to @sorki and @rickynils for their work on: - Gabriella439/Haskell-Nix-Derivation-Library#26 - Gabriella439/Haskell-Nix-Derivation-Library#24 and of course to @Gabriella439 for the entire library! This commit takes the changes relevant to `Nix.Derivation` and vendors them in-tree. Co-Authored-By: Gabriella Gonzalez <Gabriel439@gmail.com> Co-Authored-By: sorki <srk@48.io> Co-Authored-By: Rickard Nilsson <rickynils@gmail.com>
ConnorBaker
added a commit
to ConnorBaker/nix-output-monitor
that referenced
this pull request
Jan 25, 2024
…rary fork All credit goes to @sorki and @rickynils for their work on: - Gabriella439/Haskell-Nix-Derivation-Library#26 - Gabriella439/Haskell-Nix-Derivation-Library#24 and of course to @Gabriella439 for the entire library! This commit takes the changes relevant to `Nix.Derivation` and vendors them in-tree. Co-Authored-By: Gabriella Gonzalez <Gabriel439@gmail.com> Co-Authored-By: sorki <srk@48.io> Co-Authored-By: Rickard Nilsson <rickynils@gmail.com>
ConnorBaker
added a commit
to ConnorBaker/nix-output-monitor
that referenced
this pull request
Jan 25, 2024
…rary fork All credit goes to @sorki and @rickynils for their work on: - Gabriella439/Haskell-Nix-Derivation-Library#26 - Gabriella439/Haskell-Nix-Derivation-Library#24 and of course to @Gabriella439 for the entire library! This commit takes the changes relevant to `Nix.Derivation` and vendors them in-tree. Co-Authored-By: Gabriella Gonzalez <Gabriel439@gmail.com> Co-Authored-By: sorki <srk@48.io> Co-Authored-By: Rickard Nilsson <rickynils@gmail.com>
Ericson2314
added a commit
to haskell-nix/hnix-store
that referenced
this pull request
Mar 27, 2026
…on-rework-2 After, in the previous commit, mering in `main` of https://github.com/Gabriella439/Haskell-Nix-Derivation-Library, this merges in the two outstanding PRs' worth of data: - Gabriella439/Haskell-Nix-Derivation-Library#24 - Gabriella439/Haskell-Nix-Derivation-Library#26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parametrized on
outputNamedrvOutputdrvInputsNormalizes
Derivationinputs and makes it accept different types for all these, which is required to tie some loose ends onhnix/hnix-storeside.I've also removed the (now) useless
FunctorandBifunctorinstances and passed the lib thru hlint, which doesn't produce any warnings now.DeriviationOutputis no longer parametrized withtextas we replace it completely on our side withI've realised this when I've tried to implement Nixes
Realisationtype 🙃, which also usesDerivationOutputI hope this accommodates all our needs, and is parametric enough for now - we might want to differentiate between the other
txttypes in the future though, using some simplenewtypewrappers.I'm tempted to add a type alias to make this look less awkward for downstream users that don't need this level of parametrization (
nix-diff,nix-graph), but I'm not sure if it's worth it because then you need to import bothDerivation(..)for the fields and the type alias.I'll try to actually use this first, to see if really fits and then I would add a version bump (possibly
CHANGELOGas well), ask you for a release and do the downstream PRs.