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 }:
|
outputs = { self, flake-utils, nixpkgs, unstable, git-ignore-nix }:
|
||||||
let
|
let
|
||||||
fromHOL = hol: final: prev: with prev.lib; with attrsets;
|
hpath = { prefix ? null, compiler ? null }:
|
||||||
setAttrByPath [ "haskellPackages" ]
|
(if prefix == null then [] else [ prefix ]) ++
|
||||||
((getAttrFromPath [ "haskellPackages" ] prev).override (old: {
|
(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 (_: _: {}))
|
overrides = composeExtensions (old.overrides or (_: _: {}))
|
||||||
(hol final prev);
|
(hol final prev);
|
||||||
}));
|
}));
|
||||||
@ -21,7 +27,7 @@
|
|||||||
(hself.callCabal2nix "xmonad"
|
(hself.callCabal2nix "xmonad"
|
||||||
(git-ignore-nix.lib.gitignoreSource ./.) { });
|
(git-ignore-nix.lib.gitignoreSource ./.) { });
|
||||||
};
|
};
|
||||||
overlay = fromHOL hoverlay;
|
overlay = fromHOL hoverlay { };
|
||||||
overlays = [ overlay ];
|
overlays = [ overlay ];
|
||||||
in flake-utils.lib.eachDefaultSystem (system:
|
in flake-utils.lib.eachDefaultSystem (system:
|
||||||
let pkgs = import nixpkgs { inherit system overlays; };
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
@ -31,5 +37,5 @@
|
|||||||
packages = p: [ p.xmonad ];
|
packages = p: [ p.xmonad ];
|
||||||
};
|
};
|
||||||
defaultPackage = pkgs.haskellPackages.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