@@ -11,105 +11,18 @@ let
1111
1212 inherit (import dep/gitignore.nix { inherit (nixpkgs) lib; }) gitignoreSource;
1313
14− cleanSource = src:
15− # WARNING: The order of application here seems to matter a great deal to
16− # how quickly `ghcid` is able to reload changes. As a rule of thumb,
17− # always apply `gitignoreSource` first.
18− # See https://github.com/obsidiansystems/obelisk/pull/666 and related.
19− pkgs.lib.cleanSource (gitignoreSource src);
20−
21− commandRuntimeDeps = pkgs: with pkgs; [
22− coreutils
23− git
24− nix-prefetch-git
25− openssh
26− ];
27−
2814 getReflexPlatform = { system, enableLibraryProfiling ? profiling }: reflex-platform-func {
2915 inherit iosSdkVersion config system enableLibraryProfiling;
3016
3117 nixpkgsOverlays = [
32− (self: super: {
33− obeliskExecutableConfig = import ./lib/executable-config { nixpkgs = pkgs; filterGitSource = cleanSource; };
34− })
18+ (import ./nixpkgs-overlays)
3519 ];
3620
3721 haskellOverlays = [
38−
39− # Fix misc upstream packages
40− (self: super: let
41− pkgs = self.callPackage ({ pkgs }: pkgs) {};
42− haskellLib = pkgs.haskell.lib;
43− in {
44− hnix = haskellLib.dontCheck (haskellLib.doJailbreak (self.callCabal2nix "hnix" (hackGet dep/hnix) {}));
45− hnix-store-core = self.callHackage "hnix-store-core" "0.1.0.0" {};
46−
47− ghcid = self.callCabal2nix "ghcid" (hackGet ./dep/ghcid) {};
48− # Exports more internals
49− snap-core = haskellLib.dontCheck (self.callCabal2nix "snap-core" (hackGet ./dep/snap-core) {});
50− })
51−
22+ (import ./haskell-overlays/misc-deps.nix { inherit hackGet; })
5223 pkgs.obeliskExecutableConfig.haskellOverlay
53−
54− # Add obelisk packages
55− (self: super: let
56− pkgs = self.callPackage ({ pkgs }: pkgs) {};
57− onLinux = pkg: f: if pkgs.stdenv.isLinux then f pkg else pkg;
58− in {
59− shelly = self.callHackage "shelly" "1.9.0" {};
60−
61− obelisk-executable-config-inject = pkgs.obeliskExecutableConfig.platforms.web.inject self;
62−
63− obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (cleanSource ./lib/asset/manifest) {};
64− obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (cleanSource ./lib/asset/serve-snap) {};
65− obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
66− obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
67− obelisk-command = haskellLib.overrideCabal (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}) {
68− librarySystemDepends = [
69− pkgs.jre
70− pkgs.nix
71− (haskellLib.justStaticExecutables self.ghcid)
72− ];
73− };
74− obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
75− obelisk-run = onLinux (self.callCabal2nix "obelisk-run" (cleanSource ./lib/run) {}) (pkg:
76− haskellLib.overrideCabal pkg (drv: { librarySystemDepends = [ pkgs.iproute ]; })
77− );
78− obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {};
79− obelisk-selftest = haskellLib.overrideCabal (self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {}) {
80− librarySystemDepends = [
81− pkgs.cabal-install
82− pkgs.coreutils
83− pkgs.git
84− pkgs.nix
85− pkgs.nix-prefetch-git
86− pkgs.rsync
87− ];
88− };
89− obelisk-snap-extras = self.callCabal2nix "obelisk-snap-extras" (cleanSource ./lib/snap-extras) {};
90− tabulation = self.callCabal2nix "tabulation" (cleanSource ./lib/tabulation) {};
91− })
92−
93− (self: super: let
94− pkgs = self.callPackage ({ pkgs }: pkgs) {};
95− haskellLib = pkgs.haskell.lib;
96− in {
97− # Dynamic linking with split objects dramatically increases startup time (about
98− # 0.5 seconds on a decent machine with SSD), so we do `justStaticExecutables`.
99− obelisk-command = haskellLib.overrideCabal
100− (haskellLib.generateOptparseApplicativeCompletion "ob"
101− (haskellLib.justStaticExecutables super.obelisk-command))
102− (drv: {
103− buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];
104− postFixup = ''
105− ${drv.postFixup or ""}
106− # Make `ob` reference its runtime dependencies.
107− wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
108− '';
109− });
110− obelisk-selftest = haskellLib.justStaticExecutables super.obelisk-selftest;
111− })
112−
24+ (import ./haskell-overlays/obelisk.nix)
25+ (import ./haskell-overlays/tighten-ob-exes.nix)
11326 ];
11427 };
11528
@@ -132,7 +45,7 @@ in rec {
13245 obelisk = ghcObelisk;
13346 obeliskEnvs = pkgs.lib.filterAttrs (k: _: pkgs.lib.strings.hasPrefix "obelisk-" k) ghcObeliskEnvs;
13447 command = ghcObelisk.obelisk-command;
135− shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs);
48+ shell = pinBuildInputs "obelisk-shell" ([command] ++ command.commandRuntimeDeps);
13649
13750 selftest = pkgs.writeScript "selftest" ''
13851 #!${pkgs.runtimeShell}