mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
flake.nix: Provide the hoverlay and a version of fromHOL taking a
compiler argument, as well as the hpath function that does the work.
This commit is contained in:
parent
6fc90cd9d3
commit
a5b708ba00
16
flake.nix
16
flake.nix
@ -7,9 +7,15 @@
|
||||
};
|
||||
outputs = { self, flake-utils, nixpkgs, unstable, git-ignore-nix }:
|
||||
let
|
||||
fromHOL = hol: final: prev: with prev.lib; with attrsets;
|
||||
setAttrByPath [ "haskellPackages" ]
|
||||
((getAttrFromPath [ "haskellPackages" ] prev).override (old: {
|
||||
hpath = { prefix ? null, compiler ? null }:
|
||||
(if prefix == null then [] else [ prefix ]) ++
|
||||
(if compiler == null
|
||||
then [ "haskellPackages" ]
|
||||
else [ "haskell" "packages" compiler ]
|
||||
);
|
||||
fromHOL = hol: comp: final: prev: with prev.lib; with attrsets;
|
||||
setAttrByPath (hpath comp)
|
||||
((getAttrFromPath (hpath comp) prev).override (old: {
|
||||
overrides = composeExtensions (old.overrides or (_: _: {}))
|
||||
(hol final prev);
|
||||
}));
|
||||
@ -21,7 +27,7 @@
|
||||
(hself.callCabal2nix "xmonad"
|
||||
(git-ignore-nix.lib.gitignoreSource ./.) { });
|
||||
};
|
||||
overlay = fromHOL hoverlay;
|
||||
overlay = fromHOL hoverlay { };
|
||||
overlays = [ overlay ];
|
||||
in flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
@ -31,5 +37,5 @@
|
||||
packages = p: [ p.xmonad ];
|
||||
};
|
||||
defaultPackage = pkgs.haskellPackages.xmonad;
|
||||
}) // { inherit overlay overlays; lib = { inherit fromHOL; }; };
|
||||
}) // { inherit hoverlay overlay overlays; lib = { inherit hpath fromHOL; }; };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user