-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (81 loc) · 2.61 KB
/
Copy pathflake.nix
File metadata and controls
88 lines (81 loc) · 2.61 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
{
description = "An FTL: Faster Than Light mod manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, fenix, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (fenix.packages.${system}.latest) toolchain;
pkgs = nixpkgs.legacyPackages.${system};
libs = with pkgs; with pkgs.xorg; [
libGL
libGLU
libxcb
libXcursor
libXrandr
libXi
libxkbcommon
gtk3
atk
bzip2
fontconfig
openssl
wayland
];
libraryPath = "/run/opengl-driver/lib:${pkgs.lib.makeLibraryPath libs}";
in
{
packages =
rec {
unwrapped = (pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
}).buildRustPackage {
pname = "ftlman-unwrapped";
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = libs ++ (with pkgs; [
wayland
xorg.libX11
]);
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"ecolor-0.33.0" = "sha256-QiaD3bV6EWnWK3j8B5+lNcOEkXMkgtF0JjDALu0gOpw=";
"zip-2.6.1" = "sha256-mZ6Pm9W32AF9w4kQuhhfnB+i2PH9nLtc91TQro9ggy8=";
};
};
};
# the extra parens prevent the formatter from putting the attrset on a new line
default = (pkgs.runCommand "ftlman" {
pname = "ftlman";
inherit (unwrapped) version;
nativeBuildInputs = [ pkgs.makeWrapper ];
}) ''
makeWrapper ${unwrapped}/bin/ftlman $out/bin/ftlman --suffix LD_LIBRARY_PATH : ${libraryPath}
'';
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
# For llvm-strip as rust-objcopy seems to fail in apple cross containers
llvmPackages_latest.bintools
# for compare_with_slipstream
difftastic
];
buildInputs = libs;
shellHook = ''
export LD_LIBRARY_PATH=${libraryPath}
'';
};
});
}