Skip to content

Commit 138cc0f

Browse files
authored
Merge pull request #54 from anispwyn/master
add flake.nix
2 parents 7d4b236 + 411d559 commit 138cc0f

File tree

2 files changed

+187
-0
lines changed

2 files changed

+187
-0
lines changed

flake.lock

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
inputs = {
3+
self.submodules = true;
4+
flakelight.url = "github:nix-community/flakelight";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
crane.url = "github:ipetkov/crane";
7+
8+
fenix = {
9+
url = "github:nix-community/fenix";
10+
inputs.nixpkgs.follows = "nixpkgs";
11+
};
12+
};
13+
14+
outputs = {
15+
flakelight,
16+
crane,
17+
fenix,
18+
...
19+
}:
20+
flakelight ./. {
21+
# make you able to access pkgs.fenix.complete.xyz
22+
withOverlays = [
23+
fenix.overlays.default
24+
];
25+
26+
packages.default = {pkgs, ...}: let
27+
craneLib = (crane.mkLib pkgs).overrideToolchain (
28+
p:
29+
p.fenix.complete.withComponents [
30+
"cargo"
31+
"clippy"
32+
"rust-src"
33+
"rustc"
34+
"rustfmt"
35+
]
36+
);
37+
in
38+
craneLib.buildPackage {
39+
pname = "repak-rivals"; # i added this so crane wont spam my fucking terminal
40+
doCheck = false; # disable tests
41+
src = ./.;
42+
nativeBuildInputs = with pkgs; [
43+
stdenv.cc.cc.lib
44+
makeWrapper
45+
];
46+
47+
buildInputs = [pkgs.stdenv.cc.cc.lib];
48+
49+
# banger postInstall right here
50+
postInstall = ''
51+
wrapProgram $out/bin/repak-gui \
52+
--prefix LD_LIBRARY_PATH : ${with pkgs; lib.makeLibraryPath [stdenv.cc.cc.lib libX11 libXcursor libXcursor libxi libxkbcommon mesa libGL]}
53+
'';
54+
};
55+
apps.default = packages: {
56+
type = "app";
57+
program = "${packages.default}/bin/repak-gui";
58+
};
59+
devShell.packages = {pkgs, ...}: [
60+
(pkgs.fenix.complete.withComponents [
61+
"cargo"
62+
"clippy"
63+
"rust-src"
64+
"rustc"
65+
"rustfmt"
66+
"rust-analyzer"
67+
])
68+
];
69+
};
70+
}

0 commit comments

Comments
 (0)