-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
85 lines (82 loc) · 2.22 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "scalatromino";
inputs = {
flake-utils.follows = "typelevel-nix/flake-utils";
nixpkgs.follows = "typelevel-nix/nixpkgs";
sbt = {
url = "github:zaninime/sbt-derivation/master";
inputs.nixpkgs.follows = "typelevel-nix/nixpkgs";
};
typelevel-nix.url = "github:typelevel/typelevel-nix";
};
outputs = {
self,
flake-utils,
nixpkgs,
sbt,
typelevel-nix
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ typelevel-nix.overlays.default ];
};
buildTools = with pkgs; [
pkg-config
which
glib.dev
];
libraries = with pkgs; [
boehmgc
cairo
gdk-pixbuf
graphene
harfbuzz
libunwind
glib
gtk4
pango
vulkan-headers
vulkan-loader
zlib
];
in
rec {
packages = {
default = (sbt.mkSbtDerivation.${system}).withOverrides({ stdenv = pkgs.llvmPackages.stdenv; }) {
pname = "scalatromino";
version = "0.3.0";
src = self;
depsSha256 = "sha256-7IkywdOhiKMPU0bDBTVCf/SoxtApT5maR1fCAwNmSYE=";
buildPhase = ''
sbt 'show compile'
'';
depsWarmupCommand = ''
sbt '+Test/updateFull ; +Test/compileIncSetup'
'';
installPhase = ''
sbt 'show stage'
mkdir -p $out/bin
cp target/scalatromino $out/bin/
'';
buildInputs = libraries;
nativeBuildInputs = buildTools;
hardeningDisable = [ "fortify" ];
};
};
devShell = pkgs.devshell.mkShell {
imports = [ typelevel-nix.typelevelShell "${pkgs.devshell.extraModulesDir}/language/c.nix"];
name = "scalatromino-devshell";
typelevelShell = {
jdk.package = pkgs.jdk21;
native.enable = true;
};
packagesFrom = [ packages.default ];
language.c = {
inherit libraries;
includes = libraries;
};
};
});
}