diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-05-26 13:58:07 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-05-26 13:58:07 +0200 |
commit | fc6cf6169868e60c189e4b243330c3717ff159f3 (patch) | |
tree | 3f6dea9c1420e23756257b5abea27ec9ed92d58a /overlays/spm/default.nix | |
parent | 84f2affd66a0ff3947b91a30308cb8e6a8ff7594 (diff) | |
download | nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.gz nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.bz2 nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.xz nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.zip |
...
Diffstat (limited to 'overlays/spm/default.nix')
-rw-r--r-- | overlays/spm/default.nix | 46 |
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, ... }: | ||
2 | let | ||
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 | }); | ||
44 | in { | ||
45 | inherit spm; | ||
46 | } | ||