From cc4b19e36e249d3995cf1888d73f221bf0dc424f Mon Sep 17 00:00:00 2001 From: Spotlight Date: Wed, 28 May 2025 18:17:29 -0500 Subject: [PATCH] Re-export linux-asahi/m1n1 for CI --- flake.lock | 25 ++++++++--------- flake.nix | 27 ++++++++++++++----- .../spotlights-macbook-air/configuration.nix | 9 ++----- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index 15a5151..3c0ece3 100644 --- a/flake.lock +++ b/flake.lock @@ -23,15 +23,16 @@ ] }, "locked": { - "lastModified": 1747514947, - "narHash": "sha256-irRDuerdVu495nBgkhCUjCi2mRpPig0F6cKMoIOfScA=", + "lastModified": 1748263294, + "narHash": "sha256-YOjjNfkzrDMpndTen2tYn4DBB2BbrvRJMQf/45wDZU0=", "owner": "tpwrules", "repo": "nixos-apple-silicon", - "rev": "db46177593e24f68e802455875850cdeaf49eb1c", + "rev": "f198b8d27fdc1eee591c88a789e58497daaf3c1e", "type": "github" }, "original": { "owner": "tpwrules", + "ref": "pull/303/head", "repo": "nixos-apple-silicon", "type": "github" } @@ -53,11 +54,11 @@ }, "flake-compat": { "locked": { - "lastModified": 1688025799, - "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "lastModified": 1746162366, + "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", "owner": "nix-community", "repo": "flake-compat", - "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", "type": "github" }, "original": { @@ -91,11 +92,11 @@ ] }, "locked": { - "lastModified": 1748227609, - "narHash": "sha256-SaSdslyo6UGDpPUlmrPA4dWOEuxCy2ihRN9K6BnqYsA=", + "lastModified": 1748455938, + "narHash": "sha256-mQ/iNzPra2WtDQ+x2r5IadcWNr0m3uHvLMzJkXKAG/8=", "owner": "nix-community", "repo": "home-manager", - "rev": "d23d20f55d49d8818ac1f1b2783671e8a6725022", + "rev": "02077149e2921014511dac2729ae6dadb4ec50e2", "type": "github" }, "original": { @@ -141,11 +142,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748190013, - "narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", + "lastModified": 1748370509, + "narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "62b852f6c6742134ade1abdd2a21685fd617a291", + "rev": "4faa5f5321320e49a78ae7848582f684d64783e9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ccf049c..70d3108 100644 --- a/flake.nix +++ b/flake.nix @@ -4,8 +4,10 @@ inputs = { # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # Temporarily use https://github.com/tpwrules/nixos-apple-silicon/pull/303 + # as stable mesa now supports the Asahi ABI fully. apple-silicon-support = { - url = "github:tpwrules/nixos-apple-silicon"; + url = "github:tpwrules/nixos-apple-silicon?ref=pull/303/head"; inputs.nixpkgs.follows = "nixpkgs"; }; # Allows for easy enumeration of available Darwin and Linux systems. @@ -54,13 +56,14 @@ }); # Next, we provide Linux-specific home-manager configurations, + # assist Garnix in building the linux-asahi kernel for aarch64-linux, # and expose our default packages to the world. packages = let - ########################## - # Linux-specific options # - ########################## - linuxConfiguration = linuxSystems (system: { + ############################### + # Linux-specific home manager # + ############################### + linuxHomeManager = linuxSystems (system: { homeConfigurations = { # We currently assume that Linux devices only require # dotfiles and utilize the username `spotlight`. @@ -83,10 +86,19 @@ }); # For all platforms, export our packages for CI to build. - exportedPackages = allSystems (system: import ./pkgs/default.nix { + overlayPackages = allSystems (system: import ./pkgs/default.nix { pkgs = nixpkgs.legacyPackages.${system}; }); + # On aarch64-linux, additionally re-export Asahi-related packages. + # This allows it to be cached via Garnix if necessary, saving local build time. + asahiPackages = { + aarch64-linux = { + linux-asahi-kernel = inputs.apple-silicon-support.packages.aarch64-linux.linux-asahi.kernel; + m1n1 = inputs.apple-silicon-support.packages.aarch64-linux.m1n1; + }; + }; + # We must use recursiveUpdate in order to go deeper beyond one level. # For example, `linuxConfiguration` provides `packages.x86_64-linux.homeConfiguration` # and `exportedPackages` provides `packages.x86_64-linux.`. @@ -95,8 +107,9 @@ # and either packages or the home-manager configuration end up being replaced. # This is not ideal :( recursiveUpdate = nixpkgs.lib.recursiveUpdate; + exportedPackages = recursiveUpdate overlayPackages asahiPackages; in - recursiveUpdate linuxConfiguration exportedPackages; + recursiveUpdate linuxHomeManager exportedPackages; # We provide a NixOS module for easy usage within other system flakes. # (Again, we assume a default name of `spotlight` under Linux.) diff --git a/hosts/linux/spotlights-macbook-air/configuration.nix b/hosts/linux/spotlights-macbook-air/configuration.nix index ab61681..4b17c1e 100644 --- a/hosts/linux/spotlights-macbook-air/configuration.nix +++ b/hosts/linux/spotlights-macbook-air/configuration.nix @@ -23,13 +23,8 @@ time.timeZone = lib.mkForce null; # Asahi Linux support - hardware.asahi = { - peripheralFirmwareDirectory = /boot/asahi; - # GPU enablement - useExperimentalGPUDriver = true; - experimentalGPUInstallMode = "replace"; - withRust = true; - }; + # Options such as `withRust` are no longer necessary. + hardware.asahi.peripheralFirmwareDirectory = /boot/asahi; networking = { hostName = "spotlights-macbook-air";