From e8ee273d59dd2302acfcea0bbed3b1f2a3737fb3 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 6 Jul 2025 16:38:05 +0200 Subject: [PATCH] update apple silicon support add update script --- .../apple-silicon-support/modules/default.nix | 23 ------------------- .../modules/mesa/default.nix | 7 ++---- .../packages/asahi-fwextract/default.nix | 17 +++++++------- zeta/update.sh | 10 ++++++++ 4 files changed, 21 insertions(+), 36 deletions(-) create mode 100755 zeta/update.sh diff --git a/zeta/apple-silicon-support/modules/default.nix b/zeta/apple-silicon-support/modules/default.nix index 6278945..7990556 100644 --- a/zeta/apple-silicon-support/modules/default.nix +++ b/zeta/apple-silicon-support/modules/default.nix @@ -13,29 +13,6 @@ in lib.mkIf cfg.enable { nixpkgs.overlays = lib.mkBefore [ cfg.overlay ]; - # patch systemd-boot to boot in Apple Silicon UEFI environment. - # This regression only appeared in systemd 256.7. - # see https://github.com/NixOS/nixpkgs/pull/355290 - # and https://github.com/systemd/systemd/issues/35026 - systemd.package = let - systemdBroken = (pkgs.systemd.version == "256.7"); - - systemdPatched = pkgs.systemd.overrideAttrs (old: { - patches = let - oldPatches = (old.patches or []); - # not sure why there are non-paths in there but oh well - patchNames = (builtins.map (p: if ((builtins.typeOf p) == "path") then builtins.baseNameOf p else "") oldPatches); - fixName = "0019-Revert-boot-Make-initrd_prepare-semantically-equival.patch"; - alreadyPatched = builtins.elem fixName patchNames; - in oldPatches ++ lib.optionals (!alreadyPatched) [ - (pkgs.fetchpatch { - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/125e99477b0ac0a54b7cddc6c5a704821a3074c7/pkgs/os-specific/linux/systemd/${fixName}"; - hash = "sha256-UW3DZiaykQUUNcGA5UFxN+/wgNSW3ufxDDCZ7emD16o="; - }) - ]; - }); - in if systemdBroken then systemdPatched else pkgs.systemd; - hardware.asahi.pkgs = if cfg.pkgsSystem != "aarch64-linux" then diff --git a/zeta/apple-silicon-support/modules/mesa/default.nix b/zeta/apple-silicon-support/modules/mesa/default.nix index ab48c99..8fc9acd 100644 --- a/zeta/apple-silicon-support/modules/mesa/default.nix +++ b/zeta/apple-silicon-support/modules/mesa/default.nix @@ -1,9 +1,6 @@ -{ options, config, pkgs, lib, ... }: +{ config, lib, ... }: { - config = let - isMode = mode: (config.hardware.asahi.useExperimentalGPUDriver - && config.hardware.asahi.experimentalGPUInstallMode == mode); - in lib.mkIf config.hardware.asahi.enable (lib.mkMerge [ + config = lib.mkIf config.hardware.asahi.enable (lib.mkMerge [ { # required for proper DRM setup even without GPU driver services.xserver.config = '' diff --git a/zeta/apple-silicon-support/packages/asahi-fwextract/default.nix b/zeta/apple-silicon-support/packages/asahi-fwextract/default.nix index 95159d4..5bdd9d9 100755 --- a/zeta/apple-silicon-support/packages/asahi-fwextract/default.nix +++ b/zeta/apple-silicon-support/packages/asahi-fwextract/default.nix @@ -1,14 +1,17 @@ -{ lib -, python3 -, fetchFromGitHub -, gzip -, gnutar -, lzfse +{ + python3, + fetchFromGitHub, + gzip, + gnutar, + lzfse, }: python3.pkgs.buildPythonApplication rec { pname = "asahi-fwextract"; version = "0.7.8"; + pyproject = true; + + build-system = [ python3.pkgs.setuptools ]; # tracking version: https://packages.fedoraproject.org/pkgs/asahi-installer/python3-asahi_firmware/ src = fetchFromGitHub { @@ -26,7 +29,5 @@ python3.pkgs.buildPythonApplication rec { --replace '"xf"' '"-x", "-I", "${gzip}/bin/gzip", "-f"' ''; - nativeBuildInputs = [ python3.pkgs.setuptools ]; - doCheck = false; } diff --git a/zeta/update.sh b/zeta/update.sh new file mode 100755 index 0000000..4fc10ad --- /dev/null +++ b/zeta/update.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env zsh + +rm -rf nixos-apple-silicon +git clone https://github.com/nix-community/nixos-apple-silicon.git + +rm -rf apple-silicon-support +mv nixos-apple-silicon/apple-silicon-support . +git add apple-silicon-support + +rm -rf nixos-apple-silicon