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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
# MeshMC Nix Packaging
## Installing a stable release (nixpkgs)
MeshMC is not packaged in [nixpkgs](https://github.com/NixOS/nixpkgs/).
## Installing a development release (flake)
We use [cachix](https://cachix.org/) to cache our development and release builds.
If you want to avoid rebuilds you may add the Cachix bucket to your substitutors, or use `--accept-flake-config`
to temporarily enable it when using `nix` commands.
Example (NixOS):
```nix
{
nix.settings = {
trusted-substituters = [ "https://meshmc.cachix.org" ];
trusted-public-keys = [
"meshmc.cachix.org-1:6ZNLcfqjVDKmN9/XNWGV3kcjBTL51v1v2V+cvanMkZA="
];
};
}
```
### Installing the package directly
After adding `github:Project-Tick/MeshMC` to your flake inputs, you can access the flake's `packages` output.
Example:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
meshmc = {
url = "github:Project-Tick/MeshMC";
# Optional: Override the nixpkgs input of meshmc to use the same revision as the rest of your flake
# Note that this may break the reproducibility mentioned above, and you might not be able to access the binary cache
#
# inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, meshmc, ... }:
{
nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
(
{ pkgs, ... }:
{
environment.systemPackages = [ meshmc.packages.${pkgs.system}.meshmc ];
}
)
];
};
};
}
```
### Using the overlay
Alternatively, if you don't want to use our `packages` output, you can add our overlay to your nixpkgs instance.
This will ensure MeshMC is built with your system's packages.
> [!WARNING]
> Depending on what revision of nixpkgs your system uses, this may result in binaries that differ from the above `packages` output
> If this is the case, you will not be able to use the binary cache
Example:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
meshmc = {
url = "github:Project-Tick/MeshMC";
# Optional: Override the nixpkgs input of meshmc to use the same revision as the rest of your flake
# Note that this may break the reproducibility mentioned above, and you might not be able to access the binary cache
#
# inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, meshmc, ... }:
{
nixosConfigurations.foo = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
(
{ pkgs, ... }:
{
nixpkgs.overlays = [ meshmc.overlays.default ];
environment.systemPackages = [ pkgs.meshmc ];
}
)
];
};
};
}
```
### Installing the package ad-hoc (`nix shell`, `nix run`, etc.)
You can simply call the default package of this flake.
Example:
```shell
nix run github:Project-Tick/MeshMC
nix shell github:Project-Tick/MeshMC
nix profile install github:Project-Tick/MeshMC
```
## Installing a development release (without flakes)
We use [Cachix](https://cachix.org/) to cache our development and release builds.
If you want to avoid rebuilds you may add the Cachix bucket to your substitutors.
Example (NixOS):
```nix
{
nix.settings = {
trusted-substituters = [ "https://meshmc.cachix.org" ];
trusted-public-keys = [
"meshmc.cachix.org-1:6ZNLcfqjVDKmN9/XNWGV3kcjBTL51v1v2V+cvanMkZA="
];
};
}
```
### Installing the package directly (`fetchTarball`)
We use flake-compat to allow using this Flake on a system that doesn't use flakes.
Example:
```nix
{ pkgs, ... }:
{
environment.systemPackages = [
(import (
builtins.fetchTarball "https://github.com/Project-Tick/MeshMC/archive/master.tar.gz"
)).packages.${pkgs.system}.meshmc
];
}
```
### Using the overlay (`fetchTarball`)
Alternatively, if you don't want to use our `packages` output, you can add our overlay to your instance of nixpkgs.
This results in MeshMC using your system's libraries
Example:
```nix
{ pkgs, ... }:
{
nixpkgs.overlays = [
(import (
builtins.fetchTarball "https://github.com/Project-Tick/MeshMC/archive/master.tar.gz"
)).overlays.default
];
environment.systemPackages = [ pkgs.meshmc ];
}
```
### Installing the package ad-hoc (`nix-env`)
You can add this repository as a channel and install its packages that way.
Example:
```shell
nix-channel --add https://github.com/Project-Tick/MeshMC/archive/master.tar.gz meshmc
nix-channel --update meshmc
nix-env -iA meshmc.meshmc
```
## Package variants
Both Nixpkgs and this repository offer the following packages:
- `meshmc` - The preferred build, wrapped with everything necessary to run the launcher and Minecraft
- `meshmc-unwrapped` - A minimal build that allows for advanced customization of the launcher's runtime environment
### Customizing wrapped packages
The wrapped package (`meshmc`) offers some build parameters to further customize the launcher's environment.
The following parameters can be overridden:
- `additionalLibs` (default: `[ ]`) Additional libraries that will be added to `LD_LIBRARY_PATH`
- `additionalPrograms` (default: `[ ]`) Additional libraries that will be added to `PATH`
- `controllerSupport` (default: `isLinux`) Turn on/off support for controllers on Linux (macOS will always have this)
- `gamemodeSupport` (default: `isLinux`) Turn on/off support for [Feral GameMode](https://github.com/FeralInteractive/gamemode) on Linux
- `jdks` (default: `[ jdk21 jdk17 jdk8 ]`) Java runtimes added to `MESHMC_JAVA_PATHS` variable
- `msaClientID` (default: `null`, requires full rebuild!) Client ID used for Microsoft Authentication
- `textToSpeechSupport` (default: `isLinux`) Turn on/off support for text-to-speech on Linux (macOS will always have this)
|