summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix14
-rw-r--r--pkgs/galmon.nix47
-rw-r--r--pkgs/overlay.nix6
3 files changed, 65 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 6755c27..989c4cb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -43,12 +43,17 @@
freiraum.flake = false;
};
- outputs = { self, nixpkgs, deploy-rs, ... }@inputs:
+ outputs = { self, deploy-rs, ... }@inputs:
let
+ nixpkgs = import inputs.nixpkgs {
+ system = "x86_64-linux";
+ overlays = [ self.overlays.default ];
+ };
mkConfig = imports: config:
- nixpkgs.lib.nixosSystem rec {
+ inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [ config ] ++ imports;
+ pkgs = nixpkgs;
specialArgs = { inherit inputs system; };
};
@@ -104,5 +109,10 @@
home = self.homeConfigurations.stuebinm.activationPackage;
home-minimal = self.homeConfigurations.stuebinm-minimal.activationPackage;
+
+ overlays.default = import ./pkgs/overlay.nix;
+ packages.x86_64-linux = {
+ inherit (nixpkgs) galmon-core galmon-full;
+ };
};
}
diff --git a/pkgs/galmon.nix b/pkgs/galmon.nix
new file mode 100644
index 0000000..7af18da
--- /dev/null
+++ b/pkgs/galmon.nix
@@ -0,0 +1,47 @@
+{ buildAll ? false }:
+
+{ protobuf
+, pkg-config
+, h2o
+, openssl
+, eigen
+, ncurses5
+, zstd
+, zlib
+, curl
+, gitMinimal
+, stdenv
+, fetchFromGitHub
+, lib
+}:
+
+let
+ core = "ubxtool rtcmtool navrecv navnexus navparse";
+ noncore = if buildAll then "navdump navcat reporter rinreport galmonmon navdisplay" else "";
+in
+stdenv.mkDerivation {
+ pname = "galmon";
+ version = "git-master";
+
+ src = fetchFromGitHub {
+ owner = "berthubert";
+ repo = "galmon";
+ rev = "refs/heads/master";
+ sha256 = "sha256-QDluII9Ry3smMup5yOkAQZi35Phdf8m3fsQLDT8JFGc=";
+ fetchSubmodules = true;
+ };
+
+ buildInputs = [
+ protobuf pkg-config h2o openssl eigen ncurses5 zstd zlib curl gitMinimal
+ ];
+
+ buildPhase = ''
+ make ${core} ${noncore}
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin
+ mv ${core} ${noncore} $out/bin
+ ${lib.optionalString buildAll "cp -r html $out/"}
+ '';
+}
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
new file mode 100644
index 0000000..eaba1d9
--- /dev/null
+++ b/pkgs/overlay.nix
@@ -0,0 +1,6 @@
+self: super:
+
+{
+ galmon-core = self.callPackage (import ./galmon.nix {}) {};
+ galmon-full = self.callPackage (import ./galmon.nix { buildAll = true; }) {};
+}