box,pwntie: setup rtlamr and rtlamr2mqtt (non-working)

This commit is contained in:
Aaron Bieber 2023-08-09 12:46:14 -06:00
parent 8339ab6fe2
commit 63bde1fd09
No known key found for this signature in database
4 changed files with 73 additions and 4 deletions

View File

@ -267,6 +267,7 @@
spkgs.callPackage ./pkgs/ada_language_server.nix {inherit spkgs;}; spkgs.callPackage ./pkgs/ada_language_server.nix {inherit spkgs;};
alire = spkgs.callPackage ./pkgs/alire.nix {inherit spkgs;}; alire = spkgs.callPackage ./pkgs/alire.nix {inherit spkgs;};
bearclaw = spkgs.callPackage ./pkgs/bearclaw.nix {inherit spkgs;}; bearclaw = spkgs.callPackage ./pkgs/bearclaw.nix {inherit spkgs;};
rtlamr = spkgs.callPackage ./pkgs/rtlamr.nix {inherit spkgs;};
clilol = spkgs.callPackage ./pkgs/clilol.nix {inherit spkgs;}; clilol = spkgs.callPackage ./pkgs/clilol.nix {inherit spkgs;};
gqrss = spkgs.callPackage ./pkgs/gqrss.nix { gqrss = spkgs.callPackage ./pkgs/gqrss.nix {
inherit spkgs; inherit spkgs;

View File

@ -44,6 +44,12 @@
owner = config.users.users.nginx.name; owner = config.users.users.nginx.name;
mode = "400"; mode = "400";
}; };
rtlamr2mqtt = pkgs.fetchFromGitHub {
owner = "allangood";
repo = "rtlamr2mqtt";
rev = "b2b05b9c16c396790913fd6f2ff11d5afdef4de8";
hash = "sha256-bm348peVASsApjH+tUyFeF/gXltUNhssT7o+z20qnCc=";
};
in { in {
_module.args.isUnstable = false; _module.args.isUnstable = false;
imports = [ imports = [
@ -51,6 +57,11 @@ in {
#"${inputs.unstable}/nixos/modules/services/home-automation/home-assistant.nix" #"${inputs.unstable}/nixos/modules/services/home-automation/home-assistant.nix"
]; ];
systemd.tmpfiles.rules = [
"C /var/lib/hass/custom_components/rtlamr2mqtt - - - - ${rtlamr2mqtt}"
"Z /var/lib/hass/custom_components 770 hass hass - -"
];
sops.secrets = { sops.secrets = {
#nextcloud_db_pass = { #nextcloud_db_pass = {
# owner = config.users.users.nextcloud.name; # owner = config.users.users.nextcloud.name;
@ -136,6 +147,7 @@ in {
config.services.gitea.settings.server.SSH_PORT config.services.gitea.settings.server.SSH_PORT
21063 #homekit 21063 #homekit
21064 #homekit 21064 #homekit
1883 # mosquitto
]; ];
allowedUDPPorts = [ allowedUDPPorts = [
5353 #homekit 5353 #homekit
@ -233,6 +245,17 @@ in {
hardware.rtl-sdr.enable = true; hardware.rtl-sdr.enable = true;
services = { services = {
mosquitto = {
enable = true;
listeners = [
{
acl = ["pattern readwrite #"];
omitPasswordAuth = true;
settings.allow_anonymous = true;
}
];
};
avahi = { avahi = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
@ -253,22 +276,38 @@ in {
"aprs" "aprs"
"brother" "brother"
"esphome" "esphome"
"rest"
"ffmpeg" "ffmpeg"
"homekit" "homekit"
"homekit_controller" "homekit_controller"
"icloud" "icloud"
"jellyfin" "jellyfin"
"logger"
"met" "met"
"prometheus" "mqtt"
"nextdns" "nextdns"
"prometheus"
"pushover" "pushover"
"rest"
"snmp" "snmp"
"zeroconf" "zeroconf"
"logger"
]; ];
config = { config = {
mqtt.sensor = [
# {
# name = "Gas Meter";
# unique_id = "gas_meter";
# state_topic = "readings/48582066/meter_reading";
# icon = "mdi:gas-burner";
# unit_of_measurement = "cu ft";
# }
# {
# name = "Electric Meter";
# unique_id = "electric_meter";
# state_topic = "readings/20015637/meter_reading";
# icon = "mdi:meter-electric-outline";
# unit_of_measurement = "kWh";
# }
];
logger = { logger = {
default = "warning"; default = "warning";
logs = { logs = {

View File

@ -45,6 +45,8 @@ in {
#nixpkgs.config.allowUnfree = true; #nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
rtl-sdr rtl-sdr
direwolf
(callPackage ../../pkgs/rtlamr.nix {})
]; ];
#programs = { #programs = {

27
pkgs/rtlamr.nix Normal file
View File

@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
...
}:
with lib;
buildGoModule rec {
pname = "rtlamr";
version = "0.9.3";
src = fetchFromGitHub {
owner = "bemasher";
repo = pname;
rev = "v${version}";
hash = "sha256-0LufLU/wTmCRqTnQBNJg5UnDv0u1Thec5FSWATWqZsQ=";
};
vendorHash = "sha256-uT6zfsWgIot0EMNqwtwJNFXN/WaAyOGfcYJjuyOXT4g=";
meta = {
description = "rtl-sdr receiver for Itron ETR meters";
homepage = "https://github.com/bemasher/rtlamr";
license = licenses.agpl3;
maintainers = with maintainers; [qbit];
};
}