Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created March 12, 2021 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianparvino/c8404b3c341ccbece3c175e85f1e3565 to your computer and use it in GitHub Desktop.
Save adrianparvino/c8404b3c341ccbece3c175e85f1e3565 to your computer and use it in GitHub Desktop.
let
pkgs = import <nixpkgs> {
overlays = [
(final: prev: {
haskellPackages = prev.haskellPackages.extend (self: super: {
test-notexist-a = self.hello;
});
})
# PROBLEM: a second overlay adds test-notexist-b but causes the
# previously added test-notexist-a to disappear.
# SOLUTION: use the override style which gets the old override attrs (??)
# and then manually generate the overrides attrs (??) by calling
# old.overrides and then combine it with the new one
(final: prev: {
haskellPackages = prev.haskellPackages.extend (self: super: {
test-notexist-b = self.hello;
});
})
];
};
in
{
hello = pkgs.haskellPackages.hello;
a = pkgs.haskellPackages.test-notexist-a;
b = pkgs.haskellPackages.test-notexist-b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment