From 8ea328d20d6585290d5eb89a5aef7bfd71b85d82 Mon Sep 17 00:00:00 2001 From: Faris Date: Mon, 8 Jun 2026 01:57:04 +0100 Subject: [PATCH] Revert to Gnome --- config/desktop.nix | 62 +++---- config/gnome.nix | 25 ++- config/hyprland.nix | 15 +- flake.nix | 9 +- home/common.nix | 1 - home/hyprland.nix | 163 ++++++++++-------- .../apple-silicon-support/default.nix | 7 - .../modules/boot-m1n1/default.nix | 68 -------- .../apple-silicon-support/modules/default.nix | 87 ---------- .../modules/kernel/default.nix | 114 ------------ .../modules/peripheral-firmware/default.nix | 82 --------- .../modules/sound/default.nix | 65 ------- .../packages/linux-asahi/default.nix | 64 ------- .../packages/overlay.nix | 19 -- .../packages/uboot-asahi/default.nix | 45 ----- 15 files changed, 152 insertions(+), 674 deletions(-) delete mode 100644 hosts/macbook-air/apple-silicon-support/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/modules/boot-m1n1/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/modules/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/modules/kernel/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/modules/peripheral-firmware/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/modules/sound/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/packages/linux-asahi/default.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/packages/overlay.nix delete mode 100644 hosts/macbook-air/apple-silicon-support/packages/uboot-asahi/default.nix diff --git a/config/desktop.nix b/config/desktop.nix index a97ebe3..0f2b61f 100644 --- a/config/desktop.nix +++ b/config/desktop.nix @@ -11,9 +11,6 @@ qt.style = "adwaita-dark"; qt.platformTheme = "gnome"; - #hyprland - services.displayManager.sddm.enable = true; # use sddm until gnome 50 due to https://github.com/systemd/systemd/issues/39259 - services.displayManager.sddm.wayland.enable = true; hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; @@ -31,8 +28,6 @@ # Enable automatic login for the user. # services.displayManager.autoLogin.enable = true; # services.displayManager.autoLogin.user = "admin"; - # services.gnome.gnome-keyring.enable = true; - # security.pam.services.gdm.enableGnomeKeyring = true; #unlock PAM # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 systemd.services."getty@tty1".enable = false; @@ -42,15 +37,15 @@ # "--config=/mnt/services/emulators/retroarch/retroarch.cfg" #]; - services.ollama = { - enable = true; - openFirewall = true; - host = "0.0.0.0"; - # Optional: preload models, see https://ollama.com/library - loadModels = [ "gemma4" ]; - package = pkgs.ollama-cuda; + #services.ollama = { + # enable = true; + # openFirewall = true; + # host = "0.0.0.0"; + # # Optional: preload models, see https://ollama.com/library + # loadModels = [ "gemma4" ]; + # package = pkgs.ollama-cuda; - }; + #}; programs.chromium = { enable = true; @@ -93,8 +88,6 @@ }) ]; - services.mullvad-vpn.enable = true; - environment.systemPackages = with pkgs; [ brave firefox @@ -104,7 +97,7 @@ gimp inkscape #unstable.protonmail-desktop - bitwarden-desktop + #bitwarden-desktop libreoffice freecad kiwix @@ -126,35 +119,36 @@ veracrypt lmms restic-browser + texliveFull # games - gnome-2048 - gnome-chess - cataclysm-dda - endless-sky - #mindustry #x86 only - openrct2 - openttd - #osu-lazer-bin #x86 only - #runelite #x86 only - unciv - webcord - wesnoth - xonotic - zeroad # 0ad + #gnome-2048 + #gnome-chess + #cataclysm-dda + #endless-sky + ##mindustry #x86 only + #openrct2 + #openttd + ##osu-lazer-bin #x86 only + ##runelite #x86 only + #unciv + #webcord + #wesnoth + #xonotic + #zeroad # 0ad # game utils mangohud #umu-launcher #x86 only # emu - ryubing - xemu + #ryubing + #xemu #xenia-canary #86 only #retroarch-full - rpcs3 - dolphin-emu + #rpcs3 + #dolphin-emu #cemu #x86 only # backup diff --git a/config/gnome.nix b/config/gnome.nix index 879f2cd..36512b2 100644 --- a/config/gnome.nix +++ b/config/gnome.nix @@ -1,9 +1,14 @@ +{ pkgs, ... }: + { # Enable the GNOME Desktop Environment. - services.desktopManager.gnome.enable = false; + services.desktopManager.gnome.enable = true; + services.gnome.games.enable = true; + services.displayManager.gdm.enable = true; environment.systemPackages = with pkgs; [ + gnome-console gnomeExtensions.appindicator gnomeExtensions.blur-my-shell gnomeExtensions.caffeine @@ -12,14 +17,13 @@ environment.gnome.excludePackages = with pkgs; [ epiphany # web browser - geary # email decibels # audio player - gnome-calendar gnome-music gnome-software gnome-tour - totem # video player - xterm + gnome-music + gnome-text-editor + showtime yelp # help ]; @@ -48,6 +52,7 @@ pkgs.gnomeExtensions.caffeine.extensionUuid pkgs.gnomeExtensions.dash-to-dock.extensionUuid ]; + always-show-log-out = true; }; "org/gnome/desktop/calendar" = { show-weekdate = true; @@ -59,13 +64,13 @@ enable-hot-corners = false; font-name = "Noto Sans 11"; gtk-theme = "Adwaita-dark"; - monospace-font-name = "Fira Mono 12"; + monospace-font-name = "JetBrains Nerd Font Mono 12"; }; "org/gnome/desktop/peripherals/mouse" = { accel-profile = "flat"; }; "org/gnome/desktop/wm/preferences" = { - button-layout = ":minimize,maximize,close"; + button-layout = "close,maximize,minimize:"; }; "org/gnome/nautilus/list-view" = { default-zoom-level = "small"; @@ -75,12 +80,16 @@ }; "org/gnome/shell/extensions/dash-to-dock" = { click-action = "minimize-or-previews"; - dock-fixed = true; + dock-fixed = false; multi-monitor = true; show-mounts = false; show-show-apps-button = true; apply-custom-theme = true; }; + "org/gnome/peripherals.keyboard" = { + delay = "200"; + repeat-interval = "30"; + }; "org/gnome/shell/keybindings" = { show-screenshot-ui = [ "s" ]; }; diff --git a/config/hyprland.nix b/config/hyprland.nix index a4bab75..7b62ad0 100644 --- a/config/hyprland.nix +++ b/config/hyprland.nix @@ -5,6 +5,10 @@ programs.hyprland.enable = true; security.pam.services.hyprlock = { }; + #display manager + services.displayManager.sddm.enable = true; # use sddm until gnome 50 due to https://github.com/systemd/systemd/issues/39259 + services.displayManager.sddm.wayland.enable = true; + #wifi networking.wireless.iwd.enable = true; @@ -32,16 +36,23 @@ jq # for scripts # gnome stuff - eog # eye of gnome gnome-calculator gnome-calendar + gnome-characters gnome-clocks gnome-contacts gnome-font-viewer + gnome-maps gnome-weather - nautilus + loupe # image viewer + nautilus # file managr + papers # doc viewer + simple-scan # document scanner + snapshot # camera + ]; + programs.seahorse.enable = true; # keyring viewer services.upower.enable = true; # battery stuff services.udisks2.enable = true; # udiskie automount USB diff --git a/flake.nix b/flake.nix index c0db888..6a56474 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,8 @@ ./config/common.nix ./config/linux.nix ./config/desktop.nix - ./config/hyprland.nix + #./config/hyprland.nix + ./config/gnome.nix ./hosts/desktop/hardware.nix ./hosts/desktop/settings.nix home-manager.nixosModules.home-manager @@ -59,7 +60,7 @@ imports = [ ./home/common.nix ./home/desktop.nix - ./home/hyprland.nix + #./home/hyprland.nix ]; }; } @@ -124,7 +125,7 @@ ./config/common.nix ./config/linux.nix ./config/desktop.nix - ./config/hyprland.nix + ./config/gnome.nix ./hosts/macbook-air/hardware.nix ./hosts/macbook-air/settings.nix apple-silicon-support.nixosModules.apple-silicon-support @@ -143,7 +144,7 @@ imports = [ ./home/common.nix ./home/desktop.nix - ./home/hyprland.nix + #./home/hyprland.nix ]; }; } diff --git a/home/common.nix b/home/common.nix index 99a70f0..c5cd86e 100644 --- a/home/common.nix +++ b/home/common.nix @@ -26,7 +26,6 @@ config = { profile = "high-quality"; ytdl-format = "bestvideo+bestaudio"; - cache-default = 4000000; loop-file = "inf"; }; diff --git a/home/hyprland.nix b/home/hyprland.nix index 28feab4..e8a1e43 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -104,6 +104,25 @@ in }; }; + services.hyprsunset = { + enable = true; + settings = { + max-gamma = 150; + + profile = [ + { + time = "7:30"; + identity = true; + } + { + time = "21:00"; + temperature = 2500; + gamma = 0.8; + } + ]; +}; + }; + services.hyprpaper = { enable = true; settings = { @@ -935,9 +954,10 @@ in wayland.windowManager.hyprland = { enable = true; + #configType = "hyprlang"; plugins = [ pkgs.hyprlandPlugins.hyprbars - pkgs.hyprlandPlugins.hyprspace + #pkgs.hyprlandPlugins.hyprspace ]; settings = { # This is an example Hyprland config file for Nix. @@ -1137,14 +1157,13 @@ in }; }; - layerrule = [ - #"blur, notifications" - #"ignorezero, notifications" + layer_rule = [ + "blur, notifications" + "ignorezero, notifications" # turn off anim for walker - #"noanim, rofi" - - ]; # add blur to notifications + "noanim, rofi" + ]; # https://wiki.hypr.land/Configuring/Variables/#animations animations = { @@ -1366,84 +1385,80 @@ in # See https://wiki.hypr.land/Configuring/Window-Rules/ for more # See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules - #windowrule = [ - # # Example windowrule - # # "float,class:^(kitty)$,title:^(kitty)$" - # # Ignore maximize requests from apps. You'll probably like this. - # "suppressevent maximize, class:.*" + window_rule = [ + # Example windowrule + # "float,class:^(kitty)$,title:^(kitty)$" + # Ignore maximize requests from apps. You'll probably like this. + "suppressevent maximize, class:.*" - # # Fix some dragging issues with XWayland - # "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" + # Fix some dragging issues with XWayland + "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" - # # make tuis accessed from waybar float in center - # "tag +floating-window, title:(bluetui|impala|wiremix|Signal.*|.*WebCord.*|Weather|Calendar)" - # "tag +floating-window, title:^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)" - # "tag +floating-window, class:(org.gnome.NautilusPreviewer)" - # "float, class:(org.gnome.Calculator)" + # make tuis accessed from waybar float in center + "tag +floating-window, title:(bluetui|impala|wiremix|Signal.*|.*WebCord.*|Weather|Calendar)" + "tag +floating-window, title:^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)" + "tag +floating-window, class:(org.gnome.NautilusPreviewer)" + "float, class:(org.gnome.Calculator)" - # # fix scrolling speed in chromium based apps - # "tag +chromium-based, class:(chrom.*|brave-browser|signal|WebCord|obsidian|electron)" - # "scrolltouchpad 0.15, tag:chromium-based" + # fix scrolling speed in chromium based apps + "tag +chromium-based, class:(chrom.*|brave-browser|signal|WebCord|obsidian|electron)" + "scrolltouchpad 0.15, tag:chromium-based" - # # send games to specific workspace - # "workspace name:games silent, class:$games" - # "noanim, class:$games" - # "noblur, class:$games" - # "noshadow, class:$games" - # "noborder, class:$games" - # "rounding 0, class:$games" - # "fullscreen, class:$games" - # "immediate, class:$games" + # send games to specific workspace + "workspace name:games silent, class:$games" + "noanim, class:$games" + "noblur, class:$games" + "noshadow, class:$games" + "noborder, class:$games" + "rounding 0, class:$games" + "fullscreen, class:$games" + "immediate, class:$games" - # # pip - # "tag +pip, title:(Picture.?in.?[Pp]icture)" - # "tag -default-opacity, tag:pip" - # "float, tag:pip" - # "pin, tag:pip" - # "size 600 338, tag:pip" - # "keepaspectratio, tag:pip" - # "bordersize 0, tag:pip" - # "opacity 1 1, tag:pip" - # "move (monitor_w-window_w-40) (monitor_h*0.04), tag:pip" + # pip + "tag +pip, title:(Picture.?in.?[Pp]icture)" + "tag -default-opacity, tag:pip" + "float, tag:pip" + "pin, tag:pip" + "size 600 338, tag:pip" + "keepaspectratio, tag:pip" + "bordersize 0, tag:pip" + "opacity 1 1, tag:pip" + "move (monitor_w-window_w-40) (monitor_h*0.04), tag:pip" - # # steam - # "float, class:^(steam)$" - # "center, class:^(steam)$, title:^(Steam)$" - # "tag -default-opacity, class:^(steam.*)$" - # "opacity 1 1, class:^(steam.*)$" - # "size 1100 700, class:^(steam)$, title:^(Steam)$" - # "size 460 800, class:^(steam)$, title:^(Friends List)$" - # "idleinhibit fullscreen, class:^(steam)$" + # steam + "float, class:^(steam)$" + "center, class:^(steam)$, title:^(Steam)$" + "tag -default-opacity, class:^(steam.*)$" + "opacity 1 1, class:^(steam.*)$" + "size 1100 700, class:^(steam)$, title:^(Steam)$" + "size 460 800, class:^(steam)$, title:^(Friends List)$" + "idleinhibit fullscreen, class:^(steam)$" - # # bitwarden - # "noscreenshare, class:^(Bitwarden)$" - # "tag +floating-window, class:^(Bitwarden)$" + # bitwarden + "noscreenshare, class:^(Bitwarden)$" + "tag +floating-window, class:^(Bitwarden)$" - # # Bitwarden Chrome Extension - # "noscreenshare, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$" - # "tag +floating-window, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$" + # Bitwarden Chrome Extension + "noscreenshare, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$" + "tag +floating-window, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$" + + + # floating tag + "float, tag:floating-window" + "center, tag:floating-window" + "size 875 600, tag:floating-window" - # # floating tag - # "float, tag:floating-window" - # "center, tag:floating-window" - # "size 875 600, tag:floating-window" + # hyprbar + "plugin:hyprbars:nobar, tag:^(?!floating-window$).*$" ]; - # # floating tag - # "float, tag:floating-window" - # "center, tag:floating-window" - # "size 875 600, tag:floating-window" - # # hyprbar - # "plugin:hyprbars:nobar, tag:^(?!floating-window$).*$" - #]; - - #"$games" = - # "^(steam_app_.*|lutris_game_class|minigalaxy|playnite_game_class|gamescope|chiaki|moonlight|com\.moonlight_stream\.Moonlight|.*[Ww]ine.*)$"; - #workspace = [ - # "name:1,monitor:DP-2" - # "name:games,monitor:DP-2" - # "name:4,monitor:HDMI-A-1" - #]; + "$games" = + "^(steam_app_.*|lutris_game_class|minigalaxy|playnite_game_class|gamescope|chiaki|moonlight|com\.moonlight_stream\.Moonlight|.*[Ww]ine.*)$"; + workspace = [ + "name:1,monitor:DP-2" + "name:games,monitor:DP-2" + "name:4,monitor:HDMI-A-1" + ]; }; }; diff --git a/hosts/macbook-air/apple-silicon-support/default.nix b/hosts/macbook-air/apple-silicon-support/default.nix deleted file mode 100644 index 71a5dd0..0000000 --- a/hosts/macbook-air/apple-silicon-support/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./modules/default.nix - ]; -} diff --git a/hosts/macbook-air/apple-silicon-support/modules/boot-m1n1/default.nix b/hosts/macbook-air/apple-silicon-support/modules/boot-m1n1/default.nix deleted file mode 100644 index 38c99b8..0000000 --- a/hosts/macbook-air/apple-silicon-support/modules/boot-m1n1/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - pkgs' = config.hardware.asahi.pkgs; - - bootM1n1 = - if (config.boot.m1n1CustomLogo != null) then - pkgs'.m1n1.override { - customLogo = config.boot.m1n1CustomLogo; - } - else - pkgs'.m1n1; - - bootUBoot = pkgs'.uboot-asahi.override { - m1n1 = bootM1n1; - }; - - bootFiles = { - "m1n1/boot.bin" = pkgs.runCommand "boot.bin" { } '' - cat ${bootM1n1}/lib/m1n1/m1n1.bin \ - ${config.boot.kernelPackages.kernel}/dtbs/apple/*.dtb \ - ${bootUBoot}/u-boot-nodtb.bin.gz \ - > $out - if [ -n "${config.boot.m1n1ExtraOptions}" ]; then - echo '${config.boot.m1n1ExtraOptions}' >> $out - fi - ''; - }; -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; - boot.loader.limine.additionalFiles = bootFiles; - - # ensure the installer has m1n1 in the image - system.extraDependencies = lib.mkForce [ - bootM1n1 - bootUBoot - ]; - system.build.m1n1 = bootFiles."m1n1/boot.bin"; - }; - - options.boot = { - m1n1ExtraOptions = lib.mkOption { - type = lib.types.str; - default = ""; - description = '' - Append extra options to the m1n1 boot binary. Might be useful for fixing - display problems on Mac minis. - https://github.com/AsahiLinux/m1n1/issues/159 - ''; - }; - - m1n1CustomLogo = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = '' - Custom logo to build into m1n1. The path must point to a 256x256 PNG. - ''; - }; - }; -} diff --git a/hosts/macbook-air/apple-silicon-support/modules/default.nix b/hosts/macbook-air/apple-silicon-support/modules/default.nix deleted file mode 100644 index 91e5084..0000000 --- a/hosts/macbook-air/apple-silicon-support/modules/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - imports = [ - ./kernel - ./peripheral-firmware - ./boot-m1n1 - ./sound - ]; - - config = - let - cfg = config.hardware.asahi; - in - lib.mkIf cfg.enable { - nixpkgs.overlays = lib.mkBefore [ cfg.overlay ]; - - hardware.asahi.pkgs = - if cfg.pkgsSystem != "aarch64-linux" then - import (pkgs.path) { - crossSystem.system = "aarch64-linux"; - localSystem.system = cfg.pkgsSystem; - overlays = [ cfg.overlay ]; - } - else - pkgs; - - # 900 is higher priority than mkDefault but lower than just setting - hardware.graphics.package = lib.mkOverride 900 ( - lib.warnIf - (lib.versionAtLeast pkgs.mesa.version "25.3" && lib.versionOlder pkgs.mesa.version "25.3.2") - '' - Mesa 25.3.0 and 25.3.1 are known to cause crashes in Firefox on Asahi - GPUs. Please update to Mesa >= 25.3.2 by updating Nixpkgs. See - https://github.com/nix-community/nixos-apple-silicon/issues/380 for - more info.'' - pkgs.mesa - ); - }; - - options.hardware.asahi = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = '' - Enable the basic Asahi Linux components, such as kernel and boot setup. - ''; - }; - - pkgsSystem = lib.mkOption { - type = lib.types.str; - default = "aarch64-linux"; - description = '' - System architecture that should be used to build the major Asahi - packages, if not the default aarch64-linux. This allows installing from - a cross-built ISO without rebuilding them during installation. - ''; - }; - - pkgs = lib.mkOption { - type = lib.types.raw; - description = '' - Package set used to build the major Asahi packages. Defaults to the - ambient set if not cross-built, otherwise re-imports the ambient set - with the system defined by `hardware.asahi.pkgsSystem`. - ''; - }; - - overlay = lib.mkOption { - type = lib.mkOptionType { - name = "nixpkgs-overlay"; - description = "nixpkgs overlay"; - check = lib.isFunction; - merge = lib.mergeOneOption; - }; - default = import ../packages/overlay.nix; - defaultText = "overlay provided with the module"; - description = '' - The nixpkgs overlay for asahi packages. - ''; - }; - }; -} diff --git a/hosts/macbook-air/apple-silicon-support/modules/kernel/default.nix b/hosts/macbook-air/apple-silicon-support/modules/kernel/default.nix deleted file mode 100644 index 510043f..0000000 --- a/hosts/macbook-air/apple-silicon-support/modules/kernel/default.nix +++ /dev/null @@ -1,114 +0,0 @@ -# the Asahi Linux kernel and options that must go along with it - -{ - config, - lib, - ... -}: -{ - config = lib.mkIf config.hardware.asahi.enable { - boot.kernelPackages = - let - pkgs' = config.hardware.asahi.pkgs; - in - pkgs'.linux-asahi.override { - _kernelPatches = config.boot.kernelPatches; - }; - - # we definitely want to use CONFIG_ENERGY_MODEL, and - # schedutil is a prerequisite for using it - # source: https://www.kernel.org/doc/html/latest/scheduler/sched-energy.html - powerManagement.cpuFreqGovernor = lib.mkOverride 800 "schedutil"; - - boot.initrd.availableKernelModules = [ - # list of initrd modules stolen from - # https://github.com/AsahiLinux/asahi-scripts/blob/f461f080a1d2575ae4b82879b5624360db3cff8c/initcpio/install/asahi - "apple-mailbox" - "apple_nvmem_spmi" - "nvme_apple" - "pinctrl-apple-gpio" - "macsmc" - "macsmc-power" - "macsmc-input" - "macsmc-hwmon" - "macsmc-reboot" - "i2c-pasemi-platform" - "tps6598x" - "apple-dart" - "dwc3" - "dwc3-of-simple" - "xhci-pci" - "pcie-apple" - "gpio_macsmc" - "phy-apple-atc" - "nvmem_apple_efuses" - "spi-apple" - "spi-hid-apple" - "spi-hid-apple-of" - "rtc-macsmc" - "spmi-apple-controller" - "apple-dockchannel" - "dockchannel-hid" - "apple-rtkit-helper" - - # additional stuff necessary to boot off USB for the installer - # and if the initrd (i.e. stage 1) goes wrong - "usb-storage" - "xhci-plat-hcd" - "usbhid" - "hid_generic" - ]; - - boot.kernelParams = [ - "earlycon" - "console=tty0" - "boot.shell_on_fail" - # Apple's SSDs are slow (~dozens of ms) at processing flush requests which - # slows down programs that make a lot of fsync calls. This parameter sets - # a delay in ms before actually flushing so that such requests can be - # coalesced. Be warned that increasing this parameter above zero (default - # is 1000) has the potential, though admittedly unlikely, risk of - # UNBOUNDED data corruption in case of power loss!!!! Don't even think - # about it on desktops!! - "nvme_apple.flush_interval=0" - ]; - - # U-Boot does not support EFI variables - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; - - # GRUB has to be installed as removable if the user chooses to use it - boot.loader.grub = lib.mkDefault { - efiSupport = true; - efiInstallAsRemovable = true; - device = "nodev"; - }; - - # autosuspend was enabled as safe for the PCI SD card reader - # "Genesys Logic, Inc GL9755 SD Host Controller [17a0:9755] (rev 01)" - # by recent systemd versions, but this has a "negative interaction" - # with our kernel/SoC and causes random boot hangs. disable it! - services.udev.extraHwdb = '' - pci:v000017A0d00009755* - ID_AUTOSUSPEND=0 - ''; - }; - - imports = [ - (lib.mkRemovedOptionModule [ - "hardware" - "asahi" - "addEdgeKernelConfig" - ] "All edge kernel config options are now the default.") - (lib.mkRemovedOptionModule [ - "hardware" - "asahi" - "experimentalGPUInstallMode" - ] "This option became unnecessary with asahi support landing in mainline mesa.") - (lib.mkRemovedOptionModule [ - "hardware" - "asahi" - "useExperimentalGPUDriver" - ] "This option became unnecessary with asahi support landing in mainline mesa.") - (lib.mkRemovedOptionModule [ "hardware" "asahi" "withRust" ] "Rust support is now the default.") - ]; -} diff --git a/hosts/macbook-air/apple-silicon-support/modules/peripheral-firmware/default.nix b/hosts/macbook-air/apple-silicon-support/modules/peripheral-firmware/default.nix deleted file mode 100644 index 27f1f34..0000000 --- a/hosts/macbook-air/apple-silicon-support/modules/peripheral-firmware/default.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - config = lib.mkIf config.hardware.asahi.enable { - assertions = lib.mkIf config.hardware.asahi.extractPeripheralFirmware [ - { - assertion = config.hardware.asahi.peripheralFirmwareDirectory != null; - message = '' - Asahi peripheral firmware extraction is enabled but the firmware - location appears incorrect. - ''; - } - ]; - - 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 - ]; - - 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 - ''; - }) - ]; - }; - - options.hardware.asahi = { - extractPeripheralFirmware = lib.mkOption { - type = lib.types.bool; - default = true; - description = '' - Automatically extract the non-free non-redistributable peripheral - firmware necessary for features like Wi-Fi. - ''; - }; - - 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 - ]; - - description = '' - Path to the directory containing the non-free non-redistributable - peripheral firmware necessary for features like Wi-Fi. Ordinarily, this - will automatically point to the appropriate location on the ESP. Flake - users and those interested in maximum purity will want to copy those - files elsewhere and specify this manually. - - Currently, this consists of the files `all-firmware.tar.gz` and - `kernelcache*`. The official Asahi Linux installer places these files - in the `asahi` directory of the EFI system partition when creating it. - ''; - }; - }; -} diff --git a/hosts/macbook-air/apple-silicon-support/modules/sound/default.nix b/hosts/macbook-air/apple-silicon-support/modules/sound/default.nix deleted file mode 100644 index 91a20ee..0000000 --- a/hosts/macbook-air/apple-silicon-support/modules/sound/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - config, - options, - pkgs, - lib, - ... -}: - -{ - options.hardware.asahi = { - setupAsahiSound = lib.mkOption { - type = lib.types.bool; - default = config.hardware.asahi.enable; - description = '' - Set up the Asahi DSP components so that the speakers and headphone jack - work properly and safely. - ''; - }; - }; - - config = - let - cfg = config.hardware.asahi; - in - lib.mkIf (cfg.setupAsahiSound && cfg.enable) ( - lib.mkMerge [ - { - # can't be used by Asahi sound infrastructure - services.pulseaudio.enable = false; - # 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; - - configPackages = [ pkgs.asahi-audio ]; - - wireplumber = { - enable = true; - - configPackages = [ pkgs.asahi-audio ]; - }; - }; - - # 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; - systemd.services.pipewire.environment.ALSA_CONFIG_UCM2 = - config.environment.variables.ALSA_CONFIG_UCM2; - systemd.services.wireplumber.environment.ALSA_CONFIG_UCM2 = - config.environment.variables.ALSA_CONFIG_UCM2; - - # enable speakersafetyd to protect speakers - systemd.packages = [ pkgs.speakersafetyd ]; - services.udev.packages = [ pkgs.speakersafetyd ]; - } - ] - ); -} diff --git a/hosts/macbook-air/apple-silicon-support/packages/linux-asahi/default.nix b/hosts/macbook-air/apple-silicon-support/packages/linux-asahi/default.nix deleted file mode 100644 index 8c1393a..0000000 --- a/hosts/macbook-air/apple-silicon-support/packages/linux-asahi/default.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - lib, - callPackage, - linuxPackagesFor, - _kernelPatches ? [ ], -}: - -let - linux-asahi-pkg = - { - stdenv, - lib, - fetchFromGitHub, - fetchpatch, - buildLinux, - ... - }: - buildLinux rec { - inherit stdenv lib; - - pname = "linux-asahi"; - version = "7.0.8"; - modDirVersion = version; - extraMeta.branch = "7.0"; - - src = fetchFromGitHub { - owner = "AsahiLinux"; - repo = "linux"; - tag = "asahi-7.0.8-1"; - hash = "sha256-ak1dckvTxiR09xMf4xFb6qOPiAQNgIR18v8WLtQBnWQ="; - }; - - kernelPatches = [ - { - name = "Asahi config"; - patch = null; - structuredExtraConfig = with lib.kernel; { - # Needed for GPU - ARM64_16K_PAGES = yes; - - ARM64_MEMORY_MODEL_CONTROL = yes; - ARM64_ACTLR_STATE = yes; - - # Might lead to the machine rebooting if not loaded soon enough - APPLE_WATCHDOG = yes; - - # Can not be built as a module, defaults to no - APPLE_M1_CPU_PMU = yes; - - # Defaults to 'y', but we want to allow the user to set options in modprobe.d - HID_APPLE = module; - - APPLE_PMGR_MISC = yes; - APPLE_PMGR_PWRSTATE = yes; - }; - features.rust = true; - } - ] - ++ _kernelPatches; - }; - - linux-asahi = callPackage linux-asahi-pkg { }; -in -lib.recurseIntoAttrs (linuxPackagesFor linux-asahi) diff --git a/hosts/macbook-air/apple-silicon-support/packages/overlay.nix b/hosts/macbook-air/apple-silicon-support/packages/overlay.nix deleted file mode 100644 index 8d9adf3..0000000 --- a/hosts/macbook-air/apple-silicon-support/packages/overlay.nix +++ /dev/null @@ -1,19 +0,0 @@ -final: prev: { - linux-asahi = final.callPackage ./linux-asahi { }; - uboot-asahi = final.callPackage ./uboot-asahi { }; - mesa = - if prev.mesa.version == "26.0.5" then - # Workaround for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41040 - prev.mesa.overrideAttrs (old: { - version = "26.0.4"; - src = final.fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "mesa"; - repo = "mesa"; - rev = "mesa-26.0.4"; - hash = "sha256-gsrqhFCxZRrTbA5MMWARrN6lFVp4Q3D5Jz7MDYbXznY="; - }; - }) - else - prev.mesa; -} diff --git a/hosts/macbook-air/apple-silicon-support/packages/uboot-asahi/default.nix b/hosts/macbook-air/apple-silicon-support/packages/uboot-asahi/default.nix deleted file mode 100644 index 894650c..0000000 --- a/hosts/macbook-air/apple-silicon-support/packages/uboot-asahi/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - lib, - fetchFromGitHub, - buildUBoot, - m1n1, -}: - -(buildUBoot rec { - src = fetchFromGitHub { - owner = "AsahiLinux"; - repo = "u-boot"; - rev = "asahi-v2026.04-1"; - hash = "sha256-RdcxvKZW2ms6pezBRNPyj/HTYQubpNX6r+nXqkV5oeo="; - }; - version = "2026.04-1-asahi"; - - defconfig = "apple_m1_defconfig"; - extraMeta.platforms = [ "aarch64-linux" ]; - filesToInstall = [ - "u-boot-nodtb.bin.gz" - "m1n1-u-boot.bin" - ]; - extraConfig = '' - CONFIG_IDENT_STRING=" ${version}" - CONFIG_VIDEO_FONT_4X6=n - CONFIG_VIDEO_FONT_8X16=n - CONFIG_VIDEO_FONT_SUN12X22=n - CONFIG_VIDEO_FONT_16X32=y - CONFIG_CMD_BOOTMENU=y - ''; -}).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; - - preInstall = '' - # compress so that m1n1 knows U-Boot's size and can find things after it - gzip -n u-boot-nodtb.bin - cat ${m1n1}/lib/m1n1/m1n1.bin arch/arm/dts/t[68]*.dtb u-boot-nodtb.bin.gz > m1n1-u-boot.bin - ''; - })