From 5667f0786f33bf8d278ef1c5de0e0fbade2f5d37 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 26 Jul 2023 07:33:33 -0600 Subject: [PATCH] pkgs/pymultimonaprs: init and enable config on europa --- flake.nix | 2 ++ hosts/europa/default.nix | 34 ++++++++++++++++++++++++++++++++++ pkgs/pymultimonaprs.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 pkgs/pymultimonaprs.nix diff --git a/flake.nix b/flake.nix index 5adaf2e..193fb25 100644 --- a/flake.nix +++ b/flake.nix @@ -301,6 +301,8 @@ }; hpi = upkgs.python3Packages.callPackage ./pkgs/hpi.nix {inherit upkgs;}; + pymultimonaprs = + upkgs.python3Packages.callPackage ./pkgs/pymultimonaprs.nix {inherit upkgs;}; promnesia = upkgs.python3Packages.callPackage ./pkgs/promnesia.nix { inherit upkgs; }; diff --git a/hosts/europa/default.nix b/hosts/europa/default.nix index cc8ffac..597072f 100644 --- a/hosts/europa/default.nix +++ b/hosts/europa/default.nix @@ -104,6 +104,39 @@ in { boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"]; + environment.etc."pymultimonaprs.json".text = let + aprsConf = { + callsign = "KD0WKW-4"; + passcode = "17318"; + gateway = [ + "noam.aprs2.net:14580" + ]; + source = "rtl"; + rtl = { + freq = 144.390; + ppm = 0; + gain = 0; + offset_tuning = false; + device_index = 0; + }; + beacon = { + lat = 38.3035; + lng = -104.8118; + table = "R"; + symbol = "&"; + comment = "NixOS iGate"; + status = { + text = "RX only mode on Raspberry Pi + RTL"; + file = false; + }; + weather = false; + send_every = 300; + ambiguity = 0.01; + }; + }; + in + builtins.toJSON aprsConf; + nixpkgs.config = { allowUnfree = true; allowUnsupportedSystem = true; @@ -344,6 +377,7 @@ in { alembic ; }) + (pkgs.python3Packages.callPackage ../../pkgs/pymultimonaprs.nix {}) (callPackage ../../pkgs/gokrazy.nix {}) (callPackage ../../pkgs/zutty.nix {}) diff --git a/pkgs/pymultimonaprs.nix b/pkgs/pymultimonaprs.nix new file mode 100644 index 0000000..286d2f9 --- /dev/null +++ b/pkgs/pymultimonaprs.nix @@ -0,0 +1,34 @@ +{ + pkgs, + buildPythonPackage, + setuptools, + fetchFromGitHub, + multimon-ng, + ... +}: +with pkgs; + buildPythonPackage rec { + pname = "pymultimonaprs"; + version = "1.3.1"; + + nativeBuildInputs = [setuptools]; + propagatedBuildInputs = [ + setuptools + multimon-ng + ]; + + buildInputs = []; + + makeWrapperArgs = [ + # Add the installed directories to the python path so the daemon can find them + "--prefix PYTHONPATH : ${python3.pkgs.makePythonPath propagatedBuildInputs}" + "--prefix PYTHONPATH : $out/lib/${python3.libPrefix}/site-packages" + ]; + + src = fetchFromGitHub { + owner = "qbit"; + repo = pname; + rev = "refs/heads/py3"; + sha256 = "sha256-Tdg5hK2wi+KErdbfu8UGJ6d+WT3NbhnFV8pBMBpPAz0="; + }; + }