nix derivation
This commit is contained in:
parent
4785a98ebe
commit
159839dc83
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
.stack-work/
|
.stack-work/
|
||||||
*~
|
*~
|
||||||
database/*
|
database/*
|
||||||
|
result
|
||||||
|
|||||||
32
flake.nix
32
flake.nix
@ -29,14 +29,40 @@
|
|||||||
with haskell.packages."ghc927"; [ ghc haskell-language-server ]
|
with haskell.packages."ghc927"; [ ghc haskell-language-server ]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
libPath = pkgs.lib.makeLibraryPath buildInputs;
|
||||||
|
#oms = pkgs.haskell.lib.buildStackProject {
|
||||||
|
# ghc = pkgs.haskell.packages.ghc927.ghc;
|
||||||
|
# inherit buildInputs;
|
||||||
|
# inherit name;
|
||||||
|
# dontUnpack = true;
|
||||||
|
#};
|
||||||
|
oms = pkgs.stdenv.mkDerivation {
|
||||||
|
inherit buildInputs;
|
||||||
|
inherit name;
|
||||||
|
pname = name;
|
||||||
|
src = ./.;
|
||||||
|
# dontUnpack = true;
|
||||||
|
buildPhase = ''
|
||||||
|
HOME=$out
|
||||||
|
LD_LIBRARY_PATH=${libPath}
|
||||||
|
mkdir -p $HOME/.stack
|
||||||
|
stack build --verbose
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mv .stack-work/install/${system}/*/*/bin/${name}-exe $out
|
||||||
|
echo "moved"
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
packages.${system}.${name} = nixpkgs.legacyPackages.${system}.${name};
|
packages.${system} = {
|
||||||
packages.${system}.default = self.packages.${system}.${name};
|
${name} = oms; # nixpkgs.legacyPackages.${system}.${name};
|
||||||
|
default = self.packages.${system}.${name};
|
||||||
|
};
|
||||||
|
|
||||||
devShells.${system}.default = pkgs.mkShell {
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
buildInputs = buildInputs;
|
buildInputs = buildInputs;
|
||||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
LD_LIBRARY_PATH = libPath;
|
||||||
shellHook = builtins.readFile ./mkDB.sh;
|
shellHook = builtins.readFile ./mkDB.sh;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user