Re-export linux-asahi/m1n1 for CI

This commit is contained in:
Spotlight 2025-05-28 18:17:29 -05:00
parent e6ff6ddaa2
commit cc4b19e36e
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
3 changed files with 35 additions and 26 deletions

25
flake.lock generated
View file

@ -23,15 +23,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747514947, "lastModified": 1748263294,
"narHash": "sha256-irRDuerdVu495nBgkhCUjCi2mRpPig0F6cKMoIOfScA=", "narHash": "sha256-YOjjNfkzrDMpndTen2tYn4DBB2BbrvRJMQf/45wDZU0=",
"owner": "tpwrules", "owner": "tpwrules",
"repo": "nixos-apple-silicon", "repo": "nixos-apple-silicon",
"rev": "db46177593e24f68e802455875850cdeaf49eb1c", "rev": "f198b8d27fdc1eee591c88a789e58497daaf3c1e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "tpwrules", "owner": "tpwrules",
"ref": "pull/303/head",
"repo": "nixos-apple-silicon", "repo": "nixos-apple-silicon",
"type": "github" "type": "github"
} }
@ -53,11 +54,11 @@
}, },
"flake-compat": { "flake-compat": {
"locked": { "locked": {
"lastModified": 1688025799, "lastModified": 1746162366,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -91,11 +92,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748227609, "lastModified": 1748455938,
"narHash": "sha256-SaSdslyo6UGDpPUlmrPA4dWOEuxCy2ihRN9K6BnqYsA=", "narHash": "sha256-mQ/iNzPra2WtDQ+x2r5IadcWNr0m3uHvLMzJkXKAG/8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d23d20f55d49d8818ac1f1b2783671e8a6725022", "rev": "02077149e2921014511dac2729ae6dadb4ec50e2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -141,11 +142,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748190013, "lastModified": 1748370509,
"narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", "narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "62b852f6c6742134ade1abdd2a21685fd617a291", "rev": "4faa5f5321320e49a78ae7848582f684d64783e9",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -4,8 +4,10 @@
inputs = { inputs = {
# Specify the source of Home Manager and Nixpkgs. # Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 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 = { apple-silicon-support = {
url = "github:tpwrules/nixos-apple-silicon"; url = "github:tpwrules/nixos-apple-silicon?ref=pull/303/head";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Allows for easy enumeration of available Darwin and Linux systems. # Allows for easy enumeration of available Darwin and Linux systems.
@ -54,13 +56,14 @@
}); });
# Next, we provide Linux-specific home-manager configurations, # 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. # and expose our default packages to the world.
packages = packages =
let let
########################## ###############################
# Linux-specific options # # Linux-specific home manager #
########################## ###############################
linuxConfiguration = linuxSystems (system: { linuxHomeManager = linuxSystems (system: {
homeConfigurations = { homeConfigurations = {
# We currently assume that Linux devices only require # We currently assume that Linux devices only require
# dotfiles and utilize the username `spotlight`. # dotfiles and utilize the username `spotlight`.
@ -83,10 +86,19 @@
}); });
# For all platforms, export our packages for CI to build. # 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}; 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. # We must use recursiveUpdate in order to go deeper beyond one level.
# For example, `linuxConfiguration` provides `packages.x86_64-linux.homeConfiguration` # For example, `linuxConfiguration` provides `packages.x86_64-linux.homeConfiguration`
# and `exportedPackages` provides `packages.x86_64-linux.<package name>`. # and `exportedPackages` provides `packages.x86_64-linux.<package name>`.
@ -95,8 +107,9 @@
# and either packages or the home-manager configuration end up being replaced. # and either packages or the home-manager configuration end up being replaced.
# This is not ideal :( # This is not ideal :(
recursiveUpdate = nixpkgs.lib.recursiveUpdate; recursiveUpdate = nixpkgs.lib.recursiveUpdate;
exportedPackages = recursiveUpdate overlayPackages asahiPackages;
in in
recursiveUpdate linuxConfiguration exportedPackages; recursiveUpdate linuxHomeManager exportedPackages;
# We provide a NixOS module for easy usage within other system flakes. # We provide a NixOS module for easy usage within other system flakes.
# (Again, we assume a default name of `spotlight` under Linux.) # (Again, we assume a default name of `spotlight` under Linux.)

View file

@ -23,13 +23,8 @@
time.timeZone = lib.mkForce null; time.timeZone = lib.mkForce null;
# Asahi Linux support # Asahi Linux support
hardware.asahi = { # Options such as `withRust` are no longer necessary.
peripheralFirmwareDirectory = /boot/asahi; hardware.asahi.peripheralFirmwareDirectory = /boot/asahi;
# GPU enablement
useExperimentalGPUDriver = true;
experimentalGPUInstallMode = "replace";
withRust = true;
};
networking = { networking = {
hostName = "spotlights-macbook-air"; hostName = "spotlights-macbook-air";