git.iko.soy/typeable/cabal2nix
on master help sign in
stack: install bash-completion file in post-process hook
commitd281a6023f1e0fdfd98796bd0ba3f7764c03a457 authorPeter Simons <simons@cryp.to> dateWed 2 Sep 2015, 13:26 (11 years ago) parent80afb21
1 file changed+10
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+10
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+10
@@ -57,6 +57,7 @@ hooks =
5757 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
5858 , ("readline", over (libraryDepends . system) (Set.union (pkgs ["readline", "ncurses"])))
5959 , ("rocksdb-haskell", set (metaSection . platforms) (Set.singleton (Platform X86_64 Linux)))
60+ , ("stack", set phaseOverrides stackPostInstall)
6061 , ("target", set (testDepends . system . contains (pkg "z3")) True)
6162 , ("terminfo", set (libraryDepends . system . contains (pkg "ncurses")) True)
6263 , ("thyme", set (libraryDepends . tool . contains (bind "self.cpphs")) True) -- required on Darwin
@@ -160,6 +161,15 @@ agdaPostInstall = unlines
160161 , "'';"
161162 ]
162163
164+stackPostInstall :: String
165+stackPostInstall = unlines
166+ [ "postInstall = ''"
167+ , " exe=$out/bin/stack"
168+ , " mkdir -p $out/share/bash-completion/completions"
169+ , " $exe --bash-completion-script $exe >$out/share/bash-completion/completions/stack"
170+ , "'';"
171+ ]
172+
163173{-
164174postProcess' :: Derivation -> Derivation
165175postProcess' deriv@(MkDerivation {..})