|
19 | 19 | }; |
20 | 20 | }; |
21 | 21 |
|
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 | + }: |
32 | 31 | flakelight ./. { |
33 | 32 | # make you able to access pkgs.fenix.complete.xyz |
34 | 33 | withOverlays = [ |
35 | 34 | fenix.overlays.default |
36 | 35 | ]; |
37 | 36 |
|
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: |
43 | 40 | p.fenix.complete.withComponents [ |
44 | 41 | "cargo" |
45 | 42 | "clippy" |
46 | 43 | "rust-src" |
47 | 44 | "rustc" |
48 | 45 | "rustfmt" |
49 | 46 | ] |
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 |
61 | 65 | craneLib.buildPackage { |
62 | 66 | pname = "repak-rivals"; # i added this so crane wont spam my fucking terminal |
63 | 67 | doCheck = false; # disable tests |
64 | 68 |
|
65 | | - inherit src; |
| 69 | + inherit src cargoArtifacts; |
66 | 70 | nativeBuildInputs = with pkgs; [ |
67 | 71 | stdenv.cc.cc.lib |
68 | 72 | makeWrapper |
69 | 73 | ]; |
70 | 74 |
|
71 | | - buildInputs = [ pkgs.stdenv.cc.cc.lib ]; |
| 75 | + buildInputs = [pkgs.stdenv.cc.cc.lib]; |
72 | 76 |
|
73 | 77 | # banger postInstall right here |
74 | 78 | postInstall = '' |
75 | 79 | wrapProgram $out/bin/repak-gui \ |
76 | 80 | --prefix LD_LIBRARY_PATH : ${ |
77 | | - with pkgs; |
| 81 | + with pkgs; |
78 | 82 | lib.makeLibraryPath [ |
79 | 83 | stdenv.cc.cc.lib |
80 | 84 | libX11 |
|
85 | 89 | mesa |
86 | 90 | libGL |
87 | 91 | ] |
88 | | - } |
| 92 | + } |
89 | 93 | ''; |
90 | 94 | }; |
91 | 95 | apps.default = packages: { |
92 | 96 | type = "app"; |
93 | 97 | program = "${packages.default}/bin/repak-gui"; |
94 | 98 | }; |
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 | + ]; |
107 | 109 | }; |
108 | 110 | } |
0 commit comments