From ef65508f07812e4fcc5408722483f7615a59a8b4 Mon Sep 17 00:00:00 2001 From: iFargle Date: Wed, 13 Dec 2023 14:24:27 +0900 Subject: [PATCH] Update, add docker to piaware --- nixos/hosts/piaware-rpi4/default.nix | 1 + nixos/hosts/piaware-rpi4/docker.nix | 48 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 nixos/hosts/piaware-rpi4/docker.nix diff --git a/nixos/hosts/piaware-rpi4/default.nix b/nixos/hosts/piaware-rpi4/default.nix index 921fea4f..14e0ff86 100644 --- a/nixos/hosts/piaware-rpi4/default.nix +++ b/nixos/hosts/piaware-rpi4/default.nix @@ -5,6 +5,7 @@ imports = [ inputs.nixos-hardware.nixosModules.raspberry-pi-4 (modulesPath + "/installer/scan/not-detected.nix") + ./docker.nix ]; # Enable distributed Builds nix.distributedBuilds = true; diff --git a/nixos/hosts/piaware-rpi4/docker.nix b/nixos/hosts/piaware-rpi4/docker.nix new file mode 100644 index 00000000..ff3fc351 --- /dev/null +++ b/nixos/hosts/piaware-rpi4/docker.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: { + boot.kernel.sysctl = { + "fs.inotify.max_user_watches" = 10485760; + "fs.inotify.max_user_instances" = 1024; + }; + + virtualisation.docker = { + enable = true; + enableOnBoot = true; + autoPrune.enable = true; + autoPrune.dates = "weekly"; + liveRestore = true; + }; + + environment.systemPackages = with pkgs; [ + docker-compose + ctop + ]; + networking.firewall.allowedTCPPorts = [ + 8080 30003 30005 + ]; +} + + +# Docker Compose file for PiAware: +# version: '3' +# +#services: +# piaware: +# image: ghcr.io/sdr-enthusiasts/docker-piaware:latest +# tty: true +# container_name: piaware +# restart: always +# devices: +# - /dev/bus/usb:/dev/bus/usb +# ports: +# - 8080:80 +# - 30003:30003 +# - 30005:30005 +# environment: +# - TZ="Asia/Tokyo" +# - LAT=35.6837777585358 +# - LONG=135.02715404216545 +# - FEEDER_ID=cdca89ee-6612-4707-b0bb-ffb78d156c47 +# - RECEIVER_TYPE=rtlsdr +# tmpfs: +# - /run:exec,size=64M +# - /var/log \ No newline at end of file