forked from FreesmTeam/FreesmLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
134 lines (114 loc) · 3.2 KB
/
Copy pathflake.nix
File metadata and controls
134 lines (114 loc) · 3.2 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
description = "Prism Launcher fork aimed to provide a free way to play Minecraft.";
nixConfig = {
substituters = [
"https://cache.nixos.org"
"https://cache.garnix.io"
"https://freesmlauncher.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"freesmlauncher.cachix.org-1:Jcp5Q9wiLL+EDv8Mh7c6L9xGk+lXr7/otpKxMOuBuDs="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-filter.url = "github:numtide/nix-filter";
libnbtplusplus = {
url = "github:FreesmTeam/libnbtplusplus";
flake = false;
};
};
outputs = {
self,
nixpkgs,
nix-filter,
libnbtplusplus,
...
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSystem = nixpkgs.lib.genAttrs systems;
mkJvmPack = pkgs: let
openjdk = with pkgs; [
openjdk8
openjdk17
openjdk21
openjdk25
];
temurin = with pkgs.javaPackages.compiler.temurin-bin; [
jdk-8
jdk-17
jdk-21
jdk-25
];
corretto = with pkgs.javaPackages.compiler; [
corretto17
corretto21
corretto25
];
graal-ce = with pkgs.graalvmPackages; [
graalvm-ce
];
graal-unfree = with pkgs.graalvmPackages; [
graalvm-oracle_17
graalvm-oracle_25
];
in {
inherit openjdk temurin corretto graal-ce graal-unfree;
allPack = openjdk ++ temurin ++ corretto ++ graal-ce ++ graal-unfree;
};
in {
overlays.default = final: prev: {
freesmlauncher-unwrapped = final.callPackage ./nix/unwrapped.nix {
inherit nix-filter libnbtplusplus self;
};
freesmlauncher = final.callPackage ./nix/wrapper.nix {
jvmPack = mkJvmPack final;
};
};
packages = forEachSystem (system: let
pkgs = import nixpkgs {inherit system;};
jvmPack = mkJvmPack pkgs;
freesmlauncher-unwrapped = pkgs.callPackage ./nix/unwrapped.nix {
inherit nix-filter libnbtplusplus self;
};
freesmlauncher = pkgs.callPackage ./nix/wrapper.nix {
inherit freesmlauncher-unwrapped jvmPack;
};
freesmlauncher-unwrapped-debug = freesmlauncher-unwrapped.overrideAttrs {
cmakeBuildType = "Debug";
dontStrip = true;
};
freesmlauncher-debug = pkgs.callPackage ./nix/wrapper.nix {
freesmlauncher-unwrapped = freesmlauncher-unwrapped-debug;
};
in {
inherit freesmlauncher freesmlauncher-unwrapped freesmlauncher-debug freesmlauncher-unwrapped-debug jvmPack;
default = freesmlauncher;
});
devShells = forEachSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [self.overlays.default];
};
in {
default = pkgs.mkShell {
inputsFrom = [pkgs.freesmlauncher-unwrapped];
packages = with pkgs; [
ccache
ninja
];
};
});
formatter = forEachSystem (
system:
(import nixpkgs {inherit system;}).alejandra
);
};
}