2021-09-25 16:21:13 +02:00
|
|
|
|
{ hostRegistry, config, lib, pkgs, modulesPath, ... }:
|
2021-09-23 03:32:17 +02:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
boot.initrd.availableKernelModules = [ "usbhid" ];
|
|
|
|
|
boot.initrd.kernelModules = [ ];
|
|
|
|
|
boot.kernelModules = [ ];
|
|
|
|
|
boot.extraModulePackages = [ ];
|
|
|
|
|
|
|
|
|
|
fileSystems."/" = {
|
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
|
fsType = "ext4";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/boot/firmware" = {
|
|
|
|
|
device = "/dev/disk/by-label/FIRMWARE";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
swapDevices = [ ];
|
|
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
#networking.wireless.enable = true;
|
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
loader = {
|
|
|
|
|
grub.enable = false;
|
|
|
|
|
raspberryPi = {
|
|
|
|
|
enable = true;
|
|
|
|
|
version = 3;
|
|
|
|
|
uboot.enable = true;
|
|
|
|
|
firmwareConfig = ''
|
|
|
|
|
gpu_mem=192
|
|
|
|
|
dtparam=audio=on
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-09-23 19:33:40 +02:00
|
|
|
|
kernelPackages = pkgs.linuxPackages_5_13;
|
|
|
|
|
# Don't build ZFS for aarch64 (broken?)
|
|
|
|
|
supportedFilesystems = lib.mkForce [ "vfat" "ext4" ];
|
2021-09-23 03:32:17 +02:00
|
|
|
|
|
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
};
|
2021-09-23 19:34:09 +02:00
|
|
|
|
sdImage = {
|
|
|
|
|
compressImage = false;
|
|
|
|
|
imageBaseName = config.networking.hostName;
|
|
|
|
|
firmwareSize = 512;
|
|
|
|
|
};
|
2021-09-23 03:32:17 +02:00
|
|
|
|
|
2021-09-26 01:47:20 +02:00
|
|
|
|
c3d2 = {
|
|
|
|
|
isInHq = false;
|
|
|
|
|
hq.statistics.enable = true;
|
|
|
|
|
};
|
2021-09-23 03:32:17 +02:00
|
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
|
buildCores = 4;
|
|
|
|
|
maxJobs = 2;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
hostName = "radiobert"; # Define your hostname.
|
|
|
|
|
useDHCP = false;
|
2021-09-25 16:21:13 +02:00
|
|
|
|
interfaces.eth0.ipv4.addresses = [{
|
|
|
|
|
address = hostRegistry.hosts.${config.networking.hostName}.ip4;
|
|
|
|
|
prefixLength = 26;
|
|
|
|
|
}];
|
|
|
|
|
defaultGateway = "172.20.73.1";
|
|
|
|
|
firewall.allowedTCPPorts = [ 22 80 443 ];
|
2021-09-26 20:52:53 +02:00
|
|
|
|
nameservers = [ "172.20.73.8" "9.9.9.9" ];
|
2021-09-23 03:32:17 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.openwebrx.enable = true;
|
|
|
|
|
|
2021-09-26 01:47:20 +02:00
|
|
|
|
services.collectd.plugins = {
|
|
|
|
|
curl_json = ''
|
|
|
|
|
<URL "http://localhost:8073/metrics.json">
|
|
|
|
|
Plugin "openwebrx_decodes"
|
|
|
|
|
<Key "wsjt/decodes/*/*/count">
|
|
|
|
|
Type "counter"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "aprs/decodes/*/*/*/count">
|
|
|
|
|
Type "counter"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "js8call/decodes/*/*/count">
|
|
|
|
|
Type "counter"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "decoding/queue/*/count">
|
|
|
|
|
Type "counter"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "decoding/queue/length">
|
|
|
|
|
Type "gauge"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "pskreporter/*/count">
|
|
|
|
|
Type "gauge"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "wsprnet/*/count">
|
|
|
|
|
Type "gauge"
|
|
|
|
|
</Key>
|
|
|
|
|
<Key "openwebrx/users">
|
|
|
|
|
Type "gauge"
|
|
|
|
|
</Key>
|
|
|
|
|
</URL>
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-23 03:32:17 +02:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
libraspberrypi
|
2021-09-24 00:52:32 +02:00
|
|
|
|
dump1090_sdrplus
|
2021-09-23 03:32:17 +02:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
programs.tmux.enable = true;
|
|
|
|
|
|
|
|
|
|
# Do not log to flash:
|
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
|
Storage=volatile
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
security.sudo = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wheelNeedsPassword = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
users.users.k-ot = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
extraGroups = [ "wheel" "audio" ];
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-25 16:21:13 +02:00
|
|
|
|
services.nginx = {
|
|
|
|
|
enable = true;
|
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
|
virtualHosts."sdr.hq.c3d2.de" = {
|
|
|
|
|
default = true;
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
enableACME = true;
|
2021-09-26 01:47:36 +02:00
|
|
|
|
locations."/" = {
|
|
|
|
|
proxyPass = "http://localhost:8073";
|
|
|
|
|
proxyWebsockets = true;
|
|
|
|
|
};
|
2021-09-25 16:21:13 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
2021-09-23 03:32:17 +02:00
|
|
|
|
|
|
|
|
|
# Allow access to USB
|
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
|
SUBSYSTEM=="usb", MODE:="0666"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "21.05"; # Did you read the comment?
|
|
|
|
|
}
|