initial backend nix build - get jar

This commit is contained in:
efim
2023-04-29 19:12:30 +04:00
parent ba625d738e
commit d4eae63166
4 changed files with 65 additions and 4 deletions

View File

@@ -2,12 +2,17 @@
description = "Planning Poker web app. Trying to build something and learn new things";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.sbt-derivation.url = "github:zaninime/sbt-derivation/master";
inputs.sbt-derivation.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, sbt-derivation }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
let
pkgs = nixpkgs.legacyPackages.${system};
packageName = "blanning-poker-grargh";
version = "0.1.1";
in {
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs
@@ -21,6 +26,22 @@
echo "dev env for planning poker BWARGH started"
'';
};
packages.backend = sbt-derivation.lib.mkSbtDerivation rec {
inherit pkgs version;
# ...and the rest of the arguments
pname = "${packageName}-backend";
depsSha256 = "sha256-UOEq6KFS4rh4eaKxnRcVOh4SQWn3hnfpzcyRqPnFvco=";
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
buildPhase = ''
sbt backend/assembly
'';
installPhase = ''
mkdir -p $out/bin
cp backend/target/scala-*/backend-assembly-*.jar $out/bin/
'';
};
}
);
# see https://serokell.io/blog/practical-nix-flakes