fix: clean module and flake after merge
This commit is contained in:
@@ -14,14 +14,10 @@
|
|||||||
};
|
};
|
||||||
nixpkgs-uconsole.url = "github:NixOS/nixpkgs/nixos-25.11";
|
nixpkgs-uconsole.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||||
nixos-uconsole = {
|
nixos-uconsole = {
|
||||||
url = "github:gortium/nixos-uconsole/cm5_fix";
|
url = "github:gortium/nixos-uconsole/pr/dcs-panel-detection";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
||||||
inputs.nixos-raspberrypi.follows = "nixos-raspberrypi";
|
inputs.nixos-raspberrypi.follows = "nixos-raspberrypi";
|
||||||
};
|
};
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager/release-25.11";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
|
||||||
};
|
|
||||||
nixos-raspberrypi = {
|
nixos-raspberrypi = {
|
||||||
url = "github:gortium/nixos-raspberrypi/cm5-cross-v1";
|
url = "github:gortium/nixos-raspberrypi/cm5-cross-v1";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
||||||
@@ -121,12 +117,10 @@
|
|||||||
in { nix.package = lixCross.lix; })
|
in { nix.package = lixCross.lix; })
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
./hosts/uconsole-cm5/configuration.nix
|
./hosts/uconsole-cm5/configuration.nix
|
||||||
./hosts/uconsole-cm5/hardware-configuration.nix
|
./hosts/uconsole-cm5/hardware-configuration.nix
|
||||||
./modules/nixos/services/wireguard-client.nix
|
./modules/nixos/services/wireguard-client.nix
|
||||||
./modules/nixos/security/ai-worker-restricted.nix
|
./modules/nixos/security/ai-worker-restricted.nix
|
||||||
./modules/nixos/hardware/uconsole-cm5-aio-v2.nix
|
|
||||||
./users/gortium/gortium.nix
|
./users/gortium/gortium.nix
|
||||||
./users/ai-worker/ai-worker.nix
|
./users/ai-worker/ai-worker.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ let
|
|||||||
|
|
||||||
# GPIO pin map matching the AIO v2 board hardware
|
# GPIO pin map matching the AIO v2 board hardware
|
||||||
# SDR (RTL-SDR): GPIO 7
|
# SDR (RTL-SDR): GPIO 7
|
||||||
# LoRa (S60127) : GPIO 16
|
# LoRa (SX1262) : GPIO 16
|
||||||
# USB Hub Interne: GPIO 23
|
# USB Hub Interne: GPIO 23
|
||||||
# GPS (GNSS) : GPIO 27
|
# GPS (GNSS) : GPIO 27
|
||||||
gpioMap = {
|
gpioMap = {
|
||||||
@@ -21,17 +21,149 @@ let
|
|||||||
applyRailsScript = pkgs.writeShellScript "apply-aio-v2-rails" (
|
applyRailsScript = pkgs.writeShellScript "apply-aio-v2-rails" (
|
||||||
''
|
''
|
||||||
set -e
|
set -e
|
||||||
PINCTRL=${pkgs.libraspberrypip}/bin/pinctrl
|
PINCTRL=${pkgs.libraspberrypi}/bin/pinctrl
|
||||||
''
|
''
|
||||||
+ concatStringsSep "" (mapAttrToList (name: pin: ''
|
+ concatStringsSep "" (mapAttrsToList (name: pin: ''
|
||||||
if [ "${if cfg.bootRails.${name} then "1" else "0"}" = "1" ]; then
|
if [ "${if cfg.bootRails.${name} then "1" else "0"}" = "1" ]; then
|
||||||
echo "AIO v2: ${name} (GPIO${toString pin}) → ON"
|
echo "AIO v2: ${name} (GPIO${toString pin}) -> ON"
|
||||||
$PINCTRL set ${toString pin} op dh
|
$PINCTRL set ${toString pin} op dh
|
||||||
else
|
else
|
||||||
echo "AIO v2: ${name} (GPIO${toString pin}) → OFF"
|
echo "AIO v2: ${name} (GPIO${toString pin}) -> OFF"
|
||||||
$PINCTRL set ${toString pin} op dl
|
$PINCTRL set ${toString pin} op dl
|
||||||
fi
|
fi
|
||||||
'') gpioMap)
|
'') gpioMap)
|
||||||
);
|
);
|
||||||
|
|
||||||
# aiov2_ctl CLI tool 䁙<EFBFBD>э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><1D><>!Ո<><D588><EFBFBD>م<EFBFBD><D985><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́<EFBFBD><CC81><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>ѱ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
# aiov2_ctl CLI tool -- fetched from GitHub, available as `aiov2_ctl`
|
||||||
|
aiov2CtlPkg = pkgs.stdenv.mkDerivation rec {
|
||||||
|
pname = "aiov2_ctl";
|
||||||
|
version = "0-unstable-2026-06-16";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "hackergadgets";
|
||||||
|
repo = "aiov2_ctl";
|
||||||
|
rev = "main";
|
||||||
|
hash = "sha256-hqOvS1K5pDVXAroUE50i5R9YqRgC2U3fzby6uuB67K0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin $out/share/aiov2_ctl/img
|
||||||
|
cp $src/aiov2_ctl.py $out/bin/aiov2_ctl
|
||||||
|
chmod +x $out/bin/aiov2_ctl
|
||||||
|
patchShebangs $out/bin/aiov2_ctl
|
||||||
|
substituteInPlace $out/bin/aiov2_ctl \
|
||||||
|
--replace-fail '"/usr/local/share/aiov2_ctl/img/' '"'$out'/share/aiov2_ctl/img/'
|
||||||
|
cp -r $src/img/* $out/share/aiov2_ctl/img/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "HackerGadgets uConsole AIO v2 GPIO control and telemetry tool";
|
||||||
|
homepage = "https://github.com/hackergadgets/aiov2_ctl";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
platforms = [ "aarch64-linux" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.hardware.uconsole-cm5-aio-v2 = {
|
||||||
|
enable = mkEnableOption "HackerGadgets uConsole AIO v2 board support";
|
||||||
|
|
||||||
|
bootRails = {
|
||||||
|
GPS = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable GPS module at boot (GPIO 27)";
|
||||||
|
};
|
||||||
|
LORA = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable LoRa module at boot (GPIO 16)";
|
||||||
|
};
|
||||||
|
SDR = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable SDR module at boot (GPIO 7)";
|
||||||
|
};
|
||||||
|
USB = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable internal USB hub at boot (GPIO 23)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = aiov2CtlPkg;
|
||||||
|
defaultText = literalExpression "aiov2CtlPkg";
|
||||||
|
description = "aiov2_ctl package to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableGPS = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable GPS UART (/dev/ttyAMA0 at 9600 baud).
|
||||||
|
Requires enabling UART on the CM5 via boot.kernelParams.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
enableGUI = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the system tray GUI for aiov2_ctl.
|
||||||
|
Requires a desktop environment with system tray support.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Package the aiov2_ctl tool + pinctrl
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
cfg.package
|
||||||
|
libraspberrypi # provides pinctrl
|
||||||
|
];
|
||||||
|
|
||||||
|
# Boot rail systemd oneshot service
|
||||||
|
systemd.services.aiov2-rails-boot = {
|
||||||
|
description = "Apply AIO v2 GPIO rail boot states";
|
||||||
|
after = [ "local-fs.target" ];
|
||||||
|
wants = [ "local-fs.target" ];
|
||||||
|
before = [ "multi-user.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${applyRailsScript}";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# GPS configuration
|
||||||
|
boot.kernelParams = mkIf cfg.enableGPS [ "uart0=on" ];
|
||||||
|
|
||||||
|
users.users = mkIf cfg.enableGPS {
|
||||||
|
gortium = {
|
||||||
|
extraGroups = [ "dialout" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# GUI autostart (XDG)
|
||||||
|
systemd.user.services.aiov2-ctl-gui = mkIf cfg.enableGUI {
|
||||||
|
description = "AIO v2 System Tray Controller";
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
wants = [ "graphical-session.target" ];
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${cfg.package}/bin/aiov2_ctl --gui";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
};
|
||||||
|
environment = {
|
||||||
|
AIOV2_CTL_DEBUG = "0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
# - NO access to infra repo (no bind mount)
|
# - NO access to infra repo (no bind mount)
|
||||||
# - NO sudo access (no nh, nixos-rebuild, nixpkgs-fmt, nix)
|
# - NO sudo access (no nh, nixos-rebuild, nixpkgs-fmt, nix)
|
||||||
# WORKFLOW: SSH from Hermes container, run docker benchmarks, return and save results to /opt/data/ai-optimizer/
|
# WORKFLOW: SSH from Hermes container, run docker benchmarks, return and save results to /opt/data/ai-optimizer/
|
||||||
services.aiWorkerAccess = true;
|
|
||||||
|
|
||||||
# Restricted sudo for ai-worker - security checks only
|
# Restricted sudo for ai-worker - security checks only
|
||||||
security.sudo.extraRules = [
|
security.sudo.extraRules = [
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{ pkgs, inputs, config, keys, ... }: {
|
{ pkgs, inputs, config, keys, ... }: {
|
||||||
|
home-manager.extraSpecialArgs = { inherit (config.networking) hostName; dotfiles = ../../assets/dotfiles; };
|
||||||
home-manager.users.gortium = import ./home.nix;
|
home-manager.users.gortium = import ./home.nix;
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
hostName = config.networking.hostName;
|
hostName = config.networking.hostName;
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
];
|
];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
passwordFile = config.age.secrets.gortium_password.path;
|
passwordFile = config.age.secrets.gortium_password.path;
|
||||||
|
ignoreShellProgramCheck = true;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
keys.users.gortium.main
|
keys.users.gortium.main
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user