-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
57 lines (55 loc) · 1.52 KB
/
flake.nix
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
{
description = "A graphical satellite tracking software for linux";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-24.05;
flake-utils.url = github:numtide/flake-utils;
};
outputs = {self, nixpkgs, flake-utils, ...}@inputs: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
arftracksat = (with pkgs; stdenv.mkDerivation {
name = "arftracksat";
src = ./.;
nativeBuildInputs = [
cmake
mesa
curl
curlpp
nlohmann_json
freeglut
libGL
mesa_glu
glm
tree
];
# Patch share location
postUnpack = ''
path=${placeholder "out"}
sed -i "s,/usr/local,$path," *-source/src/main.cpp
sed -i "s,/usr/local,$path," *-source/config.json
'';
buildPhase = "make -j $NIX_BUILD_CORES";
installPhase = ''
mkdir -p $out/bin $out/etc/arftracksat $out/share/arftracksat
mv arftracksat $out/bin
cd ..
mv config.json $out/etc/arftracksat/config.json
mv assets/earth.png assets/map.json $out/share/arftracksat
'';
}
);
in rec {
defaultApp = flake-utils.lib.mkApp {
drv = defaultPackage;
};
defaultPackage = arftracksat;
devShell = pkgs.mkShell {
buildInputs = [
arftracksat
];
};
}
);
}