Skip to content

Commit e75c38d

Browse files
committed
Nix build
1 parent 1446b71 commit e75c38d

File tree

6 files changed

+111
-5
lines changed

6 files changed

+111
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ front/build/
1313
# Local Netlify folder
1414
.netlify
1515
.smithy.lsp.log
16+
result

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ val app = crossProject(JVMPlatform, NativePlatform)
157157
.nativeConfigure(
158158
_.settings(
159159
libraryDependencies ++= Seq(
160-
"com.armanbilge" %%% "epollcat" % "0.1.1"
160+
"com.armanbilge" %%% "epollcat" % "0.1.6"
161161
)
162162
)
163163
)

derivation.nix

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{ mkSbtDerivation, gitignore-source, which, clang, s2n-tls }:
2+
3+
let pname = "spotify-next"; in
4+
5+
mkSbtDerivation {
6+
inherit pname;
7+
version = "0.1.0";
8+
depsSha256 = "sha256-nPDkvJR87D1iiXIpivZCEB+yx4pE04PtjFd8rcNH54Q=";
9+
10+
buildInputs = [ which clang ];
11+
nativeBuildInputs = [ s2n-tls ];
12+
depsWarmupCommand = ''
13+
sbt compile
14+
'';
15+
16+
src = gitignore-source.lib.gitignoreSource ./.;
17+
18+
buildPhase = ''
19+
sbt nativeLink
20+
'';
21+
22+
installPhase = ''
23+
mkdir -p $out/bin
24+
cp app/.native/target/scala-3.3.1/spotify-next-out $out/bin/$pname
25+
'';
26+
}

flake.lock

+73-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{
22
inputs.nixpkgs.url = "github:nixos/nixpkgs";
33
inputs.flake-utils.url = "github:numtide/flake-utils";
4+
inputs.sbt-derivation.url = "github:zaninime/sbt-derivation";
5+
inputs.gitignore-source.url = "github:hercules-ci/gitignore.nix";
6+
inputs.gitignore-source.inputs.nixpkgs.follows = "nixpkgs";
47

5-
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
8+
outputs = { self, nixpkgs, flake-utils, sbt-derivation, ... }@inputs:
69
flake-utils.lib.eachDefaultSystem (
710
system:
811
let
9-
pkgs = import nixpkgs { inherit system; };
12+
pkgs = import nixpkgs {
13+
inherit system;
14+
overlays = [ sbt-derivation.overlays.default ];
15+
};
1016
in
1117
{
1218
devShells.default = pkgs.mkShell {
1319
nativeBuildInputs = [ pkgs.s2n-tls ];
1420
};
21+
packages.default = pkgs.callPackage ./derivation.nix { inherit (inputs) gitignore-source; };
1522
}
1623
);
1724
}

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
66
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
77

88
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.2")
9-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15")
9+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16")
1010
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
1111

1212
addDependencyTreePlugin

0 commit comments

Comments
 (0)