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,11 +124,13 @@ in
}; };
}; };
home.packages = with pkgs.${namespace}; [ home.packages =
with pkgs.${namespace};
[
bolt-launcher bolt-launcher
# librepods # librepods
] ++ (with pkgs; ]
[ ++ (with pkgs; [
iw iw
iwd iwd
orca-slicer orca-slicer

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;

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 ]);

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";
@@ -39,7 +41,8 @@ let
} }
); );
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";
@@ -57,7 +60,8 @@ let
} }
); );
edk2PlatformsSrc = (if MODEL == "5" then edk2PlatformsSrc = (
if MODEL == "5" then
fetchFromGitHub rec { fetchFromGitHub rec {
owner = "mjallen18"; owner = "mjallen18";
repo = "edk2-platforms"; repo = "edk2-platforms";
@@ -75,7 +79,10 @@ let
} }
); );
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,7 +128,9 @@ 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 =
pname:
writeShellScript "${pname}-fex-wrapper" ''
export FEXINTERPRETER="${fex}/bin/FEXInterpreter" export FEXINTERPRETER="${fex}/bin/FEXInterpreter"
export FEX_ROOTFS="${fex}/share/fex-emu/RootFS" export FEX_ROOTFS="${fex}/share/fex-emu/RootFS"
@@ -140,7 +141,9 @@ let
''; '';
# 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 =
pname:
writeShellScript "${pname}-muvm-wrapper" ''
# muvm creates a lightweight VM with x86_64 emulation via FEX # muvm creates a lightweight VM with x86_64 emulation via FEX
# This provides better isolation and compatibility # This provides better isolation and compatibility
@@ -152,25 +155,19 @@ let
''; '';
# 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 '' ${
if isAarch64 then
''
# On aarch64, create wrapper scripts that use FEX/muvm # On aarch64, create wrapper scripts that use FEX/muvm
cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client cp ${aarch64Wrapper "horizon-client"} $out/bin/horizon-client
chmod +x $out/bin/horizon-client chmod +x $out/bin/horizon-client
cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator cp ${aarch64Wrapper "omnissa-usbarbitrator"} $out/bin/omnissa-usbarbitrator
chmod +x $out/bin/omnissa-usbarbitrator chmod +x $out/bin/omnissa-usbarbitrator
'' else '' ''
else
''
# On x86_64, use native FHS environment directly # On x86_64, use native FHS environment directly
ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/ ln -s ${omnissaFHSUserEnv "horizon-client"}/bin/horizon-client $out/bin/
ln -s ${omnissaFHSUserEnv "omnissa-usbarbitrator"}/bin/omnissa-usbarbitrator $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

@@ -66,11 +66,14 @@ lib.overrideDerivation
isLTS = true; isLTS = true;
structuredExtraConfig = lib.mkIf (rpiVersion == 5) (with lib.kernel; { structuredExtraConfig = lib.mkIf (rpiVersion == 5) (
with lib.kernel;
{
CONFIG_ARM64_4K_PAGES = lib.mkForce no; CONFIG_ARM64_4K_PAGES = lib.mkForce no;
CONFIG_ARM64_64K_PAGES = lib.mkForce no; CONFIG_ARM64_64K_PAGES = lib.mkForce no;
CONFIG_ARM64_16K_PAGES = lib.mkForce yes; 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,8 +16,9 @@
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
(self: super: { (_self: _super: {
linuxPackages_pi5-16k = pkgs.linuxPackagesFor (pkgs.linux_6_18.override { linuxPackages_pi5-16k = pkgs.linuxPackagesFor (
pkgs.linux_6_18.override {
structuredExtraConfig = with lib.kernel; { structuredExtraConfig = with lib.kernel; {
CONFIG_ARM64_4K_PAGES = lib.mkForce no; CONFIG_ARM64_4K_PAGES = lib.mkForce no;
CONFIG_ARM64_64K_PAGES = lib.mkForce no; CONFIG_ARM64_64K_PAGES = lib.mkForce no;
@@ -27,7 +28,8 @@
CONFIG_OF_OVERLAY = 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
];
}; };
}; };