initial backend nix build - get jar
This commit is contained in:
27
flake.nix
27
flake.nix
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user