Skip to content

Commit

Permalink
Merge pull request #37 from mabster314/master
Browse files Browse the repository at this point in the history
Add nix flake
  • Loading branch information
arf20 authored Aug 22, 2023
2 parents ce74ae6 + 970b5ee commit 3868916
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
description = "A graphical satellite tracking software for linux";

inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
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
];
};
}
);
}

0 comments on commit 3868916

Please sign in to comment.