@@ -65,31 +65,11 @@ let
65 (self: super: let
65 (self: super: let
66 pkgs = self.callPackage ({ pkgs }: pkgs) {};
66 pkgs = self.callPackage ({ pkgs }: pkgs) {};
67 haskellLib = pkgs.haskell.lib;
67 haskellLib = pkgs.haskell.lib;
69− # Modify a Haskell package to add completion scripts for the given
70− # executable produced by it. These completion scripts will be picked up
71− # automatically if the resulting derivation is installed, e.g. by
73− addOptparseApplicativeCompletionScripts = exeName: pkg: haskellLib.overrideCabal pkg (drv: {
74− postInstall = (drv.postInstall or "") + ''
75− BASH_COMP_DIR="$out/share/bash-completion/completions"
76− mkdir -p "$BASH_COMP_DIR"
77− "$out/bin/${exeName}" --bash-completion-script "$out/bin/${exeName}" >"$BASH_COMP_DIR/ob"
79− ZSH_COMP_DIR="$out/share/zsh/vendor-completions"
80− mkdir -p "$ZSH_COMP_DIR"
81− "$out/bin/${exeName}" --zsh-completion-script "$out/bin/${exeName}" >"$ZSH_COMP_DIR/_ob"
83− FISH_COMP_DIR="$out/share/fish/vendor_completions.d"
84− mkdir -p "$FISH_COMP_DIR"
85− "$out/bin/${exeName}" --fish-completion-script "$out/bin/${exeName}" >"$FISH_COMP_DIR/ob.fish"
89 # Dynamic linking with split objects dramatically increases startup time (about
69 # Dynamic linking with split objects dramatically increases startup time (about
90 # 0.5 seconds on a decent machine with SSD), so we do `justStaticExecutables`.
70 # 0.5 seconds on a decent machine with SSD), so we do `justStaticExecutables`.
91 obelisk-command = haskellLib.overrideCabal
71 obelisk-command = haskellLib.overrideCabal
92− (addOptparseApplicativeCompletionScripts "ob"
72+ (haskellLib.addOptparseApplicativeCompletionScripts "ob"
93 (haskellLib.justStaticExecutables super.obelisk-command))
73 (haskellLib.justStaticExecutables super.obelisk-command))
95 buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];
75 buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];