-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
90 lines (84 loc) · 2.69 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
86
87
88
89
90
{
description = "A simple default stardust setup";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
server = {
url = "github:StardustXR/server/dev";
inputs.nixpkgs.follows = "nixpkgs";
};
flatland = {
url = "github:StardustXR/flatland/dev";
inputs.nixpkgs.follows = "nixpkgs";
};
protostar = {
url = "github:StardustXR/protostar/dev";
inputs.nixpkgs.follows = "nixpkgs";
};
gravity = {
url = "github:StardustXR/gravity/dev";
inputs.nixpkgs.follows = "nixpkgs";
};
black_hole = {
url = "github:StardustXR/black-hole";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [];
systems = [ "aarch64-linux" "x86_64-linux" "riscv64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
{
# edit these to add/remove clients
packages.startup_script = pkgs.writeShellApplication {
name = "startup_script";
runtimeInputs = [
inputs'.flatland.packages.default
inputs'.protostar.packages.default
inputs'.gravity.packages.default
inputs'.black_hole.packages.default
pkgs.xwayland-satellite
];
## and this is the startup script
text = ''
unset LD_LIBRARY_PATH
if [[ -v LD_LIBRARY_PATH_ORIGINAL ]]; then
echo "Restored pre-exisiting LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH_ORIGINAL"
fi
xwayland-satellite :10 &
export DISPLAY=:10 &
sleep 0.1;
flatland &
gravity -- 0 0.0 -0.5 hexagon_launcher &
black-hole &
'';
};
packages.flatscreen = pkgs.writeShellApplication {
name = "flatscreen";
runtimeInputs = [ self'.packages.telescope ];
text = ''telescope -f'';
};
packages.telescope = pkgs.writeShellApplication {
name = "telescope";
runtimeInputs = [
inputs'.server.packages.default
];
text = ''
stardust-xr-server -d -o 1 -e "${self'.packages.startup_script}/bin/startup_script" "$@"
'';
};
packages.default = self'.packages.telescope;
apps.flatscreen = {
type = "app";
program = "${self'.packages.flatscreen}/bin/flatscreen";
};
apps.telescope = {
type = "app";
program = "${self'.packages.telescope}/bin/telescope";
};
apps.default = self'.apps.telescope;
};
flake = {};
};
}