Merge remote changes + feat: AIO v2 board module
- Cross-compile overlays for Hyprland (libcamera, pipewire, gjs) - Refactor uconsoleBaseModules into reusable list - Add wireguard-client service module - Restructure users into subdirectories - New: hardware.uconsole-cm5-aio-v2 module (GPIO rails, aiov2_ctl, GPS UART) - Update configuration.nix with Hyprland + AIO v2 - Add AIO v2 module to both toplevel and SD image config
This commit is contained in:
134
flake.nix
134
flake.nix
@@ -14,7 +14,7 @@
|
||||
};
|
||||
nixpkgs-uconsole.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
nixos-uconsole = {
|
||||
url = "github:nixos-uconsole/nixos-uconsole/v1.1.0";
|
||||
url = "github:gortium/nixos-uconsole/pr/dcs-panel-detection";
|
||||
inputs.nixpkgs.follows = "nixpkgs-uconsole";
|
||||
inputs.nixos-raspberrypi.follows = "nixos-raspberrypi";
|
||||
};
|
||||
@@ -46,6 +46,84 @@
|
||||
devShell = import ./shells/nix_dev.nix {
|
||||
inherit pkgs system agenix;
|
||||
};
|
||||
|
||||
# Cross-compile overlay fixes for Hyprland and deps on aarch64
|
||||
uconsoleCrossOverlay = final: prev: {
|
||||
libcamera = prev.libcamera.overrideAttrs (_: { meta.platforms = []; });
|
||||
libcamera-rpi = prev.libcamera-rpi.overrideAttrs (_: { meta.platforms = []; });
|
||||
libpisp = prev.libpisp.overrideAttrs (_: { meta.platforms = []; });
|
||||
pipewire = prev.pipewire.overrideAttrs (old: {
|
||||
buildInputs = builtins.filter
|
||||
(x: !(x?pname && x.pname == "libcamera"))
|
||||
(old.buildInputs or []);
|
||||
mesonFlags = builtins.filter
|
||||
(flag: !(builtins.isString flag && builtins.match ".*libcamera.*" flag != null))
|
||||
(old.mesonFlags or []) ++ [ "-Dlibcamera=disabled" ];
|
||||
});
|
||||
gjs = prev.gjs.overrideAttrs (old: {
|
||||
mesonFlags = (old.mesonFlags or []) ++ [ "-Dskip_gtk_tests=true" ];
|
||||
});
|
||||
hyprland = prev.hyprland.override { wrapRuntimeDeps = false; };
|
||||
xdg-desktop-portal-hyprland = prev.xdg-desktop-portal-hyprland.overrideAttrs (old: {
|
||||
preConfigure = (old.preConfigure or "") + ''
|
||||
cmakeFlags="$cmakeFlags -Dhyprwayland-scanner_DIR=${prev.buildPackages.hyprwayland-scanner}/lib/cmake/hyprwayland-scanner" 2>/dev/null || true
|
||||
export PKG_CONFIG_PATH="${prev.buildPackages.hyprwayland-scanner}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
'';
|
||||
});
|
||||
};
|
||||
|
||||
# RPI-specific pipewire libcamera fix (separate nixpkgs instance)
|
||||
uconsoleRpiPipewireOverlay = final: prev: {
|
||||
pipewire = prev.pipewire.overrideAttrs (old: {
|
||||
buildInputs = builtins.filter
|
||||
(x: !(x?pname && x.pname == "libcamera"))
|
||||
(old.buildInputs or []);
|
||||
mesonFlags = builtins.filter
|
||||
(flag: !(builtins.isString flag && builtins.match ".*libcamera.*" flag != null))
|
||||
(old.mesonFlags or []) ++ [ "-Dlibcamera=disabled" ];
|
||||
});
|
||||
};
|
||||
|
||||
# Shared uConsole CM5 module set — used by both toplevel and SD image
|
||||
uconsoleBaseModules = [
|
||||
{
|
||||
nixpkgs.buildPlatform = "x86_64-linux";
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
boot.loader.raspberry-pi.bootloader = "kernel";
|
||||
nixpkgs.overlays = [ uconsoleCrossOverlay ];
|
||||
}
|
||||
nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
||||
({ config, lib, pkgs, ... }: {
|
||||
nixpkgs.overlays = [ uconsoleRpiPipewireOverlay ];
|
||||
})
|
||||
# Fix old panel init_sequence: DCS read + DSI_INIT0 lane config
|
||||
({ lib, ... }: {
|
||||
boot.kernelPatches = [{
|
||||
name = "panel-cwu50-fix-lanes";
|
||||
patch = ./patches/0008-panel-cwu50-fix-init-seq1.patch;
|
||||
}];
|
||||
})
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||
nixos-raspberrypi.lib.inject-overlays
|
||||
nixos-raspberrypi.lib.inject-overlays-global
|
||||
nixos-uconsole.nixosModules.uconsole-cm5
|
||||
# Cross-compiled Lix for uConsole
|
||||
({ config, lib, pkgs, inputs, ... }: let
|
||||
lixCross = import inputs.nixpkgs-uconsole {
|
||||
localSystem = { system = "x86_64-linux"; };
|
||||
crossSystem = { system = "aarch64-linux"; };
|
||||
overlays = [ inputs.lix.overlays.default ];
|
||||
};
|
||||
in { nix.package = lixCross.lix; })
|
||||
agenix.nixosModules.default
|
||||
./hosts/uconsole-cm5/configuration.nix
|
||||
./hosts/uconsole-cm5/hardware-configuration.nix
|
||||
./modules/nixos/services/wireguard-client.nix
|
||||
./modules/nixos/hardware/uconsole-cm5-aio-v2.nix
|
||||
./users/gortium/gortium.nix
|
||||
./users/ai-worker/ai-worker.nix
|
||||
];
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
lazyworkhorse = nixpkgs.lib.nixosSystem {
|
||||
@@ -63,12 +141,11 @@
|
||||
./hosts/lazyworkhorse/hardware-configuration.nix
|
||||
./modules/nixos/filesystem/hoardingcow-mount.nix
|
||||
./modules/nixos/services/docker_manager.nix
|
||||
./modules/nixos/services/open_code_server.nix
|
||||
./modules/nixos/services/wireguard-client.nix
|
||||
./modules/nixos/services/ollama_init_custom_models.nix
|
||||
./modules/nixos/services/openclaw_node.nix
|
||||
./modules/nixos/security/ai-worker-restricted.nix
|
||||
./users/gortium.nix
|
||||
./users/ai-worker.nix
|
||||
./users/gortium/gortium.nix
|
||||
./users/ai-worker/ai-worker.nix
|
||||
];
|
||||
};
|
||||
|
||||
@@ -83,6 +160,8 @@
|
||||
}
|
||||
./hosts/cyt-pi/configuration.nix
|
||||
./hosts/cyt-pi/hardware-configuration.nix
|
||||
./modules/nixos/services/wireguard-client.nix
|
||||
./users/gortium/gortium.nix
|
||||
];
|
||||
};
|
||||
|
||||
@@ -93,37 +172,7 @@
|
||||
nixos-raspberrypi = nixos-raspberrypi;
|
||||
isCM4 = false;
|
||||
};
|
||||
modules = [
|
||||
{
|
||||
nixpkgs.buildPlatform = "x86_64-linux";
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
boot.loader.raspberry-pi.bootloader = "kernel";
|
||||
}
|
||||
nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
||||
# Fix old panel init_sequence: add DSI_INIT0 lane config, remove contradictory BURST flag
|
||||
({ lib, ... }: {
|
||||
boot.kernelPatches = [{
|
||||
name = "panel-cwu50-fix-lanes";
|
||||
patch = ./patches/0008-panel-cwu50-fix-init-seq1.patch;
|
||||
}];
|
||||
})
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||
nixos-raspberrypi.lib.inject-overlays
|
||||
nixos-raspberrypi.lib.inject-overlays-global
|
||||
nixos-uconsole.nixosModules.uconsole-cm5
|
||||
({ config, lib, pkgs, inputs, ... }: let
|
||||
lix-cross = import inputs.nixpkgs-uconsole {
|
||||
localSystem = { system = "x86_64-linux"; };
|
||||
crossSystem = { system = "aarch64-linux"; };
|
||||
overlays = [ inputs.lix.overlays.default ];
|
||||
};
|
||||
in { nix.package = lix-cross.lix; })
|
||||
agenix.nixosModules.default
|
||||
./modules/nixos/hardware/uconsole-cm5-aio-v2.nix
|
||||
./hosts/uconsole-cm5/configuration.nix
|
||||
./hosts/uconsole-cm5/hardware-configuration.nix
|
||||
];
|
||||
modules = uconsoleBaseModules;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -137,19 +186,8 @@
|
||||
nixos-raspberrypi = nixos-raspberrypi;
|
||||
isCM4 = false;
|
||||
};
|
||||
modules = [
|
||||
{
|
||||
nixpkgs.buildPlatform = system;
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
}
|
||||
nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||
nixos-raspberrypi.lib.inject-overlays-global
|
||||
modules = uconsoleBaseModules ++ [
|
||||
nixos-raspberrypi.nixosModules.sd-image
|
||||
nixos-uconsole.nixosModules.uconsole-cm5
|
||||
agenix.nixosModules.default
|
||||
./modules/nixos/hardware/uconsole-cm5-aio-v2.nix
|
||||
./hosts/uconsole-cm5/configuration.nix
|
||||
];
|
||||
}).config.system.build.sdImage;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user