@@ -88,7 +88,20 @@ let
8888 obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (hackGet ./lib/asset + "/serve-snap") {};
8989 obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
9090 obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
91− obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {});
91+ obelisk-command = (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}).overrideAttrs
92+ (drv: {
93+ buildInputs = drv.buildInputs ++ [ pkgs.makeWrapper ];
94+ postInstall = ''
95+ ${drv.postInstall or ""}
96+ # Install migrations
97+ cp -r ${./migration} $out/migration;
98+ '';
99+ postFixup = ''
100+ ${drv.postFixup or ""}
101+ # Make `ob` reference its runtime dependencies.
102+ wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
103+ '';
104+ });
92105 obelisk-executable-config = executableConfig.haskellPackage self;
93106 obelisk-executable-config-inject = executableConfig.platforms.web.inject self;
94107 obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
@@ -111,15 +124,7 @@ rec {
111124 pathGit = ./.; # Used in CI by the migration graph hash algorithm to correctly ignore files.
112125 path = reflex-platform.filterGit ./.;
113126 obelisk = ghcObelisk;
114− commandWithMigration = ghcObelisk.obelisk-command.overrideAttrs (drv: {
115− postInstall = (drv.postInstall or "") +
116− ''cp -r ${./migration} $out/migration;'';
117− });
118− command = pkgs.runCommand commandWithMigration.name { nativeBuildInputs = [pkgs.makeWrapper]; } ''
119− mkdir -p "$out/bin"
120− ln -s '${commandWithMigration}/bin/ob' "$out/bin/ob"
121− wrapProgram "$out"/bin/ob --prefix PATH : ${pkgs.lib.makeBinPath (commandRuntimeDeps pkgs)}
122− '';
127+ command = ghcObelisk.obelisk-command;
123128 shell = pinBuildInputs "obelisk-shell" ([command] ++ commandRuntimeDeps pkgs) [];
124129
125130 selftest = pkgs.writeScript "selftest" ''