blob: 5223b582e5eca11c30a9315e50aa181c04cf1058 (
plain)
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
|
# Nix Packaging `nix/`
> **Location**: `nix/`, `flake.nix`, `shell.nix`, `default.nix`
> **Platform**: NixOS, Nix package manager
> **Purpose**: Reproducible builds and packaging
> **Latest Version**: 0.0.5-1
---
## Overview
ProjT Launcher provides first-class Nix support for reproducible builds, development environments, and packaging. Both Flakes and traditional Nix expressions are supported.
---
## Quick Start
### Run Without Installing
```bash
nix run github:Project-Tick/ProjT-Launcher
```
### Install via Flakes
```bash
nix profile install github:Project-Tick/ProjT-Launcher
```
### Development Shell
```bash
# With Flakes
nix develop github:Project-Tick/ProjT-Launcher
# Traditional
nix-shell
```
---
## Binary Cache
We use Cachix for pre-built binaries. Add to avoid rebuilds:
<!-- ### NixOS Configuration
```nix
{
nix.settings = {
trusted-substituters = [ "https://cache.projecttick.org" ];
trusted-public-keys = [
"cache.projecttick.org-1:HrpR1buYLhqx0ooS1rMgyHChoYf+faZm82hsIY6JS+s="
];
};
}
``` -->
### Flakes (Temporary)
```bash
nix run github:Project-Tick/ProjT-Launcher --accept-flake-config
```
---
## Installation Methods
### Flakes (Recommended)
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
projtlauncher.url = "github:Project-Tick/ProjT-Launcher";
};
outputs = { nixpkgs, projtlauncher, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
modules = [
({ pkgs, ... }: {
environment.systemPackages = [
projtlauncher.packages.${pkgs.system}.projtlauncher
];
})
];
};
};
}
```
### Using Overlay
```nix
{
nixpkgs.overlays = [ projtlauncher.overlays.default ];
environment.systemPackages = [ pkgs.projtlauncher ];
}
```
### Traditional Nix (No Flakes)
```nix
{ pkgs, ... }:
{
environment.systemPackages = [
(import (builtins.fetchTarball
"https://github.com/Project-Tick/ProjT-Launcher/archive/develop.tar.gz"
)).packages.${pkgs.system}.projtlauncher
];
}
```
---
## Package Variants
| Package | Description |
|---------|-------------|
| `projtlauncher` | Fully wrapped with runtime dependencies |
| `projtlauncher-unwrapped` | Minimal build for customization |
### Customization Options
The wrapped package accepts these overrides:
| Option | Default | Description |
|--------|---------|-------------|
| `additionalLibs` | `[]` | Extra `LD_LIBRARY_PATH` entries |
| `additionalPrograms` | `[]` | Extra `PATH` entries |
| `controllerSupport` | `isLinux` | Game controller support |
| `gamemodeSupport` | `isLinux` | Feral GameMode integration |
| `jdks` | `[jdk21 jdk17 jdk8]` | Available Java runtimes |
| `msaClientID` | `null` | Microsoft Auth client ID |
| `textToSpeechSupport` | `isLinux` | TTS support |
### Example Override
```nix
projtlauncher.override {
jdks = [ pkgs.jdk21 pkgs.jdk17 ];
gamemodeSupport = false;
}
```
---
## Development
### Enter Development Shell
```bash
nix develop
# or
nix-shell
```
### Build Locally
```bash
nix build .#projtlauncher
./result/bin/projtlauncher
```
---
## File Structure
```
├── flake.nix # Flake definition
├── flake.lock # Locked dependencies
├── default.nix # Flake-compat entry
├── shell.nix # Development shell
└── nix/
├── default.nix # Package derivation
└── ...
```
---
## Troubleshooting
### Binary Cache Not Working
Ensure the cache is in `trusted-substituters` (requires root):
```bash
sudo nix-channel --update
```
### Build Failures
Try with fresh nixpkgs:
```bash
nix build --override-input nixpkgs github:NixOS/nixpkgs/nixos-unstable
```
---
## Related Documentation
- [CI Support](./ci_support.md) — CI Nix integration
- [CI Evaluation](./ptcieval.md) — Nix-based validation
---
## External Links
- [Nix Manual](https://nixos.org/manual/nix/stable/)
- [NixOS Wiki: ProjT Launcher](https://wiki.nixos.org/wiki/ProjT_Launcher)
- [Cachix](https://cachix.org/)
|