forked from dfgHiatus/VRCFaceTracking.Avalonia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
107 lines (95 loc) · 3.65 KB
/
flake.nix
File metadata and controls
107 lines (95 loc) · 3.65 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
{
# All these inputs need to be kept in sync with the local submodules!!!!!!!!!
inputs = {
vrcft = {
flake = false;
url = "github:dfgHiatus/VRCFaceTracking/13d051a24743717c5eb9b14b39f149fe82bc1073";
};
hyperText = {
flake = false;
url = "github:dfgHiatus/HyperText.Avalonia/8c511c818c8936eb575e6fad224279746cd102da";
};
desktopNotifications = {
flake = false;
url = "github:dfgHiatus/DesktopNotifications/e69ae5bdc3144d47bfdbf47c962954406aeb0c92";
};
};
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
# Dependency downloads are currently broken, if anyone can get it working, feel free to make a PR
nixConfig = {
sandbox = false;
};
outputs = { self, nixpkgs, vrcft, desktopNotifications, hyperText, ... }: let
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: import nixpkgs {
inherit system;
};
in {
packages = forAllSystems (system: let
pkgs = pkgsFor system;
dotnet = pkgs.dotnetCorePackages.dotnet_8;
in {
default = pkgs.buildDotnetModule rec {
version = "1.1.0.0";
pname = "vrchatfacetracking";
buildInputs = with pkgs; [
pkg-config fontconfig
openssl icu krb5
xorg.libX11 xorg.libSM xorg.libICE
(pkgs.callPackage ./nix/simpleosc.nix {})
];
runtimeDependencies = with pkgs; [
vulkan-loader
(pkgs.callPackage ./nix/simpleosc.nix {})
];
nativeBuildInputs = with pkgs; [ autoPatchelfHook ];
src = ./.;
postUnpack = ''
cp -r ${vrcft} $sourceRoot/src/VRCFaceTracking
cp -r ${hyperText} $sourceRoot/src/HyperText.Avalonia
cp -r ${desktopNotifications} $sourceRoot/src/DesktopNotifications
# Fix permissions cause nix is dumb and doesnt set them correctly
find $sourceRoot/src -type d -exec chmod 755 {} \;
find $sourceRoot/src -type f -exec chmod 644 {} \;
'';
postFixup = ''
mv $out/bin/VRCFaceTracking.Avalonia.Desktop $out/bin/vrchatfacetracking
wrapProgram $out/bin/vrchatfacetracking --set LD_LIBRARY_PATH ${nixpkgs.lib.makeLibraryPath runtimeDependencies}
'';
dotnetSdk = dotnet.sdk;
# Nuget deps is borked :/
nugetDeps = ./nix/deps.json;
dotnetRuntime = dotnet.runtime;
dotnetInstallFlags = ["--framework net8.0"];
executables = ["VRCFaceTracking.Avalonia.Desktop"];
projectFile = "src/VRCFaceTracking.Avalonia.Desktop/VRCFaceTracking.Avalonia.Desktop.csproj";
meta = with pkgs.lib; {
license = licenses.asl20;
platforms = platforms.linux;
mainProgram = "vrchatfacetracking";
homepage = "https://github.com/dfgHiatus/VRCFaceTracking.Avalonia";
description = "A cross-platform VRCFaceTracking GUI made with Avalonia";
};
};
});
devShells = forAllSystems (system: let
pkgs = pkgsFor system;
dotnet_sdk = pkgs.dotnet-sdk_8;
in {
default = pkgs.mkShell rec {
buildInputs = with pkgs; [
dotnet_sdk fontconfig icu
xorg.libX11 xorg.libSM xorg.libICE
(pkgs.callPackage ./nix/simpleosc.nix {})
];
shellHook = ''
export DOTNET_ROOT="${dotnet_sdk}"
# Fucks knows why dotnet looks in PATH instead of LD_LIBRARY_PATH
export PATH="$PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
'';
};
});
};
}