diff --git a/.gitignore b/.gitignore index 3539501..fe68769 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .stack-work/ *~ -database/* \ No newline at end of file +database/* +result diff --git a/flake.nix b/flake.nix index a36bdc8..7dfecb7 100644 --- a/flake.nix +++ b/flake.nix @@ -29,14 +29,40 @@ 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 { - packages.${system}.${name} = nixpkgs.legacyPackages.${system}.${name}; - packages.${system}.default = self.packages.${system}.${name}; + packages.${system} = { + ${name} = oms; # nixpkgs.legacyPackages.${system}.${name}; + default = self.packages.${system}.${name}; + }; devShells.${system}.default = pkgs.mkShell { buildInputs = buildInputs; - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; + LD_LIBRARY_PATH = libPath; shellHook = builtins.readFile ./mkDB.sh; }; };