Compare commits
1 Commits
feat/ucons
...
feat/kvm-l
| Author | SHA1 | Date | |
|---|---|---|---|
| 37d690e4de |
Submodule assets/compose updated: d3f2e3b7b9...6b82a26c25
28
flake.nix
28
flake.nix
@@ -12,18 +12,10 @@
|
|||||||
url = "git+https://git.lix.systems/lix-project/lix?ref=main";
|
url = "git+https://git.lix.systems/lix-project/lix?ref=main";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixos-uconsole = {
|
|
||||||
url = "github:nixos-uconsole/nixos-uconsole";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nixos-raspberrypi = {
|
|
||||||
url = "github:nvmd/nixos-raspberrypi/v1.20260317.0";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
self.submodules = true;
|
self.submodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, agenix, lix, nixos-uconsole, nixos-raspberrypi, ... }@inputs:
|
outputs = { self, nixpkgs, agenix, lix, ... }@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
keys = import ./lib/keys.nix;
|
keys = import ./lib/keys.nix;
|
||||||
@@ -34,7 +26,7 @@
|
|||||||
"/etc/ssh/ssh_host_ed25519_key"
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
"/root/.age/bootstrap.key" ];
|
"/root/.age/bootstrap.key" ];
|
||||||
};
|
};
|
||||||
overlays = [ agenix.overlays.default (import ./overlays/reticulum.nix) ];
|
overlays = [ agenix.overlays.default ];
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
@@ -88,22 +80,6 @@
|
|||||||
./hosts/cyt-pi/hardware-configuration.nix
|
./hosts/cyt-pi/hardware-configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
uConsole = nixos-raspberrypi.lib.nixosSystem {
|
|
||||||
specialArgs = { inherit self keys paths inputs nixos-raspberrypi; };
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
|
||||||
nix.package = lix.packages."aarch64-linux".default;
|
|
||||||
}
|
|
||||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
|
||||||
nixos-uconsole.nixosModules.uconsole-cm5
|
|
||||||
./hosts/uConsole/configuration.nix
|
|
||||||
./hosts/uConsole/hardware-configuration.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
devShells.${system}.default = devShell;
|
devShells.${system}.default = devShell;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"transparent_hugepage=always" # because mucho ram
|
"transparent_hugepage=always" # because mucho ram
|
||||||
];
|
];
|
||||||
# 2. Load the specific drivers found by sensors-detect
|
# 2. Load the specific drivers found by sensors-detect
|
||||||
boot.kernelModules = [ "nct6775" "lm96163" "iptable_nat" "iptable_filter" ];
|
boot.kernelModules = [ "nct6775" "lm96163" "iptable_nat" "iptable_filter" "kvm-intel" "kvm" ];
|
||||||
# 3. Force the nct6775 driver to recognize the chip if it's stubborn
|
# 3. Force the nct6775 driver to recognize the chip if it's stubborn
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
options nct6775 force_id=0xd280
|
options nct6775 force_id=0xd280
|
||||||
@@ -207,7 +207,6 @@
|
|||||||
ai = {
|
ai = {
|
||||||
path = self + "/assets/compose/ai";
|
path = self + "/assets/compose/ai";
|
||||||
envFile = config.age.secrets.containers_env.path;
|
envFile = config.age.secrets.containers_env.path;
|
||||||
ports = [ 22000 ]; # Syncthing TCP sync
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudstorage = {
|
cloudstorage = {
|
||||||
@@ -329,20 +328,21 @@
|
|||||||
# Mi50 config
|
# Mi50 config
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true; # Useful for some compatibility layers
|
enable32Bit = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
rocmPackages.clr.icd # OpenCL/HIP runtime
|
rocmPackages.clr.icd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nixpkgs.config.rocmTargets = [ "gfx906" ];
|
nixpkgs.config.rocmTargets = [ "gfx906" ];
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
# This "tricks" ROCm into supporting the MI50 if using newer versions
|
|
||||||
HSA_OVERRIDE_GFX_VERSION = "9.0.6";
|
HSA_OVERRIDE_GFX_VERSION = "9.0.6";
|
||||||
# Ensures the system sees both GPUs
|
|
||||||
HIP_VISIBLE_DEVICES = "0,1";
|
HIP_VISIBLE_DEVICES = "0,1";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# KVM/libvirt for staging VM
|
||||||
|
virtualisation.libvirtd.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
@@ -475,7 +475,7 @@
|
|||||||
services.openssh.settings = {
|
services.openssh.settings = {
|
||||||
PermitRootLogin = "no";
|
PermitRootLogin = "no";
|
||||||
MaxAuthTries = 3;
|
MaxAuthTries = 3;
|
||||||
MaxSessions = 20;
|
MaxSessions = 10;
|
||||||
LoginGraceTime = 30;
|
LoginGraceTime = 30;
|
||||||
ClientAliveInterval = 300;
|
ClientAliveInterval = 300;
|
||||||
ClientAliveCountMax = 2;
|
ClientAliveCountMax = 2;
|
||||||
|
|||||||
@@ -1,167 +0,0 @@
|
|||||||
{ config, lib, pkgs, paths, self, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Basic Host Info
|
|
||||||
networking.hostName = "uConsole";
|
|
||||||
time.timeZone = "America/Montreal";
|
|
||||||
i18n.defaultLocale = "en_CA.UTF-8";
|
|
||||||
|
|
||||||
# System State
|
|
||||||
system.stateVersion = "25.05";
|
|
||||||
|
|
||||||
# Boot & Hardware (uconsole-cm5 module handles boot.loader)
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
# Networking
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings.PermitRootLogin = "prohibit-password";
|
|
||||||
settings.PasswordAuthentication = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# User
|
|
||||||
users.users.gortium = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" "networkmanager" "video" "dialout" "kismet" ];
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
keys.users.gortium.main
|
|
||||||
keys.users.gortium.gitea
|
|
||||||
];
|
|
||||||
};
|
|
||||||
security.sudo.extraRules = [
|
|
||||||
{
|
|
||||||
users = [ "gortium" ];
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
command = "ALL";
|
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Package groups
|
|
||||||
# ============================================================
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# ===== Base =====
|
|
||||||
emacs-pgtk
|
|
||||||
git
|
|
||||||
ripgrep
|
|
||||||
fd
|
|
||||||
htop
|
|
||||||
tmux
|
|
||||||
neovim
|
|
||||||
|
|
||||||
# ===== HAM Radio =====
|
|
||||||
js8call
|
|
||||||
wsjtx
|
|
||||||
fldigi
|
|
||||||
pat # Winlink client
|
|
||||||
direwolf # AX.25 packet modem
|
|
||||||
chirp # Radio programming tool
|
|
||||||
hamlib # Ham radio control libraries
|
|
||||||
trustedqsl # Logbook of the World (LoTW)
|
|
||||||
|
|
||||||
# ===== SDR / RF =====
|
|
||||||
sdrpp # SDR++ spectrum analyzer
|
|
||||||
gqrx # SDR receiver GUI
|
|
||||||
rtl-sdr # RTL-SDR drivers & utilities
|
|
||||||
inspectrum # Offline signal analysis
|
|
||||||
soapysdr-with-plugins # SoapySDR + hardware support plugins
|
|
||||||
|
|
||||||
# ===== Mesh / LoRa =====
|
|
||||||
meshtastic # Python CLI for Meshtastic devices
|
|
||||||
reticulumStack # Reticulum Network Stack (rnsd, rnsh, rncp, rnx, rnpath, etc.)
|
|
||||||
lxmf # LXMF messaging protocol
|
|
||||||
nomadnet # Nomad Network client
|
|
||||||
|
|
||||||
# ===== Security =====
|
|
||||||
nmap
|
|
||||||
aircrack-ng
|
|
||||||
kismet # Wi-Fi monitor / IDS
|
|
||||||
bettercap # MITM/network attack framework
|
|
||||||
wireshark # Packet analyzer
|
|
||||||
hashcat # GPU password cracker
|
|
||||||
john # John the Ripper
|
|
||||||
sqlmap # SQL injection tool
|
|
||||||
|
|
||||||
# ===== GPS / Maps =====
|
|
||||||
foxtrotgps
|
|
||||||
viking # GPS map editor
|
|
||||||
gpsbabel # GPS data conversion
|
|
||||||
];
|
|
||||||
|
|
||||||
# Packages noted but not in unstable nixpkgs:
|
|
||||||
# - metasploit: unfree; install manually via Git clone
|
|
||||||
# - burpsuite: unfree Java app (Community Edition available for download)
|
|
||||||
# - sidechannel: not a distinct PyPI package; functionality covered by
|
|
||||||
# the Reticulum stack. For LXMF GUI client, install Sideband manually
|
|
||||||
# from github.com/markqvist/Sideband
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Reticulum Service (rnsd)
|
|
||||||
# ============================================================
|
|
||||||
systemd.services.rnsd = {
|
|
||||||
description = "Reticulum Network Stack Daemon";
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
User = "gortium";
|
|
||||||
Group = "gortium";
|
|
||||||
ExecStart = "${pkgs.reticulumStack}/bin/rnsd";
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = "10s";
|
|
||||||
LimitNOFILE = 65536;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Kismet Service (Wi-Fi monitoring / mesh node)
|
|
||||||
# ============================================================
|
|
||||||
systemd.services.kismet = {
|
|
||||||
description = "Kismet Wi-Fi Monitor & IDS";
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
User = "gortium";
|
|
||||||
Group = "kismet";
|
|
||||||
ExecStart = "${pkgs.kismet}/bin/kismet -c wlan0 --log-base=/home/gortium/kismet_logs --no-nc-ui";
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = "10s";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Kernel modules for SDR and radio
|
|
||||||
# ============================================================
|
|
||||||
boot.kernelModules = [
|
|
||||||
"88x2bu" # Realtek 8812/8821BU USB WiFi (common adapter)
|
|
||||||
"rtl8xxxu" # RTL8188/8192/8723 USB WiFi
|
|
||||||
"rtl2832_sdr" # RTL-SDR kernel module
|
|
||||||
"dvb_usb_rtl28xxu" # RTL-SDR DVB-T
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.blacklistedKernelModules = [ ];
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Extra udev rules for SDR and HAM radio devices
|
|
||||||
# ============================================================
|
|
||||||
services.udev.packages = with pkgs; [ rtl-sdr ];
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Enable IPv6 for Reticulum mesh
|
|
||||||
# ============================================================
|
|
||||||
networking.enableIPv6 = true;
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Firewall: open ports for Reticulum (optional)
|
|
||||||
# ============================================================
|
|
||||||
networking.firewall.allowedTCPPorts = [ 22 ]; # SSH only
|
|
||||||
networking.firewall.allowedUDPPorts = [ ];
|
|
||||||
# Reticulum uses its own encryption and doesn't need open ports
|
|
||||||
# for basic mesh operations (peer-to-peer discovery).
|
|
||||||
# For TCP interfaces, open additional ports as needed.
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sdhci_pci" "nvme" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
# uConsole CM5 uses NVMe or eMMC for boot storage
|
|
||||||
# The uconsole-cm5 module sets up /boot/firmware and default /
|
|
||||||
# Override device label here if using different storage
|
|
||||||
fileSystems."/" = lib.mkDefault {
|
|
||||||
device = "/dev/disk/by-label/NIXOS_UCM5";
|
|
||||||
fsType = "ext4";
|
|
||||||
options = [ "noatime" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
final: prev: let
|
|
||||||
python3 = final.python3;
|
|
||||||
pyPkgs = python3.pkgs;
|
|
||||||
in {
|
|
||||||
reticulumStack = python3.pkgs.buildPythonApplication rec {
|
|
||||||
pname = "reticulum";
|
|
||||||
version = "1.2.9";
|
|
||||||
src = pyPkgs.fetchPypi {
|
|
||||||
pname = "rns";
|
|
||||||
inherit version;
|
|
||||||
sha256 = "554814231c237b9caacf8df669312e57dd7d3f84b6d4810125087d1a79a75d75";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = with pyPkgs; [ cryptography pyserial ];
|
|
||||||
doCheck = false;
|
|
||||||
pythonImportsCheck = [ "RNS" ];
|
|
||||||
meta = with final.lib; {
|
|
||||||
description = "Self-configuring, encrypted and resilient mesh networking stack";
|
|
||||||
homepage = "https://reticulum.network/";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
lxmf = python3.pkgs.buildPythonApplication rec {
|
|
||||||
pname = "lxmf";
|
|
||||||
version = "0.9.8";
|
|
||||||
src = pyPkgs.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "30f39f3a975a049c12ee2cfceb3261d24cb5adec881c6821f7354464b3f3650c";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = [ final.reticulumStack ];
|
|
||||||
doCheck = false;
|
|
||||||
pythonImportsCheck = [ "LXMF" ];
|
|
||||||
meta = with final.lib; {
|
|
||||||
description = "Lightweight Extensible Message Format for Reticulum";
|
|
||||||
homepage = "https://github.com/markqvist/lxmf";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nomadnet = python3.pkgs.buildPythonApplication rec {
|
|
||||||
pname = "nomadnet";
|
|
||||||
version = "1.1.1";
|
|
||||||
src = pyPkgs.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "fa13b64a10e75b705a58024815ab72451700aa726af96d415ba99dec28dfc40a";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = with pyPkgs; [ final.reticulumStack final.lxmf urwid qrcode ];
|
|
||||||
doCheck = false;
|
|
||||||
pythonImportsCheck = [ "nomadnet" ];
|
|
||||||
meta = with final.lib; {
|
|
||||||
description = "Nomad Network — resilient mesh communications platform";
|
|
||||||
homepage = "https://github.com/markqvist/NomadNet";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
rnsh = python3.pkgs.buildPythonApplication rec {
|
|
||||||
pname = "rnsh";
|
|
||||||
version = "0.1.7";
|
|
||||||
src = pyPkgs.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "9cb72f25abb1c6d300f8014b264184ff78f592fe88e36094938012990b797c93";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = [ final.reticulumStack ];
|
|
||||||
doCheck = false;
|
|
||||||
pythonImportsCheck = [ "rnsh" ];
|
|
||||||
meta = with final.lib; {
|
|
||||||
description = "Remote shell over Reticulum";
|
|
||||||
homepage = "https://github.com/acehoss/rnsh";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
group = "ai-worker";
|
group = "ai-worker";
|
||||||
home = "/home/ai-worker";
|
home = "/home/ai-worker";
|
||||||
createHome = true;
|
createHome = true;
|
||||||
extraGroups = [ "docker" ];
|
extraGroups = [ "docker" "libvirtd" ];
|
||||||
shell = pkgs.bashInteractive;
|
shell = pkgs.bashInteractive;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
keys.users.ai-worker.main
|
keys.users.ai-worker.main
|
||||||
|
|||||||
Reference in New Issue
Block a user