This commit is contained in:
mjallen18
2026-01-14 18:00:52 -06:00
parent 59b4729636
commit 7306b08762
23 changed files with 197 additions and 155 deletions

View File

@@ -124,16 +124,18 @@ in
}; };
}; };
home.packages = with pkgs.${namespace}; [ home.packages =
bolt-launcher with pkgs.${namespace};
# librepods [
] ++ (with pkgs; bolt-launcher
[ # librepods
iw ]
iwd ++ (with pkgs; [
orca-slicer iw
vscodium iwd
]); orca-slicer
vscodium
]);
programs = { programs = {
password-store = enabled; password-store = enabled;

View File

@@ -153,7 +153,7 @@ with lib;
extraConfig = mkOption { extraConfig = mkOption {
type = with types; str; type = with types; str;
default = ''''; default = "";
description = "Any extra configuration options"; description = "Any extra configuration options";
}; };

View File

@@ -115,8 +115,8 @@ in
tarnow = "${getExe pkgs.gnutar} -acf "; tarnow = "${getExe pkgs.gnutar} -acf ";
untar = "${getExe pkgs.gnutar} -zxvf "; untar = "${getExe pkgs.gnutar} -zxvf ";
wget = "${getExe pkgs.wget} -c "; wget = "${getExe pkgs.wget} -c ";
remove-empty = ''${getExe' pkgs.findutils "find"} . -type d --empty --delete''; remove-empty = "${getExe' pkgs.findutils "find"} . -type d --empty --delete";
print-empty = ''${getExe' pkgs.findutils "find"} . -type d --empty --print''; print-empty = "${getExe' pkgs.findutils "find"} . -type d --empty --print";
dfh = "${getExe' pkgs.coreutils "df"} -h"; dfh = "${getExe' pkgs.coreutils "df"} -h";
duh = "${getExe' pkgs.coreutils "du"} -h"; duh = "${getExe' pkgs.coreutils "du"} -h";
usage = "${getExe' pkgs.coreutils "du"} -ah -d1 | sort -rn 2>/dev/null"; usage = "${getExe' pkgs.coreutils "du"} -ah -d1 | sort -rn 2>/dev/null";

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
let let
hasDestopEnvironment = hasDestopEnvironment =
config.${namespace}.desktop.cosmic.enable config.${namespace}.desktop.cosmic.enable

View File

@@ -153,7 +153,10 @@ let
uefiBuilder = import ./uefi-builder.nix { uefiBuilder = import ./uefi-builder.nix {
inherit pkgs; inherit pkgs;
uefiPackage = ( uefiPackage = (
if (cfg.variant == "5") then pkgs.${namespace}.uefi-rpi5 else pkgs.${namespace}.edk2.override { MODEL = "4"; } if (cfg.variant == "5") then
pkgs.${namespace}.uefi-rpi5
else
pkgs.${namespace}.edk2.override { MODEL = "4"; }
); );
firmwareBuilder = firmwarePopulateCmd; firmwareBuilder = firmwarePopulateCmd;
}; };

View File

@@ -19,9 +19,9 @@ in
{ {
options.${namespace}.hardware = { options.${namespace}.hardware = {
raspberry-pi.leds = { raspberry-pi.leds = {
eth.disable = mkDisableOption ''ethernet LEDs.''; eth.disable = mkDisableOption "ethernet LEDs.";
act.disable = mkDisableOption ''activity LED.''; act.disable = mkDisableOption "activity LED.";
pwr.disable = mkDisableOption ''power LED.''; pwr.disable = mkDisableOption "power LED.";
}; };
}; };

View File

@@ -1,6 +1,5 @@
{ {
config, config,
system,
lib, lib,
namespace, namespace,
... ...

View File

@@ -1,10 +1,19 @@
{ inputs, config, namespace, lib, pkgs, ... }: {
inputs,
config,
namespace,
lib,
pkgs,
...
}:
let let
inherit (lib.${namespace}) mkModule mkOpt mkBoolOpt; inherit (lib.${namespace}) mkOpt;
name = "otbr"; name = "otbr";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};
otbrPackage = pkgs.callPackage "${inputs.nixpkgs-otbr}/pkgs/by-name/op/openthread-border-router/package.nix" { }; otbrPackage =
pkgs.callPackage "${inputs.nixpkgs-otbr}/pkgs/by-name/op/openthread-border-router/package.nix"
{ };
otbrConfig = lib.${namespace}.mkModule { otbrConfig = lib.${namespace}.mkModule {
inherit config name; inherit config name;
@@ -25,7 +34,7 @@ let
listenAddress = cfg.listenAddress; listenAddress = cfg.listenAddress;
listenPort = cfg.port; listenPort = cfg.port;
}; };
radio = { radio = {
device = "/dev/serial/by-id/usb-dresden_elektronik_Thread_RCP__ConBee_II__DE2475318-if00"; device = "/dev/serial/by-id/usb-dresden_elektronik_Thread_RCP__ConBee_II__DE2475318-if00";
baudRate = 460800; baudRate = 460800;
flowControl = true; flowControl = true;

View File

@@ -1,5 +1,5 @@
{ namespace, ... }: { ... }:
final: super: { _final: _super: {
# ${namespace} = super.${namespace} // { # ${namespace} = super.${namespace} // {
# linuxPackages_rpi5 = super.linuxPackagesFor ( # linuxPackages_rpi5 = super.linuxPackagesFor (
# super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; } # super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; }

View File

@@ -1,4 +1,4 @@
{ inputs, ... }: { ... }:
_final: _prev: { _final: _prev: {
# home-assistant = final.unstable.home-assistant; # home-assistant = final.unstable.home-assistant;
# home-assistant-custom-components = final.unstable.home-assistant-custom-components; # home-assistant-custom-components = final.unstable.home-assistant-custom-components;

View File

@@ -1,9 +1,10 @@
{ stdenv {
, fetchFromGitHub stdenv,
, lib fetchFromGitHub,
, MODEL ? "5" lib,
, DEBUG ? "0" MODEL ? "5",
, TFA_FLAGS ? "" DEBUG ? "0",
TFA_FLAGS ? "",
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@@ -18,7 +19,9 @@ stdenv.mkDerivation rec {
}; };
# Add required host tools if needed: # Add required host tools if needed:
nativeBuildInputs = [ /* dtc python3 openssl etc. */ ]; nativeBuildInputs = [
# dtc python3 openssl etc.
];
buildPhase = '' buildPhase = ''
make \ make \

View File

@@ -1,12 +1,11 @@
{ stdenv {
, lib stdenv,
, src lib,
, version ? "stable202511" src,
, python3 version ? "stable202511",
, git python3,
, libuuid git,
, pkgs libuuid,
, namespace
}: }:
let let
pythonEnv = python3.withPackages (ps: [ ps.tkinter ]); pythonEnv = python3.withPackages (ps: [ ps.tkinter ]);
@@ -28,9 +27,9 @@ stdenv.mkDerivation rec {
# Add required host tools if needed: # Add required host tools if needed:
nativeBuildInputs = [ nativeBuildInputs = [
python3 python3
git git
libuuid libuuid
]; ];
# Dont force a single root; we keep both dirs side by side # Dont force a single root; we keep both dirs side by side

View File

@@ -1,25 +1,27 @@
{ stdenv {
, fetchFromGitHub stdenv,
, lib fetchFromGitHub,
, MODEL ? "5" lib,
, RELEASE_TYPE ? "RELEASE" MODEL ? "5",
, EDK2_FLAGS ? "" RELEASE_TYPE ? "RELEASE",
, nasm EDK2_FLAGS ? "",
, perl nasm,
, python3 perl,
, python3Packages python3,
, openssl python3Packages,
, git openssl,
, libuuid git,
, acpica-tools libuuid,
, pkgs acpica-tools,
, namespace pkgs,
namespace,
}: }:
let let
pname = "edk2"; pname = "edk2";
version = "stable202511"; version = "stable202511";
edk2Src = (if MODEL == "5" then edk2Src = (
if MODEL == "5" then
fetchFromGitHub rec { fetchFromGitHub rec {
owner = "mjallen18"; owner = "mjallen18";
repo = "edk2"; repo = "edk2";
@@ -27,7 +29,7 @@ let
rev = "9765be56f1f816ef737153f5588b3294fcc69a63"; rev = "9765be56f1f816ef737153f5588b3294fcc69a63";
hash = "sha256-oqfJbNeOj2BVJqWE+snD6ri3lUO1aNcmPg+eJpjyr5E="; hash = "sha256-oqfJbNeOj2BVJqWE+snD6ri3lUO1aNcmPg+eJpjyr5E=";
fetchSubmodules = true; fetchSubmodules = true;
} }
else else
fetchFromGitHub rec { fetchFromGitHub rec {
owner = "tianocore"; owner = "tianocore";
@@ -37,9 +39,10 @@ let
hash = "sha256-R/rgz8dWcDYVoiM67K2UGuq0xXbjjJYBPtJ1FmfGIaU="; hash = "sha256-R/rgz8dWcDYVoiM67K2UGuq0xXbjjJYBPtJ1FmfGIaU=";
fetchSubmodules = true; fetchSubmodules = true;
} }
); );
edk2NonOsiSrc = (if MODEL == "5" then edk2NonOsiSrc = (
if MODEL == "5" then
fetchFromGitHub rec { fetchFromGitHub rec {
owner = "mjallen18"; owner = "mjallen18";
repo = "edk2-non-osi"; repo = "edk2-non-osi";
@@ -55,10 +58,11 @@ let
rev = "94d048981116e2e3eda52dad1a89958ee404098d"; rev = "94d048981116e2e3eda52dad1a89958ee404098d";
hash = "sha256-6yuvVvmGn4yaEksbbvGDX1ZcKpdWBKnwaNjLGvgAWyk="; hash = "sha256-6yuvVvmGn4yaEksbbvGDX1ZcKpdWBKnwaNjLGvgAWyk=";
} }
); );
edk2PlatformsSrc = (if MODEL == "5" then edk2PlatformsSrc = (
fetchFromGitHub rec { if MODEL == "5" then
fetchFromGitHub rec {
owner = "mjallen18"; owner = "mjallen18";
repo = "edk2-platforms"; repo = "edk2-platforms";
name = repo; name = repo;
@@ -73,9 +77,12 @@ let
rev = "0991a0b643509d900e5d023a0116789827a696e5"; rev = "0991a0b643509d900e5d023a0116789827a696e5";
hash = "sha256-IdACr0NStqEpC0TFoKKgDwKT2mqyJwVXW/B7hlRXccI="; hash = "sha256-IdACr0NStqEpC0TFoKKgDwKT2mqyJwVXW/B7hlRXccI=";
} }
); );
baseTools = pkgs.${namespace}.edk2-basetools.override { version = "stable202511"; src = edk2Src; }; baseTools = pkgs.${namespace}.edk2-basetools.override {
version = "stable202511";
src = edk2Src;
};
armTrustedFirmware = pkgs.${namespace}.arm-trusted-firmware.override { inherit MODEL; }; armTrustedFirmware = pkgs.${namespace}.arm-trusted-firmware.override { inherit MODEL; };
pythonEnv = python3.withPackages ( pythonEnv = python3.withPackages (

View File

@@ -10,12 +10,10 @@
wayland, wayland,
libxkbcommon, libxkbcommon,
libGL, libGL,
vulkan-loader,
xorg, xorg,
expat, expat,
fontconfig, fontconfig,
freetype, freetype,
gsettings-desktop-schemas,
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {

View File

@@ -21,7 +21,6 @@ let
version = "2506"; version = "2506";
isAarch64 = stdenv.hostPlatform.system == "aarch64-linux"; isAarch64 = stdenv.hostPlatform.system == "aarch64-linux";
isX86_64 = stdenv.hostPlatform.system == "x86_64-linux";
# Always extract x64 binaries (we'll emulate on aarch64) # Always extract x64 binaries (we'll emulate on aarch64)
sysArch = "x64"; sysArch = "x64";
@@ -129,48 +128,46 @@ let
# Create wrapper scripts for aarch64 that use FEX or muvm # Create wrapper scripts for aarch64 that use FEX or muvm
# Option 1: Direct FEX execution (simpler, less isolation) # Option 1: Direct FEX execution (simpler, less isolation)
fexWrapper = pname: writeShellScript "${pname}-fex-wrapper" '' fexWrapper =
export FEXINTERPRETER="${fex}/bin/FEXInterpreter" pname:
export FEX_ROOTFS="${fex}/share/fex-emu/RootFS" writeShellScript "${pname}-fex-wrapper" ''
export FEXINTERPRETER="${fex}/bin/FEXInterpreter"
export FEX_ROOTFS="${fex}/share/fex-emu/RootFS"
# Set up FEX environment # Set up FEX environment
export FEX_TSOENABLED=1 export FEX_TSOENABLED=1
exec ${fex}/bin/FEXBash -c '${omnissaFHSUserEnv pname}/bin/${pname} "$@"' -- "$@" exec ${fex}/bin/FEXBash -c '${omnissaFHSUserEnv pname}/bin/${pname} "$@"' -- "$@"
''; '';
# Option 2: muvm + FEX (better isolation, handles kernel differences) # Option 2: muvm + FEX (better isolation, handles kernel differences)
muvmWrapper = pname: writeShellScript "${pname}-muvm-wrapper" '' muvmWrapper =
# muvm creates a lightweight VM with x86_64 emulation via FEX pname:
# This provides better isolation and compatibility writeShellScript "${pname}-muvm-wrapper" ''
# muvm creates a lightweight VM with x86_64 emulation via FEX
# This provides better isolation and compatibility
exec ${muvm}/bin/muvm \ exec ${muvm}/bin/muvm \
--fex \ --fex \
--share-display \ --share-display \
--share-sound \ --share-sound \
-- ${omnissaFHSUserEnv pname}/bin/${pname} "$@" -- ${omnissaFHSUserEnv pname}/bin/${pname} "$@"
''; '';
# Select the appropriate wrapper based on configuration # Select the appropriate wrapper based on configuration
aarch64Wrapper = pname: aarch64Wrapper = pname: if useMusvm then muvmWrapper pname else fexWrapper pname;
if useMusvm
then muvmWrapper pname
else fexWrapper pname;
# Final wrapper that handles both architectures # Final wrapper that handles both architectures
universalWrapper = pname:
if isAarch64
then aarch64Wrapper pname
else "${omnissaFHSUserEnv pname}/bin/${pname}";
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = "horizon-client"; name = "horizon-client";
desktopName = "Omnissa Horizon Client"; desktopName = "Omnissa Horizon Client";
icon = "${omnissaHorizonClientFiles}/share/icons/horizon-client.png"; icon = "${omnissaHorizonClientFiles}/share/icons/horizon-client.png";
exec = "${ exec = "${
if isAarch64 if isAarch64 then
then aarch64Wrapper mainProgram aarch64Wrapper mainProgram
else "${omnissaFHSUserEnv mainProgram}/bin/${mainProgram}" else
"${omnissaFHSUserEnv mainProgram}/bin/${mainProgram}"
} %u"; } %u";
mimeTypes = [ mimeTypes = [
"x-scheme-handler/horizon-client" "x-scheme-handler/horizon-client"
@@ -193,17 +190,22 @@ stdenv.mkDerivation {
runHook preInstall runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
${if isAarch64 then '' ${
# On aarch64, create wrapper scripts that use FEX/muvm if isAarch64 then
cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client ''
chmod +x $out/bin/horizon-client # On aarch64, create wrapper scripts that use FEX/muvm
cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client
chmod +x $out/bin/omnissa-usbarbitrator chmod +x $out/bin/horizon-client
'' else '' cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator
# On x86_64, use native FHS environment directly chmod +x $out/bin/omnissa-usbarbitrator
ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/ ''
ln -s ${omnissaFHSUserEnv "omnissa-usbarbitrator"}/bin/omnissa-usbarbitrator $out/bin/ else
''} ''
# On x86_64, use native FHS environment directly
ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/
ln -s ${omnissaFHSUserEnv "omnissa-usbarbitrator"}/bin/omnissa-usbarbitrator $out/bin/
''
}
runHook postInstall runHook postInstall
''; '';
@@ -221,7 +223,10 @@ stdenv.mkDerivation {
description = "Allows you to connect to your Omnissa Horizon virtual desktop"; description = "Allows you to connect to your Omnissa Horizon virtual desktop";
homepage = "https://www.omnissa.com/products/horizon-8/"; homepage = "https://www.omnissa.com/products/horizon-8/";
license = licenses.unfree; license = licenses.unfree;
platforms = [ "x86_64-linux" "aarch64-linux" ]; platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with maintainers; [ mhutter ]; maintainers = with maintainers; [ mhutter ];
}; };
} }

View File

@@ -23,7 +23,7 @@ python3Packages.buildPythonPackage rec {
pythonRelaxDeps = [ pythonRelaxDeps = [
"aiomqtt" "aiomqtt"
"pycryptodome" "pycryptodome"
]; ];
build-system = with python3Packages; [ build-system = with python3Packages; [
poetry-core poetry-core

View File

@@ -66,11 +66,14 @@ lib.overrideDerivation
isLTS = true; isLTS = true;
structuredExtraConfig = lib.mkIf (rpiVersion == 5) (with lib.kernel; { structuredExtraConfig = lib.mkIf (rpiVersion == 5) (
CONFIG_ARM64_4K_PAGES = lib.mkForce no; with lib.kernel;
CONFIG_ARM64_64K_PAGES = lib.mkForce no; {
CONFIG_ARM64_16K_PAGES = lib.mkForce yes; CONFIG_ARM64_4K_PAGES = lib.mkForce no;
}); CONFIG_ARM64_64K_PAGES = lib.mkForce no;
CONFIG_ARM64_16K_PAGES = lib.mkForce yes;
}
);
extraMeta = extraMeta =
if (rpiVersion < 3) then if (rpiVersion < 3) then

View File

@@ -127,7 +127,6 @@
virt-manager virt-manager
wget wget
(pkgs.OVMF.override { (pkgs.OVMF.override {
secureBoot = true; secureBoot = true;
}) })

View File

@@ -16,18 +16,20 @@
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
(self: super: { (_self: _super: {
linuxPackages_pi5-16k = pkgs.linuxPackagesFor (pkgs.linux_6_18.override { linuxPackages_pi5-16k = pkgs.linuxPackagesFor (
structuredExtraConfig = with lib.kernel; { pkgs.linux_6_18.override {
CONFIG_ARM64_4K_PAGES = lib.mkForce no; structuredExtraConfig = with lib.kernel; {
CONFIG_ARM64_64K_PAGES = lib.mkForce no; CONFIG_ARM64_4K_PAGES = lib.mkForce no;
CONFIG_ARM64_16K_PAGES = lib.mkForce yes; CONFIG_ARM64_64K_PAGES = lib.mkForce no;
CONFIG_OF_CONFIGFS = yes; CONFIG_ARM64_16K_PAGES = lib.mkForce yes;
CONFIG_CONFIGFS_FS = yes; CONFIG_OF_CONFIGFS = yes;
CONFIG_OF_OVERLAY = yes; CONFIG_CONFIGFS_FS = yes;
}; CONFIG_OF_OVERLAY = yes;
ignoreConfigErrors = true; };
}); ignoreConfigErrors = true;
}
);
}) })
]; ];
}; };

View File

@@ -53,8 +53,16 @@
firewall = { firewall = {
enable = true; enable = true;
allowPing = true; allowPing = true;
allowedTCPPorts = [ 8192 8880 8881 ]; allowedTCPPorts = [
allowedUDPPorts = [ 8192 8880 8881 ]; 8192
8880
8881
];
allowedUDPPorts = [
8192
8880
8881
];
}; };
}; };