2023-09-12 08:44:05 -06:00
|
|
|
{ pkgs
|
|
|
|
, config
|
2024-06-28 08:37:31 -06:00
|
|
|
, lib
|
2023-09-12 08:44:05 -06:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
2024-04-25 13:13:37 -06:00
|
|
|
tsAddr = "100.84.170.57";
|
2024-06-28 08:37:31 -06:00
|
|
|
oLlamaPort = 11434;
|
2022-12-31 05:53:50 -07:00
|
|
|
pubKeys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7v+/xS8832iMqJHCWsxUZ8zYoMWoZhjj++e26g1fLT europa"
|
|
|
|
];
|
2023-09-12 08:44:05 -06:00
|
|
|
in
|
|
|
|
{
|
2023-06-07 07:07:25 -06:00
|
|
|
_module.args.isUnstable = false;
|
2023-08-17 15:43:16 -06:00
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
2022-12-31 05:53:50 -07:00
|
|
|
|
2023-08-09 05:59:09 -06:00
|
|
|
hardware.rtl-sdr.enable = true;
|
|
|
|
|
2022-12-31 05:53:50 -07:00
|
|
|
# Bootloader.
|
2023-09-12 08:44:05 -06:00
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi = {
|
|
|
|
canTouchEfiVariables = true;
|
|
|
|
efiSysMountPoint = "/boot/efi";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
2022-12-31 05:53:50 -07:00
|
|
|
|
2023-09-12 08:44:05 -06:00
|
|
|
binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
|
|
|
|
};
|
2023-02-23 13:09:06 -07:00
|
|
|
nixpkgs.config.allowUnsupportedSystem = true;
|
|
|
|
|
2022-12-31 05:53:50 -07:00
|
|
|
networking = {
|
|
|
|
hostName = "pwntie";
|
|
|
|
networkmanager.enable = true;
|
|
|
|
firewall = {
|
|
|
|
enable = true;
|
2023-09-12 08:44:05 -06:00
|
|
|
allowedTCPPorts = [ 22 ];
|
2022-12-31 05:53:50 -07:00
|
|
|
checkReversePath = "loose";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.libvirtd.enable = true;
|
|
|
|
|
|
|
|
environment.sessionVariables = {
|
|
|
|
XDG_BIN_HOME = "\${HOME}/.local/bin";
|
|
|
|
XDG_CACHE_HOME = "\${HOME}/.cache";
|
|
|
|
XDG_CONFIG_HOME = "\${HOME}/.config";
|
|
|
|
XDG_DATA_HOME = "\${HOME}/.local/share";
|
|
|
|
|
2023-07-11 09:12:50 -06:00
|
|
|
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
|
2023-09-12 08:44:05 -06:00
|
|
|
PATH = [ "\${XDG_BIN_HOME}" ];
|
2022-12-31 05:53:50 -07:00
|
|
|
};
|
|
|
|
|
2023-08-09 05:59:09 -06:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
rtl-sdr
|
2023-08-09 12:46:14 -06:00
|
|
|
direwolf
|
2023-09-12 08:44:05 -06:00
|
|
|
(callPackage ../../pkgs/rtlamr.nix { })
|
2023-08-09 05:59:09 -06:00
|
|
|
];
|
2022-12-31 05:53:50 -07:00
|
|
|
|
2023-01-31 12:55:24 -07:00
|
|
|
xinCI = {
|
|
|
|
user = "qbit";
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
2024-04-25 13:13:37 -06:00
|
|
|
systemd = {
|
|
|
|
services = {
|
|
|
|
ollama = {
|
|
|
|
environment = {
|
|
|
|
OLLAMA_ORIGINS = "*";
|
2024-06-28 08:37:31 -06:00
|
|
|
OLLAMA_HOST = lib.mkForce "0.0.0.0";
|
2024-04-25 13:13:37 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-05 11:43:53 -07:00
|
|
|
services = {
|
2024-06-28 08:37:31 -06:00
|
|
|
ts-reverse-proxy = {
|
|
|
|
servers = {
|
|
|
|
"ollama-reverse" = {
|
|
|
|
enable = true;
|
|
|
|
reverseName = "ollama";
|
|
|
|
reversePort = oLlamaPort;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-04-25 13:13:37 -06:00
|
|
|
ollama = {
|
|
|
|
enable = true;
|
|
|
|
acceleration = "rocm";
|
2024-06-28 08:37:31 -06:00
|
|
|
listenAddress = "localhost:${toString oLlamaPort}";
|
2024-04-25 13:13:37 -06:00
|
|
|
};
|
2024-01-04 14:40:08 -07:00
|
|
|
prometheus = {
|
|
|
|
enable = true;
|
|
|
|
port = 9001;
|
2024-04-25 13:13:37 -06:00
|
|
|
listenAddress = tsAddr;
|
2024-01-04 14:40:08 -07:00
|
|
|
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
port = 9002;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-08-17 15:43:16 -06:00
|
|
|
rtlamr2mqtt = {
|
|
|
|
enable = true;
|
|
|
|
configuration = {
|
|
|
|
general = {
|
|
|
|
device_ids_path = "${config.services.rtlamr2mqtt.package}/sdl_ids.txt";
|
|
|
|
sleep_for = 0;
|
|
|
|
verbosity = "debug";
|
|
|
|
tickle_rtl_tcp = false;
|
|
|
|
device_id = "0bda:2838";
|
|
|
|
};
|
|
|
|
mqtt = {
|
|
|
|
host = "10.6.0.15";
|
|
|
|
port = 1883;
|
|
|
|
tls_enabled = false;
|
|
|
|
ha_autodiscovery = true;
|
2023-12-07 14:10:23 -07:00
|
|
|
base_topic = "rtlamr";
|
2023-08-17 15:43:16 -06:00
|
|
|
};
|
|
|
|
custom_parameters = {
|
|
|
|
rtltcp = "-s 2048000";
|
|
|
|
rtlamr = "-unique=true -symbollength=32";
|
|
|
|
};
|
|
|
|
meters = [
|
|
|
|
{
|
|
|
|
id = 48582066;
|
|
|
|
protocol = "scm";
|
|
|
|
name = "gas_meter";
|
|
|
|
unit_of_measurement = "ft³";
|
|
|
|
icon = "mdi:gas-burner";
|
|
|
|
device_class = "gas";
|
|
|
|
state_class = "total_increasing";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-01-05 11:43:53 -07:00
|
|
|
fwupd = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2022-12-31 05:53:50 -07:00
|
|
|
};
|
|
|
|
|
2023-09-12 08:44:05 -06:00
|
|
|
users = {
|
|
|
|
users = {
|
|
|
|
root = { openssh.authorizedKeys.keys = pubKeys; };
|
|
|
|
qbit = {
|
|
|
|
openssh.authorizedKeys.keys = pubKeys;
|
|
|
|
extraGroups = [ "dialout" "libvirtd" "docker" "plugdev" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-12-31 05:53:50 -07:00
|
|
|
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
}
|