nix package

This commit is contained in:
xenia 2023-08-09 23:14:39 +02:00
parent 5848867423
commit 763e753698
3 changed files with 20 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
matabas-db/
artifacts/
artifacts/
result

View File

@ -9,17 +9,27 @@
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages = {
default = pkgs.hello;
};
devShells.default = pkgs.mkShell {
packages = [
packages.default
buildInputs = [
pkgs.postgresql_15_jit
( pkgs.ghc.withPackages (ps: with ps; [ scotty postgresql-typed ]) )
];
shellHook = builtins.readFile ./buildScripts/devShellHook.sh ;
in rec {
packages = {
matabas = pkgs.stdenv.mkDerivation {
name = "matabas";
src = ./. ;
inherit buildInputs ;
buildPhase = builtins.readFile ./buildScripts/setupEnv.sh + ''
build
mkdir -p "$out/bin"
mv artifacts/Main "$out/bin/matabas"
'';
};
default = packages.matabas;
};
devShells.default = pkgs.mkShell {
packages = buildInputs;
shellHook = builtins.readFile ./buildScripts/setupEnv.sh ;
};
}
) // {