Skip to content

Commit bdfc99e

Browse files
authored
Merge pull request #55 from anispwyn/master
fix flake for real this time
2 parents fab35a6 + f1df3ab commit bdfc99e

File tree

1 file changed

+44
-42
lines changed

1 file changed

+44
-42
lines changed

flake.nix

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,66 @@
1919
};
2020
};
2121

22-
outputs =
23-
{
24-
flakelight,
25-
crane,
26-
fenix,
27-
self,
28-
uasset-mesh-patch-rivals,
29-
retoc-rivals,
30-
...
31-
}:
22+
outputs = {
23+
flakelight,
24+
crane,
25+
fenix,
26+
self,
27+
uasset-mesh-patch-rivals,
28+
retoc-rivals,
29+
...
30+
}:
3231
flakelight ./. {
3332
# make you able to access pkgs.fenix.complete.xyz
3433
withOverlays = [
3534
fenix.overlays.default
3635
];
3736

38-
packages.default =
39-
{ pkgs, ... }:
40-
let
41-
craneLib = (crane.mkLib pkgs).overrideToolchain (
42-
p:
37+
packages.default = {pkgs, ...}: let
38+
craneLib = (crane.mkLib pkgs).overrideToolchain (
39+
p:
4340
p.fenix.complete.withComponents [
4441
"cargo"
4542
"clippy"
4643
"rust-src"
4744
"rustc"
4845
"rustfmt"
4946
]
50-
);
51-
src = pkgs.runCommand "source-with-submodules" { } ''
52-
53-
cp -r ${self} $out
54-
chmod -R u+w $out
55-
cp -r ${retoc-rivals} $out/retoc-rivals
56-
cp -r ${uasset-mesh-patch-rivals} $out/uasset-mesh-patch-rivals
57-
chmod -R u+w $out/retoc-rivals $out/uasset-mesh-patch-rivals
58-
59-
'';
60-
in
47+
);
48+
# 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
49+
src = pkgs.runCommand "source-with-submodules" {} ''
50+
mkdir -p $out
51+
cp -r ${self}/. $out/
52+
chmod -R u+w $out
53+
mkdir -p $out/retoc-rivals
54+
mkdir -p $out/uasset-mesh-patch-rivals
55+
cp -r ${retoc-rivals}/. $out/retoc-rivals/
56+
cp -r ${uasset-mesh-patch-rivals}/. $out/uasset-mesh-patch-rivals/
57+
'';
58+
# i am tired to build dependencies so i added this
59+
cargoArtifacts = craneLib.buildDepsOnly {
60+
inherit src;
61+
pname = "repak-rivals";
62+
doCheck = false;
63+
};
64+
in
6165
craneLib.buildPackage {
6266
pname = "repak-rivals"; # i added this so crane wont spam my fucking terminal
6367
doCheck = false; # disable tests
6468

65-
inherit src;
69+
inherit src cargoArtifacts;
6670
nativeBuildInputs = with pkgs; [
6771
stdenv.cc.cc.lib
6872
makeWrapper
6973
];
7074

71-
buildInputs = [ pkgs.stdenv.cc.cc.lib ];
75+
buildInputs = [pkgs.stdenv.cc.cc.lib];
7276

7377
# banger postInstall right here
7478
postInstall = ''
7579
wrapProgram $out/bin/repak-gui \
7680
--prefix LD_LIBRARY_PATH : ${
77-
with pkgs;
81+
with pkgs;
7882
lib.makeLibraryPath [
7983
stdenv.cc.cc.lib
8084
libX11
@@ -85,24 +89,22 @@
8589
mesa
8690
libGL
8791
]
88-
}
92+
}
8993
'';
9094
};
9195
apps.default = packages: {
9296
type = "app";
9397
program = "${packages.default}/bin/repak-gui";
9498
};
95-
devShell.packages =
96-
{ pkgs, ... }:
97-
[
98-
(pkgs.fenix.complete.withComponents [
99-
"cargo"
100-
"clippy"
101-
"rust-src"
102-
"rustc"
103-
"rustfmt"
104-
"rust-analyzer"
105-
])
106-
];
99+
devShell.packages = {pkgs, ...}: [
100+
(pkgs.fenix.complete.withComponents [
101+
"cargo"
102+
"clippy"
103+
"rust-src"
104+
"rustc"
105+
"rustfmt"
106+
"rust-analyzer"
107+
])
108+
];
107109
};
108110
}

0 commit comments

Comments
 (0)