Skip to content

Commit

Permalink
Add nix flake build script (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
h1sk1 committed Jul 19, 2024
1 parent 757273c commit 058a7d7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
description = "A Scala project with SBT";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
sbt = pkgs.sbt;
jdk = pkgs.jdk21;
scala = pkgs.scala;
in {
devShell = pkgs.mkShell {
buildInputs = [ sbt jdk scala ];
shellHook = ''
echo "SBT and Scala environment ready!"
'';
};

packages.default = pkgs.stdenv.mkDerivation {
name = "flake-vsys-build-with-sbt";
src = ./.;
buildInputs = [ sbt jdk scala ];
buildPhase = ''
echo "Building with SBT..."
sed -i 's/scalaVersion in ThisBuild := "2.12.6"/scalaVersion in ThisBuild := "2.12.18"/' build.sbt
sed -i 's/sbt.version=1.1.1/sbt.version=1.9.9/' project/build.properties
export HOME=~
sbt packageAll
'';
installPhase = ''
mkdir -p $out
cp -r target $out
'';
};
}
);
}

1 comment on commit 058a7d7

@fukvsys
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

垃圾,畜生,诈骗狗,开发你麻痹 死链!
没有用户,没有交易,没应用,没社区,狗杂种!
vsystems is the most shameless and rubbish scam dog in the entire network.
930,000 new vsys scam coins are issued, and only 30 vsys are destroyed every day.
vsys has no applications, no users, and dead chain with no on-chain transactions!

Please sign in to comment.