summaryrefslogtreecommitdiff
path: root/overlays/spm/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/spm/default.nix')
-rw-r--r--overlays/spm/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/overlays/spm/default.nix b/overlays/spm/default.nix
new file mode 100644
index 00000000..6593fca8
--- /dev/null
+++ b/overlays/spm/default.nix
@@ -0,0 +1,46 @@
1{ final, prev, ... }:
2let
3 spm = let
4 # defaultPackages = (import ./stackage.nix {});
5 # haskellPackages = defaultPackages // argumentPackages;
6 # haskellPackages = argumentPackages;
7 haskellPackages = final.haskell.packages.ghc922.override {
8 overrides = self: super: {
9 warp-systemd = final.haskell.lib.doJailbreak (super.warp-systemd.overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { broken = false; }; }));
10 servant-server = super.servant-server.overrideAttrs (oldAttrs: {
11 patches = [];
12 });
13 hpack = super.hpack.overrideAttrs (oldAttrs: rec {
14 version = "0.35.0";
15 src = prev.fetchFromGitHub {
16 owner = "sol";
17 repo = "hpack";
18 rev = "0.35.0";
19 hash = "sha256-DMxCHwz9x2e4kSOIk1/qeW3aDFHw88LNW+4vXxDV9EI=";
20 };
21 });
22 };
23 };
24
25 spm-frontend = final.callPackage ./frontend {
26 baseHref = "/ui/";
27 };
28 in final.haskell.lib.overrideCabal (haskellPackages.callPackage ./spm.nix {}) (oldAttrs: {
29 src = final.lib.cleanSourceWith rec {
30 filter = let
31 isFiltered = src ? _isLibCleanSourceWith;
32 origSrc = if isFiltered then src.origSrc else src;
33 relPath = path: final.lib.removePrefix (toString origSrc + "/") (toString path);
34 in path: _type: builtins.match "^frontend(/.*)?$" (relPath path) == null;
35 src = ./.;
36 };
37
38 postPatch = ''
39 ${oldAttrs.postPatch or ""}
40
41 ln -sfTv ${spm-frontend} frontend
42 '';
43 });
44in {
45 inherit spm;
46}