-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
110 lines (103 loc) · 2.94 KB
/
flake.nix
File metadata and controls
110 lines (103 loc) · 2.94 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
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
retoc-rivals = {
url = "github:natimerry/retoc-rivals/c5b00c2";
flake = false;
};
uasset-mesh-patch-rivals = {
url = "github:natimerry/uasset-mesh-patch-rivals/a9e9f33";
flake = false;
};
};
outputs = {
flakelight,
crane,
fenix,
self,
uasset-mesh-patch-rivals,
retoc-rivals,
...
}:
flakelight ./. {
# make you able to access pkgs.fenix.complete.xyz
withOverlays = [
fenix.overlays.default
];
packages.default = {pkgs, ...}: let
craneLib = (crane.mkLib pkgs).overrideToolchain (
p:
p.fenix.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
]
);
# instead of making $out become $self, i just make a folder and then put the $self content into $out, seems to fix it... idk how
src = pkgs.runCommand "source-with-submodules" {} ''
mkdir -p $out
cp -r ${self}/. $out/
chmod -R u+w $out
mkdir -p $out/retoc-rivals
mkdir -p $out/uasset-mesh-patch-rivals
cp -r ${retoc-rivals}/. $out/retoc-rivals/
cp -r ${uasset-mesh-patch-rivals}/. $out/uasset-mesh-patch-rivals/
'';
# i am tired to build dependencies so i added this
cargoArtifacts = craneLib.buildDepsOnly {
inherit src;
pname = "repak-rivals";
doCheck = false;
};
in
craneLib.buildPackage {
pname = "repak-rivals"; # i added this so crane wont spam my fucking terminal
doCheck = false; # disable tests
inherit src cargoArtifacts;
nativeBuildInputs = with pkgs; [
stdenv.cc.cc.lib
makeWrapper
];
buildInputs = [pkgs.stdenv.cc.cc.lib];
# banger postInstall right here
postInstall = ''
wrapProgram $out/bin/repak-gui \
--prefix LD_LIBRARY_PATH : ${
with pkgs;
lib.makeLibraryPath [
stdenv.cc.cc.lib
libX11
libXcursor
libXcursor
libxi
libxkbcommon
mesa
libGL
]
}
'';
};
apps.default = packages: {
type = "app";
program = "${packages.default}/bin/repak-gui";
};
devShell.packages = {pkgs, ...}: [
(pkgs.fenix.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
])
];
};
}