-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (50 loc) · 1.54 KB
/
flake.nix
File metadata and controls
56 lines (50 loc) · 1.54 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
{
description = "F3 - Fight flash fraud";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }: {
packages = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
f3 = pkgs.stdenv.mkDerivation {
pname = "f3";
version = builtins.head (builtins.match ''.*#define[[:space:]]+F3_STR_VERSION[[:space:]]+"([0-9.]+)".*'' (builtins.readFile (self + "/src/version.h")));
src = ./.;
nativeBuildInputs = [ pkgs.clang ];
buildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.systemd
pkgs.parted
]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ pkgs.argp-standalone ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
make install PREFIX=$out
make install-extra PREFIX=$out
runHook postInstall
'';
meta = with pkgs.lib; {
description = "F3 - Fight flash fraud";
license = licenses.gpl3;
maintainers = [ maintainers.llamato ];
platforms = platforms.unix;
};
};
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
cmake
gcc
gdb
];
};
});
defaultPackage = {
x86_64-linux = self.packages.x86_64-linux.f3;
aarch64-linux = self.packages.aarch64-linux.f3;
aarch64-darwin = self.packages.aarch64-darwin.f3;
};
};
}