formatting
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./modules/default.nix
|
||||
];
|
||||
imports = [ ./modules/default.nix ];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs' = config.hardware.asahi.pkgs;
|
||||
|
||||
@@ -8,12 +13,10 @@ let
|
||||
customLogo = config.boot.m1n1CustomLogo;
|
||||
};
|
||||
|
||||
bootUBoot = pkgs'.uboot-asahi.override {
|
||||
m1n1 = bootM1n1;
|
||||
};
|
||||
bootUBoot = pkgs'.uboot-asahi.override { m1n1 = bootM1n1; };
|
||||
|
||||
bootFiles = {
|
||||
"m1n1/boot.bin" = pkgs.runCommand "boot.bin" {} ''
|
||||
"m1n1/boot.bin" = pkgs.runCommand "boot.bin" { } ''
|
||||
cat ${bootM1n1}/build/m1n1.bin > $out
|
||||
cat ${config.boot.kernelPackages.kernel}/dtbs/apple/*.dtb >> $out
|
||||
cat ${bootUBoot}/u-boot-nodtb.bin.gz >> $out
|
||||
@@ -22,14 +25,18 @@ let
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.hardware.asahi.enable {
|
||||
# install m1n1 with the boot loader
|
||||
boot.loader.grub.extraFiles = bootFiles;
|
||||
boot.loader.systemd-boot.extraFiles = bootFiles;
|
||||
|
||||
# ensure the installer has m1n1 in the image
|
||||
system.extraDependencies = lib.mkForce [ bootM1n1 bootUBoot ];
|
||||
system.extraDependencies = lib.mkForce [
|
||||
bootM1n1
|
||||
bootUBoot
|
||||
];
|
||||
system.build.m1n1 = bootFiles."m1n1/boot.bin";
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./kernel
|
||||
@@ -8,20 +13,22 @@
|
||||
./sound
|
||||
];
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
cfg = config.hardware.asahi;
|
||||
in lib.mkIf cfg.enable {
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
nixpkgs.overlays = lib.mkBefore [ cfg.overlay ];
|
||||
|
||||
hardware.asahi.pkgs =
|
||||
if cfg.pkgsSystem != "aarch64-linux"
|
||||
then
|
||||
if cfg.pkgsSystem != "aarch64-linux" then
|
||||
import (pkgs.path) {
|
||||
crossSystem.system = "aarch64-linux";
|
||||
localSystem.system = cfg.pkgsSystem;
|
||||
overlays = [ cfg.overlay ];
|
||||
}
|
||||
else pkgs;
|
||||
else
|
||||
pkgs;
|
||||
};
|
||||
|
||||
options.hardware.asahi = {
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
# the Asahi Linux kernel and options that must go along with it
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf config.hardware.asahi.enable {
|
||||
boot.kernelPackages = let
|
||||
pkgs' = config.hardware.asahi.pkgs;
|
||||
in
|
||||
boot.kernelPackages =
|
||||
let
|
||||
pkgs' = config.hardware.asahi.pkgs;
|
||||
in
|
||||
pkgs'.linux-asahi.override {
|
||||
_kernelPatches = config.boot.kernelPatches;
|
||||
withRust = config.hardware.asahi.withRust;
|
||||
@@ -93,8 +99,11 @@
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "hardware" "asahi" "addEdgeKernelConfig" ]
|
||||
"All edge kernel config options are now the default.")
|
||||
(lib.mkRemovedOptionModule [
|
||||
"hardware"
|
||||
"asahi"
|
||||
"addEdgeKernelConfig"
|
||||
] "All edge kernel config options are now the default.")
|
||||
];
|
||||
|
||||
options.hardware.asahi.withRust = lib.mkOption {
|
||||
|
||||
@@ -1,47 +1,57 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config = let
|
||||
isMode = mode: (config.hardware.asahi.useExperimentalGPUDriver
|
||||
&& config.hardware.asahi.experimentalGPUInstallMode == mode);
|
||||
in lib.mkIf config.hardware.asahi.enable (lib.mkMerge [
|
||||
{
|
||||
# required for proper DRM setup even without GPU driver
|
||||
services.xserver.config = ''
|
||||
Section "OutputClass"
|
||||
Identifier "appledrm"
|
||||
MatchDriver "apple"
|
||||
Driver "modesetting"
|
||||
Option "PrimaryGPU" "true"
|
||||
EndSection
|
||||
'';
|
||||
}
|
||||
(lib.mkIf config.hardware.asahi.useExperimentalGPUDriver {
|
||||
# install the drivers
|
||||
hardware.opengl.package = config.hardware.asahi.pkgs.mesa-asahi-edge.drivers;
|
||||
|
||||
# required for in-kernel GPU driver
|
||||
hardware.asahi.withRust = true;
|
||||
})
|
||||
(lib.mkIf (isMode "replace") {
|
||||
# replace the Mesa linked into system packages with the Asahi version
|
||||
# without rebuilding them to avoid rebuilding the world.
|
||||
system.replaceRuntimeDependencies = [
|
||||
{ original = pkgs.mesa;
|
||||
replacement = config.hardware.asahi.pkgs.mesa-asahi-edge;
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config =
|
||||
let
|
||||
isMode =
|
||||
mode:
|
||||
(
|
||||
config.hardware.asahi.useExperimentalGPUDriver
|
||||
&& config.hardware.asahi.experimentalGPUInstallMode == mode
|
||||
);
|
||||
in
|
||||
lib.mkIf config.hardware.asahi.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# required for proper DRM setup even without GPU driver
|
||||
services.xserver.config = ''
|
||||
Section "OutputClass"
|
||||
Identifier "appledrm"
|
||||
MatchDriver "apple"
|
||||
Driver "modesetting"
|
||||
Option "PrimaryGPU" "true"
|
||||
EndSection
|
||||
'';
|
||||
}
|
||||
];
|
||||
})
|
||||
(lib.mkIf (isMode "overlay") {
|
||||
# replace the Mesa used in Nixpkgs with the Asahi version using an overlay,
|
||||
# which requires rebuilding the world but ensures it is done faithfully
|
||||
# (and in a way compatible with pure evaluation)
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
mesa = final.mesa-asahi-edge;
|
||||
(lib.mkIf config.hardware.asahi.useExperimentalGPUDriver {
|
||||
# install the drivers
|
||||
hardware.opengl.package = config.hardware.asahi.pkgs.mesa-asahi-edge.drivers;
|
||||
|
||||
# required for in-kernel GPU driver
|
||||
hardware.asahi.withRust = true;
|
||||
})
|
||||
];
|
||||
})
|
||||
]);
|
||||
(lib.mkIf (isMode "replace") {
|
||||
# replace the Mesa linked into system packages with the Asahi version
|
||||
# without rebuilding them to avoid rebuilding the world.
|
||||
system.replaceRuntimeDependencies = [
|
||||
{
|
||||
original = pkgs.mesa;
|
||||
replacement = config.hardware.asahi.pkgs.mesa-asahi-edge;
|
||||
}
|
||||
];
|
||||
})
|
||||
(lib.mkIf (isMode "overlay") {
|
||||
# replace the Mesa used in Nixpkgs with the Asahi version using an overlay,
|
||||
# which requires rebuilding the world but ensures it is done faithfully
|
||||
# (and in a way compatible with pure evaluation)
|
||||
nixpkgs.overlays = [ (final: prev: { mesa = final.mesa-asahi-edge; }) ];
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
options.hardware.asahi.useExperimentalGPUDriver = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
@@ -54,7 +64,11 @@
|
||||
};
|
||||
|
||||
options.hardware.asahi.experimentalGPUInstallMode = lib.mkOption {
|
||||
type = lib.types.enum [ "driver" "replace" "overlay" ];
|
||||
type = lib.types.enum [
|
||||
"driver"
|
||||
"replace"
|
||||
"overlay"
|
||||
];
|
||||
default = "replace";
|
||||
description = ''
|
||||
Mode to use to install the experimental GPU driver into the system.
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf config.hardware.asahi.enable {
|
||||
assertions = lib.mkIf config.hardware.asahi.extractPeripheralFirmware [
|
||||
{ assertion = config.hardware.asahi.peripheralFirmwareDirectory != null;
|
||||
{
|
||||
assertion = config.hardware.asahi.peripheralFirmwareDirectory != null;
|
||||
message = ''
|
||||
Asahi peripheral firmware extraction is enabled but the firmware
|
||||
location appears incorrect.
|
||||
@@ -10,26 +16,34 @@
|
||||
}
|
||||
];
|
||||
|
||||
hardware.firmware = let
|
||||
pkgs' = config.hardware.asahi.pkgs;
|
||||
in
|
||||
lib.mkIf ((config.hardware.asahi.peripheralFirmwareDirectory != null)
|
||||
&& config.hardware.asahi.extractPeripheralFirmware) [
|
||||
(pkgs.stdenv.mkDerivation {
|
||||
name = "asahi-peripheral-firmware";
|
||||
hardware.firmware =
|
||||
let
|
||||
pkgs' = config.hardware.asahi.pkgs;
|
||||
in
|
||||
lib.mkIf
|
||||
(
|
||||
(config.hardware.asahi.peripheralFirmwareDirectory != null)
|
||||
&& config.hardware.asahi.extractPeripheralFirmware
|
||||
)
|
||||
[
|
||||
(pkgs.stdenv.mkDerivation {
|
||||
name = "asahi-peripheral-firmware";
|
||||
|
||||
nativeBuildInputs = [ pkgs'.asahi-fwextract pkgs.cpio ];
|
||||
nativeBuildInputs = [
|
||||
pkgs'.asahi-fwextract
|
||||
pkgs.cpio
|
||||
];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir extracted
|
||||
asahi-fwextract ${config.hardware.asahi.peripheralFirmwareDirectory} extracted
|
||||
buildCommand = ''
|
||||
mkdir extracted
|
||||
asahi-fwextract ${config.hardware.asahi.peripheralFirmwareDirectory} extracted
|
||||
|
||||
mkdir -p $out/lib/firmware
|
||||
cat extracted/firmware.cpio | cpio -id --quiet --no-absolute-filenames
|
||||
mv vendorfw/* $out/lib/firmware
|
||||
'';
|
||||
})
|
||||
];
|
||||
mkdir -p $out/lib/firmware
|
||||
cat extracted/firmware.cpio | cpio -id --quiet --no-absolute-filenames
|
||||
mv vendorfw/* $out/lib/firmware
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
options.hardware.asahi = {
|
||||
@@ -45,13 +59,12 @@
|
||||
peripheralFirmwareDirectory = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
|
||||
default = lib.findFirst (path: builtins.pathExists (path + "/all_firmware.tar.gz")) null
|
||||
[
|
||||
# path when the system is operating normally
|
||||
/boot/asahi
|
||||
# path when the system is mounted in the installer
|
||||
/mnt/boot/asahi
|
||||
];
|
||||
default = lib.findFirst (path: builtins.pathExists (path + "/all_firmware.tar.gz")) null [
|
||||
# path when the system is operating normally
|
||||
/boot/asahi
|
||||
# path when the system is mounted in the installer
|
||||
/mnt/boot/asahi
|
||||
];
|
||||
|
||||
description = ''
|
||||
Path to the directory containing the non-free non-redistributable
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, options, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
options,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -19,72 +25,96 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.hardware.asahi;
|
||||
config =
|
||||
let
|
||||
cfg = config.hardware.asahi;
|
||||
|
||||
asahi-audio = pkgs.asahi-audio; # the asahi-audio we use
|
||||
asahi-audio = pkgs.asahi-audio; # the asahi-audio we use
|
||||
|
||||
lsp-plugins = pkgs.lsp-plugins; # the lsp-plugins we use
|
||||
lsp-plugins = pkgs.lsp-plugins; # the lsp-plugins we use
|
||||
|
||||
lsp-plugins-is-patched = (lsp-plugins.overrideAttrs (old: {
|
||||
passthru = (old.passthru or {}) // {
|
||||
lsp-plugins-is-patched = builtins.elem "58c3f985f009c84347fa91236f164a9e47aafa93.patch"
|
||||
(builtins.map (p: p.name) (old.patches or []));
|
||||
};
|
||||
})).lsp-plugins-is-patched;
|
||||
lsp-plugins-is-patched =
|
||||
(lsp-plugins.overrideAttrs (old: {
|
||||
passthru = (old.passthru or { }) // {
|
||||
lsp-plugins-is-patched = builtins.elem "58c3f985f009c84347fa91236f164a9e47aafa93.patch" (
|
||||
builtins.map (p: p.name) (old.patches or [ ])
|
||||
);
|
||||
};
|
||||
})).lsp-plugins-is-patched;
|
||||
|
||||
lsp-plugins-is-safe = (pkgs.lib.versionAtLeast lsp-plugins.version "1.2.14") || lsp-plugins-is-patched;
|
||||
lsp-plugins-is-safe =
|
||||
(pkgs.lib.versionAtLeast lsp-plugins.version "1.2.14") || lsp-plugins-is-patched;
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/pull/282377
|
||||
# options is the set of all module option declarations, rather than their
|
||||
# values, to prevent infinite recursion
|
||||
newHotness = builtins.hasAttr "configPackages" options.services.pipewire;
|
||||
# https://github.com/NixOS/nixpkgs/pull/282377
|
||||
# options is the set of all module option declarations, rather than their
|
||||
# values, to prevent infinite recursion
|
||||
newHotness = builtins.hasAttr "configPackages" options.services.pipewire;
|
||||
|
||||
lv2Path = lib.makeSearchPath "lib/lv2" [ lsp-plugins pkgs.bankstown-lv2 ];
|
||||
in lib.mkIf (cfg.setupAsahiSound && cfg.enable) (lib.mkMerge [
|
||||
{
|
||||
# enable pipewire to run real-time and avoid audible glitches
|
||||
security.rtkit.enable = true;
|
||||
# set up pipewire with the supported capabilities (instead of pulseaudio)
|
||||
# and asahi-audio configs and plugins
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
lv2Path = lib.makeSearchPath "lib/lv2" [
|
||||
lsp-plugins
|
||||
pkgs.bankstown-lv2
|
||||
];
|
||||
in
|
||||
lib.mkIf (cfg.setupAsahiSound && cfg.enable) (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# enable pipewire to run real-time and avoid audible glitches
|
||||
security.rtkit.enable = true;
|
||||
# set up pipewire with the supported capabilities (instead of pulseaudio)
|
||||
# and asahi-audio configs and plugins
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
|
||||
# set up enivronment so that UCM configs are used as well
|
||||
environment.variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf-asahi}/share/alsa/ucm2";
|
||||
systemd.user.services.pipewire.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
|
||||
systemd.user.services.wireplumber.environment.ALSA_CONFIG_UCM2 = config.environment.variables.ALSA_CONFIG_UCM2;
|
||||
# set up enivronment so that UCM configs are used as well
|
||||
environment.variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf-asahi}/share/alsa/ucm2";
|
||||
systemd.user.services.pipewire.environment.ALSA_CONFIG_UCM2 =
|
||||
config.environment.variables.ALSA_CONFIG_UCM2;
|
||||
systemd.user.services.wireplumber.environment.ALSA_CONFIG_UCM2 =
|
||||
config.environment.variables.ALSA_CONFIG_UCM2;
|
||||
|
||||
# enable speakersafetyd to protect speakers
|
||||
systemd.packages = lib.mkAssert lsp-plugins-is-safe
|
||||
"lsp-plugins is unpatched/outdated and speakers cannot be safely enabled"
|
||||
[ pkgs.speakersafetyd ];
|
||||
services.udev.packages = [ pkgs.speakersafetyd ];
|
||||
}
|
||||
(lib.optionalAttrs newHotness {
|
||||
# use configPackages and friends to install asahi-audio and plugins
|
||||
services.pipewire = {
|
||||
configPackages = [ asahi-audio ];
|
||||
extraLv2Packages = [ lsp-plugins pkgs.bankstown-lv2 ];
|
||||
wireplumber = {
|
||||
configPackages = [ asahi-audio ];
|
||||
extraLv2Packages = [ lsp-plugins pkgs.bankstown-lv2 ];
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.optionalAttrs (!newHotness) {
|
||||
# use environment.etc and environment variables to install asahi-audio and plugins
|
||||
environment.etc = builtins.listToAttrs (builtins.map
|
||||
(f: { name = f; value = { source = "${asahi-audio}/share/${f}"; }; })
|
||||
asahi-audio.providedConfigFiles);
|
||||
# enable speakersafetyd to protect speakers
|
||||
systemd.packages =
|
||||
lib.mkAssert lsp-plugins-is-safe
|
||||
"lsp-plugins is unpatched/outdated and speakers cannot be safely enabled"
|
||||
[ pkgs.speakersafetyd ];
|
||||
services.udev.packages = [ pkgs.speakersafetyd ];
|
||||
}
|
||||
(lib.optionalAttrs newHotness {
|
||||
# use configPackages and friends to install asahi-audio and plugins
|
||||
services.pipewire = {
|
||||
configPackages = [ asahi-audio ];
|
||||
extraLv2Packages = [
|
||||
lsp-plugins
|
||||
pkgs.bankstown-lv2
|
||||
];
|
||||
wireplumber = {
|
||||
configPackages = [ asahi-audio ];
|
||||
extraLv2Packages = [
|
||||
lsp-plugins
|
||||
pkgs.bankstown-lv2
|
||||
];
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.optionalAttrs (!newHotness) {
|
||||
# use environment.etc and environment variables to install asahi-audio and plugins
|
||||
environment.etc = builtins.listToAttrs (
|
||||
builtins.map (f: {
|
||||
name = f;
|
||||
value = {
|
||||
source = "${asahi-audio}/share/${f}";
|
||||
};
|
||||
}) asahi-audio.providedConfigFiles
|
||||
);
|
||||
|
||||
systemd.user.services.pipewire.environment.LV2_PATH = lv2Path;
|
||||
systemd.user.services.wireplumber.environment.LV2_PATH = lv2Path;
|
||||
})
|
||||
]);
|
||||
systemd.user.services.pipewire.environment.LV2_PATH = lv2Path;
|
||||
systemd.user.services.wireplumber.environment.LV2_PATH = lv2Path;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, alsa-ucm-conf }:
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
alsa-ucm-conf,
|
||||
}:
|
||||
|
||||
(alsa-ucm-conf.overrideAttrs (oldAttrs: rec {
|
||||
version = "5";
|
||||
@@ -12,8 +14,10 @@
|
||||
rev = "v${version}";
|
||||
hash = "sha256-daUNz5oUrPfSMO0Tqq/WbtiLHMOtPeQQlI+juGrhTxw=";
|
||||
};
|
||||
|
||||
postInstall = oldAttrs.postInstall or "" + ''
|
||||
cp -r ${src_asahi}/ucm2 $out/share/alsa
|
||||
'';
|
||||
|
||||
postInstall =
|
||||
oldAttrs.postInstall or ""
|
||||
+ ''
|
||||
cp -r ${src_asahi}/ucm2 $out/share/alsa
|
||||
'';
|
||||
}))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{ lib
|
||||
, python3
|
||||
, fetchFromGitHub
|
||||
, gzip
|
||||
, gnutar
|
||||
, lzfse
|
||||
{
|
||||
lib,
|
||||
python3,
|
||||
fetchFromGitHub,
|
||||
gzip,
|
||||
gnutar,
|
||||
lzfse,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{ lib
|
||||
, lv2
|
||||
, pkg-config
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
{
|
||||
lib,
|
||||
lv2,
|
||||
pkg-config,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@@ -28,11 +29,7 @@ rustPlatform.buildRustPackage rec {
|
||||
make install
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
lv2
|
||||
];
|
||||
buildInputs = [ lv2 ];
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, callPackage
|
||||
, writeShellScriptBin
|
||||
, writeText
|
||||
, removeReferencesTo
|
||||
, linuxPackagesFor
|
||||
, withRust ? false
|
||||
, _kernelPatches ? [ ]
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
callPackage,
|
||||
writeShellScriptBin,
|
||||
writeText,
|
||||
removeReferencesTo,
|
||||
linuxPackagesFor,
|
||||
withRust ? false,
|
||||
_kernelPatches ? [ ],
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -14,67 +15,107 @@ let
|
||||
|
||||
# parse <OPT> [ymn]|foo style configuration as found in a patch's extraConfig
|
||||
# into a list of k, v tuples
|
||||
parseExtraConfig = config:
|
||||
parseExtraConfig =
|
||||
config:
|
||||
let
|
||||
lines =
|
||||
builtins.filter (s: s != "") (lib.strings.splitString "\n" config);
|
||||
parseLine = line: let
|
||||
t = lib.strings.splitString " " line;
|
||||
join = l: builtins.foldl' (a: b: "${a} ${b}")
|
||||
(builtins.head l) (builtins.tail l);
|
||||
v = if (builtins.length t) > 2 then join (builtins.tail t) else (i t 1);
|
||||
in [ "CONFIG_${i t 0}" v ];
|
||||
in map parseLine lines;
|
||||
lines = builtins.filter (s: s != "") (lib.strings.splitString "\n" config);
|
||||
parseLine =
|
||||
line:
|
||||
let
|
||||
t = lib.strings.splitString " " line;
|
||||
join = l: builtins.foldl' (a: b: "${a} ${b}") (builtins.head l) (builtins.tail l);
|
||||
v = if (builtins.length t) > 2 then join (builtins.tail t) else (i t 1);
|
||||
in
|
||||
[
|
||||
"CONFIG_${i t 0}"
|
||||
v
|
||||
];
|
||||
in
|
||||
map parseLine lines;
|
||||
|
||||
# parse <OPT>=lib.kernel.(yes|module|no)|lib.kernel.freeform "foo"
|
||||
# style configuration as found in a patch's extraStructuredConfig into
|
||||
# a list of k, v tuples
|
||||
parseExtraStructuredConfig = config: lib.attrsets.mapAttrsToList
|
||||
(k: v: [ "CONFIG_${k}" (v.tristate or v.freeform) ] ) config;
|
||||
parseExtraStructuredConfig =
|
||||
config:
|
||||
lib.attrsets.mapAttrsToList (k: v: [
|
||||
"CONFIG_${k}"
|
||||
(v.tristate or v.freeform)
|
||||
]) config;
|
||||
|
||||
parsePatchConfig = { extraConfig ? "", extraStructuredConfig ? {}, ... }:
|
||||
(parseExtraConfig extraConfig) ++
|
||||
(parseExtraStructuredConfig extraStructuredConfig);
|
||||
parsePatchConfig =
|
||||
{
|
||||
extraConfig ? "",
|
||||
extraStructuredConfig ? { },
|
||||
...
|
||||
}:
|
||||
(parseExtraConfig extraConfig) ++ (parseExtraStructuredConfig extraStructuredConfig);
|
||||
|
||||
# parse CONFIG_<OPT>=[ymn]|"foo" style configuration as found in a config file
|
||||
# into a list of k, v tuples
|
||||
parseConfig = config:
|
||||
parseConfig =
|
||||
config:
|
||||
let
|
||||
parseLine = builtins.match ''(CONFIG_[[:upper:][:digit:]_]+)=(([ymn])|"([^"]*)")'';
|
||||
# get either the [ymn] option or the "foo" option; whichever matched
|
||||
t = l: let v = (i l 2); in [ (i l 0) (if v != null then v else (i l 3)) ];
|
||||
t =
|
||||
l:
|
||||
let
|
||||
v = (i l 2);
|
||||
in
|
||||
[
|
||||
(i l 0)
|
||||
(if v != null then v else (i l 3))
|
||||
];
|
||||
lines = lib.strings.splitString "\n" config;
|
||||
in map t (builtins.filter (l: l != null) (map parseLine lines));
|
||||
in
|
||||
map t (builtins.filter (l: l != null) (map parseLine lines));
|
||||
|
||||
origConfigfile = ./config;
|
||||
|
||||
linux-asahi-pkg = { stdenv, lib, fetchFromGitHub, fetchpatch, linuxKernel,
|
||||
rustPlatform, rustc, rustfmt, rust-bindgen, ... } @ args:
|
||||
linux-asahi-pkg =
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
linuxKernel,
|
||||
rustPlatform,
|
||||
rustc,
|
||||
rustfmt,
|
||||
rust-bindgen,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
origConfigText = builtins.readFile origConfigfile;
|
||||
|
||||
# extraConfig from all patches in order
|
||||
extraConfig =
|
||||
lib.fold (patch: ex: ex ++ (parsePatchConfig patch)) [] _kernelPatches;
|
||||
extraConfig = lib.fold (patch: ex: ex ++ (parsePatchConfig patch)) [ ] _kernelPatches;
|
||||
# config file text for above
|
||||
extraConfigText = let
|
||||
text = k: v: if (v == "y") || (v == "m") || (v == "n")
|
||||
then "${k}=${v}" else ''${k}="${v}"'';
|
||||
in (map (t: text (i t 0) (i t 1)) extraConfig);
|
||||
extraConfigText =
|
||||
let
|
||||
text = k: v: if (v == "y") || (v == "m") || (v == "n") then "${k}=${v}" else ''${k}="${v}"'';
|
||||
in
|
||||
(map (t: text (i t 0) (i t 1)) extraConfig);
|
||||
|
||||
# final config as a text file path
|
||||
configfile = if extraConfig == [] then origConfigfile else
|
||||
writeText "config" ''
|
||||
${origConfigText}
|
||||
configfile =
|
||||
if extraConfig == [ ] then
|
||||
origConfigfile
|
||||
else
|
||||
writeText "config" ''
|
||||
${origConfigText}
|
||||
|
||||
# Patches
|
||||
${lib.strings.concatStringsSep "\n" extraConfigText}
|
||||
'';
|
||||
# Patches
|
||||
${lib.strings.concatStringsSep "\n" extraConfigText}
|
||||
'';
|
||||
# final config as an attrset
|
||||
configAttrs = let
|
||||
makePair = t: lib.nameValuePair (i t 0) (i t 1);
|
||||
configList = (parseConfig origConfigText) ++ extraConfig;
|
||||
in builtins.listToAttrs (map makePair (lib.lists.reverseList configList));
|
||||
configAttrs =
|
||||
let
|
||||
makePair = t: lib.nameValuePair (i t 0) (i t 1);
|
||||
configList = (parseConfig origConfigText) ++ extraConfig;
|
||||
in
|
||||
builtins.listToAttrs (map makePair (lib.lists.reverseList configList));
|
||||
|
||||
# used to (ostensibly) keep compatibility for those running stable versions of nixos
|
||||
rustOlder = version: withRust && (lib.versionOlder rustc.version version);
|
||||
@@ -84,71 +125,94 @@ let
|
||||
rustAtLeast = version: withRust && (lib.versionAtLeast rustc.version version);
|
||||
bindgenAtLeast = version: withRust && (lib.versionAtLeast rust-bindgen.unwrapped.version version);
|
||||
in
|
||||
(linuxKernel.manualConfig rec {
|
||||
inherit stdenv lib;
|
||||
(
|
||||
linuxKernel.manualConfig rec {
|
||||
inherit stdenv lib;
|
||||
|
||||
version = "6.6.0-asahi";
|
||||
modDirVersion = version;
|
||||
extraMeta.branch = "6.6";
|
||||
version = "6.6.0-asahi";
|
||||
modDirVersion = version;
|
||||
extraMeta.branch = "6.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
# tracking: https://github.com/AsahiLinux/linux/tree/asahi-wip (w/ fedora verification)
|
||||
owner = "AsahiLinux";
|
||||
repo = "linux";
|
||||
rev = "asahi-6.6-15";
|
||||
hash = "sha256-Jm7wTKWuwd/6ZN0g5F4CNNETiOyGQL31hfSyTDYH85k=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
# tracking: https://github.com/AsahiLinux/linux/tree/asahi-wip (w/ fedora verification)
|
||||
owner = "AsahiLinux";
|
||||
repo = "linux";
|
||||
rev = "asahi-6.6-15";
|
||||
hash = "sha256-Jm7wTKWuwd/6ZN0g5F4CNNETiOyGQL31hfSyTDYH85k=";
|
||||
};
|
||||
|
||||
kernelPatches = [
|
||||
{ name = "coreutils-fix";
|
||||
patch = ./0001-fs-fcntl-accept-more-values-as-F_DUPFD_CLOEXEC-args.patch;
|
||||
}
|
||||
# speaker enablement; we assert on the relevant lsp-plugins patch
|
||||
# before installing speakersafetyd to let the speakers work
|
||||
{ name = "speakers-1";
|
||||
patch = fetchpatch {
|
||||
url = "https://github.com/AsahiLinux/linux/commit/385ea7b5023486aba7919cec8b6b3f6a843a1013.patch";
|
||||
hash = "sha256-u7IzhJbUgBPfhJXAcpHw1I6OPzPHc1UKYjH91Ep3QHQ=";
|
||||
};
|
||||
}
|
||||
{ name = "speakers-2";
|
||||
patch = fetchpatch {
|
||||
url = "https://github.com/AsahiLinux/linux/commit/6a24102c06c95951ab992e2d41336cc6d4bfdf23.patch";
|
||||
hash = "sha256-wn5x2hN42/kCp/XHBvLWeNLfwlOBB+T6UeeMt2tSg3o=";
|
||||
};
|
||||
}
|
||||
] ++ lib.optionals (rustAtLeast "1.75.0") [
|
||||
{ name = "rustc-1.75.0";
|
||||
patch = ./0001-check-in-new-alloc-for-1.75.0.patch;
|
||||
}
|
||||
] ++ lib.optionals (rustAtLeast "1.76.0") [
|
||||
{ name = "rustc-1.76.0";
|
||||
patch = ./rust_1_76_0.patch;
|
||||
}
|
||||
] ++ _kernelPatches;
|
||||
kernelPatches =
|
||||
[
|
||||
{
|
||||
name = "coreutils-fix";
|
||||
patch = ./0001-fs-fcntl-accept-more-values-as-F_DUPFD_CLOEXEC-args.patch;
|
||||
}
|
||||
# speaker enablement; we assert on the relevant lsp-plugins patch
|
||||
# before installing speakersafetyd to let the speakers work
|
||||
{
|
||||
name = "speakers-1";
|
||||
patch = fetchpatch {
|
||||
url = "https://github.com/AsahiLinux/linux/commit/385ea7b5023486aba7919cec8b6b3f6a843a1013.patch";
|
||||
hash = "sha256-u7IzhJbUgBPfhJXAcpHw1I6OPzPHc1UKYjH91Ep3QHQ=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "speakers-2";
|
||||
patch = fetchpatch {
|
||||
url = "https://github.com/AsahiLinux/linux/commit/6a24102c06c95951ab992e2d41336cc6d4bfdf23.patch";
|
||||
hash = "sha256-wn5x2hN42/kCp/XHBvLWeNLfwlOBB+T6UeeMt2tSg3o=";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ lib.optionals (rustAtLeast "1.75.0") [
|
||||
{
|
||||
name = "rustc-1.75.0";
|
||||
patch = ./0001-check-in-new-alloc-for-1.75.0.patch;
|
||||
}
|
||||
]
|
||||
++ lib.optionals (rustAtLeast "1.76.0") [
|
||||
{
|
||||
name = "rustc-1.76.0";
|
||||
patch = ./rust_1_76_0.patch;
|
||||
}
|
||||
]
|
||||
++ _kernelPatches;
|
||||
|
||||
inherit configfile;
|
||||
# hide Rust support from the nixpkgs infra to avoid it re-adding the rust packages.
|
||||
# we can't use it until it's in stable and until we've evaluated the cross-compilation impact.
|
||||
config = configAttrs // { "CONFIG_RUST" = "n"; };
|
||||
} // (args.argsOverride or {})).overrideAttrs (old: if withRust then {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [
|
||||
rust-bindgen
|
||||
rustfmt
|
||||
rustc
|
||||
removeReferencesTo
|
||||
];
|
||||
# HACK: references shouldn't have been there in the first place
|
||||
# TODO: remove once 23.05 is obsolete
|
||||
postFixup = (old.postFixup or "") + ''
|
||||
if [ -f $dev/lib/modules/${old.version}/build/vmlinux ]; then
|
||||
remove-references-to -t $out $dev/lib/modules/${old.version}/build/vmlinux
|
||||
fi
|
||||
remove-references-to -t $dev $out/Image
|
||||
'';
|
||||
RUST_LIB_SRC = rustPlatform.rustLibSrc;
|
||||
} else {});
|
||||
inherit configfile;
|
||||
# hide Rust support from the nixpkgs infra to avoid it re-adding the rust packages.
|
||||
# we can't use it until it's in stable and until we've evaluated the cross-compilation impact.
|
||||
config = configAttrs // {
|
||||
"CONFIG_RUST" = "n";
|
||||
};
|
||||
}
|
||||
// (args.argsOverride or { })
|
||||
).overrideAttrs
|
||||
(
|
||||
old:
|
||||
if withRust then
|
||||
{
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
rust-bindgen
|
||||
rustfmt
|
||||
rustc
|
||||
removeReferencesTo
|
||||
];
|
||||
# HACK: references shouldn't have been there in the first place
|
||||
# TODO: remove once 23.05 is obsolete
|
||||
postFixup =
|
||||
(old.postFixup or "")
|
||||
+ ''
|
||||
if [ -f $dev/lib/modules/${old.version}/build/vmlinux ]; then
|
||||
remove-references-to -t $out $dev/lib/modules/${old.version}/build/vmlinux
|
||||
fi
|
||||
remove-references-to -t $dev $out/Image
|
||||
'';
|
||||
RUST_LIB_SRC = rustPlatform.rustLibSrc;
|
||||
}
|
||||
else
|
||||
{ }
|
||||
);
|
||||
|
||||
linux-asahi = (callPackage linux-asahi-pkg { });
|
||||
in lib.recurseIntoAttrs (linuxPackagesFor linux-asahi)
|
||||
|
||||
in
|
||||
lib.recurseIntoAttrs (linuxPackagesFor linux-asahi)
|
||||
|
||||
@@ -1,29 +1,33 @@
|
||||
{ stdenv
|
||||
, buildPackages
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, python3
|
||||
, dtc
|
||||
, imagemagick
|
||||
, isRelease ? false
|
||||
, withTools ? true
|
||||
, withChainloading ? false
|
||||
, rust-bin ? null
|
||||
, customLogo ? null
|
||||
{
|
||||
stdenv,
|
||||
buildPackages,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
python3,
|
||||
dtc,
|
||||
imagemagick,
|
||||
isRelease ? false,
|
||||
withTools ? true,
|
||||
withChainloading ? false,
|
||||
rust-bin ? null,
|
||||
customLogo ? null,
|
||||
}:
|
||||
|
||||
assert withChainloading -> rust-bin != null;
|
||||
|
||||
let
|
||||
pyenv = python3.withPackages (p: with p; [
|
||||
construct
|
||||
pyserial
|
||||
]);
|
||||
pyenv = python3.withPackages (
|
||||
p: with p; [
|
||||
construct
|
||||
pyserial
|
||||
]
|
||||
);
|
||||
|
||||
rustenv = rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal.override {
|
||||
targets = [ "aarch64-unknown-none-softfloat" ];
|
||||
});
|
||||
in stdenv.mkDerivation rec {
|
||||
rustenv = rust-bin.selectLatestNightlyWith (
|
||||
toolchain: toolchain.minimal.override { targets = [ "aarch64-unknown-none-softfloat" ]; }
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "m1n1";
|
||||
version = "1.4.11";
|
||||
|
||||
@@ -36,15 +40,14 @@ in stdenv.mkDerivation rec {
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
makeFlags = [ "ARCH=${stdenv.cc.targetPrefix}" ]
|
||||
++ lib.optional isRelease "RELEASE=1"
|
||||
++ lib.optional withChainloading "CHAINLOADING=1";
|
||||
makeFlags = [
|
||||
"ARCH=${stdenv.cc.targetPrefix}"
|
||||
] ++ lib.optional isRelease "RELEASE=1" ++ lib.optional withChainloading "CHAINLOADING=1";
|
||||
|
||||
nativeBuildInputs = [
|
||||
dtc
|
||||
buildPackages.gcc
|
||||
] ++ lib.optional withChainloading rustenv
|
||||
++ lib.optional (customLogo != null) imagemagick;
|
||||
] ++ lib.optional withChainloading rustenv ++ lib.optional (customLogo != null) imagemagick;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace proxyclient/m1n1/asm.py \
|
||||
@@ -67,35 +70,38 @@ in stdenv.mkDerivation rec {
|
||||
popd &>/dev/null
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
installPhase =
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/build
|
||||
cp build/m1n1.bin $out/build
|
||||
'' + (lib.optionalString withTools ''
|
||||
mkdir -p $out/{bin,script,toolchain-bin}
|
||||
cp -r proxyclient $out/script
|
||||
cp -r tools $out/script
|
||||
mkdir -p $out/build
|
||||
cp build/m1n1.bin $out/build
|
||||
''
|
||||
+ (lib.optionalString withTools ''
|
||||
mkdir -p $out/{bin,script,toolchain-bin}
|
||||
cp -r proxyclient $out/script
|
||||
cp -r tools $out/script
|
||||
|
||||
for toolpath in $out/script/proxyclient/tools/*.py; do
|
||||
tool=$(basename $toolpath .py)
|
||||
script=$out/bin/m1n1-$tool
|
||||
cat > $script <<EOF
|
||||
#!/bin/sh
|
||||
${pyenv}/bin/python $toolpath "\$@"
|
||||
EOF
|
||||
chmod +x $script
|
||||
done
|
||||
for toolpath in $out/script/proxyclient/tools/*.py; do
|
||||
tool=$(basename $toolpath .py)
|
||||
script=$out/bin/m1n1-$tool
|
||||
cat > $script <<EOF
|
||||
#!/bin/sh
|
||||
${pyenv}/bin/python $toolpath "\$@"
|
||||
EOF
|
||||
chmod +x $script
|
||||
done
|
||||
|
||||
GCC=${buildPackages.gcc}
|
||||
BINUTILS=${buildPackages.binutils-unwrapped}
|
||||
GCC=${buildPackages.gcc}
|
||||
BINUTILS=${buildPackages.binutils-unwrapped}
|
||||
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}gcc $out/toolchain-bin/
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}ld $out/toolchain-bin/
|
||||
ln -s $BINUTILS/bin/${stdenv.cc.targetPrefix}objcopy $out/toolchain-bin/
|
||||
ln -s $BINUTILS/bin/${stdenv.cc.targetPrefix}objdump $out/toolchain-bin/
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}nm $out/toolchain-bin/
|
||||
'') + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}gcc $out/toolchain-bin/
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}ld $out/toolchain-bin/
|
||||
ln -s $BINUTILS/bin/${stdenv.cc.targetPrefix}objcopy $out/toolchain-bin/
|
||||
ln -s $BINUTILS/bin/${stdenv.cc.targetPrefix}objdump $out/toolchain-bin/
|
||||
ln -s $GCC/bin/${stdenv.cc.targetPrefix}nm $out/toolchain-bin/
|
||||
'')
|
||||
+ ''
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,49 +1,56 @@
|
||||
{ lib
|
||||
, fetchFromGitLab
|
||||
, mesa
|
||||
, meson
|
||||
, llvmPackages
|
||||
{
|
||||
lib,
|
||||
fetchFromGitLab,
|
||||
mesa,
|
||||
meson,
|
||||
llvmPackages,
|
||||
}:
|
||||
|
||||
(mesa.override {
|
||||
galliumDrivers = [ "swrast" "asahi" ];
|
||||
galliumDrivers = [
|
||||
"swrast"
|
||||
"asahi"
|
||||
];
|
||||
vulkanDrivers = [ "swrast" ];
|
||||
enableGalliumNine = false;
|
||||
# libclc and other OpenCL components are needed for geometry shader support on Apple Silicon
|
||||
enableOpenCL = true;
|
||||
}).overrideAttrs (oldAttrs: {
|
||||
# version must be the same length (i.e. no unstable or date)
|
||||
# so that system.replaceRuntimeDependencies can work
|
||||
version = "24.1.0";
|
||||
src = fetchFromGitLab {
|
||||
# tracking: https://pagure.io/fedora-asahi/mesa/commits/asahi
|
||||
domain = "gitlab.freedesktop.org";
|
||||
owner = "asahi";
|
||||
repo = "mesa";
|
||||
rev = "asahi-20240228";
|
||||
hash = "sha256-wOFJyYfoN6yxE9HaHXLP/0MhjyRvmlb+jPPUke0sbbE=";
|
||||
};
|
||||
}).overrideAttrs
|
||||
(oldAttrs: {
|
||||
# version must be the same length (i.e. no unstable or date)
|
||||
# so that system.replaceRuntimeDependencies can work
|
||||
version = "24.1.0";
|
||||
src = fetchFromGitLab {
|
||||
# tracking: https://pagure.io/fedora-asahi/mesa/commits/asahi
|
||||
domain = "gitlab.freedesktop.org";
|
||||
owner = "asahi";
|
||||
repo = "mesa";
|
||||
rev = "asahi-20240228";
|
||||
hash = "sha256-wOFJyYfoN6yxE9HaHXLP/0MhjyRvmlb+jPPUke0sbbE=";
|
||||
};
|
||||
|
||||
mesonFlags =
|
||||
# remove flag to configure xvmc functionality as having it
|
||||
# breaks the build because that no longer exists in Mesa 23
|
||||
(lib.filter (x: !(lib.hasPrefix "-Dxvmc-libs-path=" x)) oldAttrs.mesonFlags) ++ [
|
||||
# we do not build any graphics drivers these features can be enabled for
|
||||
"-Dgallium-va=disabled"
|
||||
"-Dgallium-vdpau=disabled"
|
||||
"-Dgallium-xa=disabled"
|
||||
# does not make any sense
|
||||
"-Dandroid-libbacktrace=disabled"
|
||||
# do not want to add the dependencies
|
||||
"-Dlibunwind=disabled"
|
||||
"-Dlmsensors=disabled"
|
||||
] ++ ( # does not compile on nixpkgs stable, doesn't seem mandatory
|
||||
lib.optional (lib.versionOlder meson.version "1.3.1")
|
||||
"-Dgallium-rusticl=false");
|
||||
mesonFlags =
|
||||
# remove flag to configure xvmc functionality as having it
|
||||
# breaks the build because that no longer exists in Mesa 23
|
||||
(lib.filter (x: !(lib.hasPrefix "-Dxvmc-libs-path=" x)) oldAttrs.mesonFlags)
|
||||
++ [
|
||||
# we do not build any graphics drivers these features can be enabled for
|
||||
"-Dgallium-va=disabled"
|
||||
"-Dgallium-vdpau=disabled"
|
||||
"-Dgallium-xa=disabled"
|
||||
# does not make any sense
|
||||
"-Dandroid-libbacktrace=disabled"
|
||||
# do not want to add the dependencies
|
||||
"-Dlibunwind=disabled"
|
||||
"-Dlmsensors=disabled"
|
||||
]
|
||||
++
|
||||
# does not compile on nixpkgs stable, doesn't seem mandatory
|
||||
(lib.optional (lib.versionOlder meson.version "1.3.1") "-Dgallium-rusticl=false");
|
||||
|
||||
# replace patches with ones tweaked slightly to apply to this version
|
||||
patches = [
|
||||
./disk_cache-include-dri-driver-path-in-cache-key.patch
|
||||
./opencl.patch
|
||||
];
|
||||
})
|
||||
# replace patches with ones tweaked slightly to apply to this version
|
||||
patches = [
|
||||
./disk_cache-include-dri-driver-path-in-cache-key.patch
|
||||
./opencl.patch
|
||||
];
|
||||
})
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{ rustPlatform
|
||||
, stdenv
|
||||
, rust
|
||||
, fetchCrate
|
||||
, pkg-config
|
||||
, alsa-lib
|
||||
{
|
||||
rustPlatform,
|
||||
stdenv,
|
||||
rust,
|
||||
fetchCrate,
|
||||
pkg-config,
|
||||
alsa-lib,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildUBoot
|
||||
, m1n1
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildUBoot,
|
||||
m1n1,
|
||||
}:
|
||||
|
||||
(buildUBoot rec {
|
||||
@@ -27,17 +28,17 @@
|
||||
CONFIG_VIDEO_FONT_SUN12X22=n
|
||||
CONFIG_VIDEO_FONT_16X32=y
|
||||
'';
|
||||
}).overrideAttrs (o: {
|
||||
# nixos's downstream patches are not applicable
|
||||
patches = [
|
||||
];
|
||||
}).overrideAttrs
|
||||
(o: {
|
||||
# nixos's downstream patches are not applicable
|
||||
patches = [ ];
|
||||
|
||||
# DTC= flag somehow breaks DTC compilation so we remove it
|
||||
makeFlags = builtins.filter (s: (!(lib.strings.hasPrefix "DTC=" s))) o.makeFlags;
|
||||
# DTC= flag somehow breaks DTC compilation so we remove it
|
||||
makeFlags = builtins.filter (s: (!(lib.strings.hasPrefix "DTC=" s))) o.makeFlags;
|
||||
|
||||
preInstall = ''
|
||||
# compress so that m1n1 knows U-Boot's size and can find things after it
|
||||
gzip -n u-boot-nodtb.bin
|
||||
cat ${m1n1}/build/m1n1.bin arch/arm/dts/t[68]*.dtb u-boot-nodtb.bin.gz > m1n1-u-boot.bin
|
||||
'';
|
||||
})
|
||||
preInstall = ''
|
||||
# compress so that m1n1 knows U-Boot's size and can find things after it
|
||||
gzip -n u-boot-nodtb.bin
|
||||
cat ${m1n1}/build/m1n1.bin arch/arm/dts/t[68]*.dtb u-boot-nodtb.bin.gz > m1n1-u-boot.bin
|
||||
'';
|
||||
})
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../default.nix
|
||||
];
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../default.nix
|
||||
];
|
||||
|
||||
hardware.asahi.enable = true;
|
||||
hardware.asahi.useExperimentalGPUDriver = true;
|
||||
@@ -26,7 +31,7 @@
|
||||
'';
|
||||
|
||||
networking.hostName = "mac-nixos"; # Define your hostname.
|
||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
|
||||
services = {
|
||||
# Enable the X11 windowing system.
|
||||
@@ -105,6 +110,4 @@
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +1,66 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "none";
|
||||
fsType = "tmpfs";
|
||||
};
|
||||
fileSystems."/" = {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
};
|
||||
|
||||
fileSystems."/etc" =
|
||||
{ device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=etc" ];
|
||||
};
|
||||
fileSystems."/etc" = {
|
||||
device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=etc" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" =
|
||||
{ device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=log" ];
|
||||
};
|
||||
fileSystems."/var/log" = {
|
||||
device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=log" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
fileSystems."/root" =
|
||||
{ device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=root" ];
|
||||
};
|
||||
fileSystems."/root" = {
|
||||
device = "/dev/disk/by-uuid/19b99a76-0285-443a-a83c-a00a5fab54f5";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=root" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/F4A1-C77F";
|
||||
fsType = "vfat";
|
||||
};
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/F4A1-C77F";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# fileSystems."/boot" =
|
||||
# { device = "/dev/disk/by-uuid/3aaa1d0e-057d-4b7d-b2fe-ef02db373e9f";
|
||||
# fsType = "ext4";
|
||||
# };
|
||||
# fileSystems."/boot" =
|
||||
# { device = "/dev/disk/by-uuid/3aaa1d0e-057d-4b7d-b2fe-ef02db373e9f";
|
||||
# fsType = "ext4";
|
||||
# };
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
gnome.gnome-tweaks
|
||||
papirus-icon-theme
|
||||
];
|
||||
|
||||
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
@@ -50,7 +50,7 @@
|
||||
"org/gnome/desktop/interface".icon-theme = "Papirus-Dark";
|
||||
"org/gnome/desktop/peripherals/touchpad".two-finger-scrolling-enabled = true;
|
||||
"org/gnome/desktop/peripherals/touchpad".tap-to-click = true;
|
||||
"org/gnome/mutter".experimental-features = ["scale-monitor-framebuffer"];
|
||||
"org/gnome/mutter".experimental-features = [ "scale-monitor-framebuffer" ];
|
||||
"org/gnome/tweaks".show-extensions-notice = false;
|
||||
"org/gnome/shell".enabled-extensions = [
|
||||
"appindicatorsupport@rgcjonas.gmail.com"
|
||||
|
||||
Reference in New Issue
Block a user