@@ -3,9 +3,54 @@
33, iosSdkVersion ? "10.2"
44}:
55let
6− getReflexPlatform = sys: import ./dep/reflex-platform { inherit iosSdkVersion; system = sys; enableLibraryProfiling = profiling; };
7− reflex-platform = getReflexPlatform system;
8− inherit (reflex-platform) hackGet nixpkgs;
6+ getReflexPlatform = sys: import ./dep/reflex-platform {
7+ inherit iosSdkVersion;
8+ system = sys;
9+ enableLibraryProfiling = profiling;
10+ haskellOverlays = [
11+ # Fix misc upstream packages
12+ (self: super: {
13+ # Need deriveSomeUniverse
14+ # PR: https://github.com/dmwit/universe/pull/32
15+ universe-template = self.callCabal2nix "universe-template" (pkgs.fetchFromGitHub {
16+ owner = "obsidiansystems";
17+ repo = "universe";
18+ rev = "5a2fc823caa4163411d7e41aa80e67cefb15944a";
19+ sha256 = "0ll2z0fh18z6x8jl8kbp7ldagwccz3wjmvrw1gw752z058n82yfa";
20+ } + /template) {};
21+ })
22+ # Add obelisk packages
23+ (self: super: {
24+ obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (hackGet ./lib/asset + "/manifest") {};
25+ obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (hackGet ./lib/asset + "/serve-snap") {};
26+ obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
27+ obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
28+ obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}).overrideAttrs
29+ (drv: {
30+ buildInputs = drv.buildInputs ++ [ pkgs.makeWrapper ];
31+ postFixup = ''
32+ ${drv.postFixup or ""}
33+ # Make `ob` reference its runtime dependencies.
34+ wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
35+ '';
36+ });
37+ obelisk-executable-config = executableConfig.haskellPackage self;
38+ obelisk-executable-config-inject = executableConfig.platforms.web.inject self;
39+ obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
40+ obelisk-run = self.callCabal2nix "obelisk-run" (cleanSource ./lib/run) {};
41+ obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {};
42+ obelisk-selftest = self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {};
43+ obelisk-snap = self.callCabal2nix "obelisk-snap" (cleanSource ./lib/snap) {};
44+ obelisk-snap-extras = self.callCabal2nix "obelisk-snap-extras" (cleanSource ./lib/snap-extras) {};
45+ })
46+ # Dynamic linking with split objects dramatically increases startup time (about 0.5 seconds on a decent machine with SSD)
47+ (self: super: {
48+ obelisk-command = addOptparseApplicativeCompletionScripts "ob" (justStaticExecutables super.obelisk-command);
49+ })
50+ ];
51+ };
52+ reflex-platform = getReflexPlatform system;
53+ inherit (reflex-platform) hackGet nixpkgs;
954 pkgs = nixpkgs;
1055in with pkgs.haskell.lib; with pkgs.lib;
1156let
@@ -47,21 +92,7 @@ let
4792
4893 # The haskell environment used to build Obelisk itself, e.g. the 'ob' command
4994 ghcObelisk = reflex-platform.ghc.override {
50− overrides = composeExtensions defaultHaskellOverrides (self: super: {
51− # Dynamic linking with split objects dramatically increases startup time (about 0.5 seconds on a decent machine with SSD)
52− obelisk-command = addOptparseApplicativeCompletionScripts "ob" (justStaticExecutables' super.obelisk-command);
53− });
54− };
55−
56− fixUpstreamPkgs = self: super: {
57− # Need deriveSomeUniverse
58− # PR: https://github.com/dmwit/universe/pull/32
59− universe-template = self.callCabal2nix "universe-template" (pkgs.fetchFromGitHub {
60− owner = "obsidiansystems";
61− repo = "universe";
62− rev = "5a2fc823caa4163411d7e41aa80e67cefb15944a";
63− sha256 = "0ll2z0fh18z6x8jl8kbp7ldagwccz3wjmvrw1gw752z058n82yfa";
64− } + /template) {};
95+ overrides = composeExtensions defaultHaskellOverrides ;
6596 };
6697
6798 cleanSource = builtins.filterSource (name: _: let baseName = builtins.baseNameOf name; in !(
@@ -71,30 +102,6 @@ let
71102
72103 executableConfig = import ./lib/executable-config { nixpkgs = pkgs; filterGitSource = cleanSource; };
73104
74− addLibs = self: super: {
75− obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (hackGet ./lib/asset + "/manifest") {};
76− obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (hackGet ./lib/asset + "/serve-snap") {};
77− obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
78− obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
79− obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}).overrideAttrs
80− (drv: {
81− buildInputs = drv.buildInputs ++ [ pkgs.makeWrapper ];
82− postFixup = ''
83− ${drv.postFixup or ""}
84− # Make `ob` reference its runtime dependencies.
85− wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
86− '';
87− });
88− obelisk-executable-config = executableConfig.haskellPackage self;
89− obelisk-executable-config-inject = executableConfig.platforms.web.inject self;
90− obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
91− obelisk-run = self.callCabal2nix "obelisk-run" (cleanSource ./lib/run) {};
92− obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {};
93− obelisk-selftest = self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {};
94− obelisk-snap = self.callCabal2nix "obelisk-snap" (cleanSource ./lib/snap) {};
95− obelisk-snap-extras = self.callCabal2nix "obelisk-snap-extras" (cleanSource ./lib/snap-extras) {};
96− };
97−
98105 inherit (import ./lib/asset/assets.nix { inherit nixpkgs; }) mkAssets;
99106
100107 defaultHaskellOverrides = composeExtensions fixUpstreamPkgs addLibs;