Moved eviroment to config

This commit is contained in:
Sebastian 2024-02-10 23:43:05 +01:00
parent 9eac5d825a
commit fa7de8fa5b
2 changed files with 22 additions and 13 deletions

View File

@ -3,7 +3,17 @@
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
with lib;
let
satnogs-env = {
SATNOGS_ANTENNA = "RX";
SATNOGS_RF_GAIN = "5";
SATNOGS_RX_SAMP_RATE = "2.048e6";
SATNOGS_SOAPY_RX_DEVICE = "driver=rtlsdr";
SATNOGS_STATION_ELEV = "225";
SATNOGS_STATION_ID = "517";
};
in
{
imports =
[
@ -66,11 +76,17 @@
virtualisation.docker.enable = true;
systemd.services.satnogs-docker-compose = {
script = ''
${pkgs.docker-compose}/bin/docker-compose -f ${./satnogs-docker-compose.yml} up
'';
wantedBy = ["multi-user.target"];
after = ["docker.service" "docker.socket"];
script = concatStringsSep " \\\n " ([
"${pkgs.docker-compose}/bin/docker-compose"
"-f ${./satnogs-docker-compose.yml}"
]
++ (mapAttrsToList (k: v: "-e ${escapeShellArg k}=${escapeShellArg v}") satnogs-env)
++ [ "up" ]);
preStop = "${pkgs.docker-compose}/bin/docker-compose -f ${./satnogs-docker-compose.yml} down";
wantedBy = [ "multi-user.target" ];
after = [ "docker.service" "docker.socket" ];
};
# List packages installed in system profile. To search, run:

View File

@ -24,13 +24,6 @@ services:
SATNOGS_RIG_IP: 'rigctld'
SATNOGS_RIG_PORT: '4532'
SATNOGS_ANTENNA: 'RX'
SATNOGS_RF_GAIN: '5'
SATNOGS_RX_SAMP_RATE: '2.048e6'
SATNOGS_SOAPY_RX_DEVICE: 'driver=rtlsdr'
SATNOGS_STATION_ELEV: '225'
SATNOGS_STATION_ID: '517'
command: 'satnogs-client' # default
device_cgroup_rules:
- 'c 189:* rwm'