From 4fd56f73360372665dd072adac2a78156d4caf2d Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 12 Jul 2025 04:00:28 +0200 Subject: Setup new M1 MacBook as 'Moissanite' with Asahi Linux Signed-off-by: Mel --- machines/moissanite/devices.nix | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 machines/moissanite/devices.nix (limited to 'machines/moissanite/devices.nix') diff --git a/machines/moissanite/devices.nix b/machines/moissanite/devices.nix new file mode 100644 index 0000000..d6c4d2c --- /dev/null +++ b/machines/moissanite/devices.nix @@ -0,0 +1,94 @@ +{ + config, + lib, + pkgs, + nixos-apple-silicon, + ... +}: + +{ + imports = [ + nixos-apple-silicon.nixosModules.apple-silicon-support + ]; + + # boot settings + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = false; + + plymouth.enable = true; + + initrd.systemd.enable = true; + + # check nixos-apple-silicon documentation on this, + # if keyboard weirdness ever comes up. + # extraModprobeConfig = '' + # options hid_apple iso_layout=0 + # ''; + + # show a nix logo on asahi m1n1 boot! + m1n1CustomLogo = ../../assets/nix-256x256.png; + }; + + # swap + zramSwap = { + enable = true; + algorithm = "zstd"; + swapDevices = 1; + memoryPercent = 50; + }; + + # hardware + hardware = { + enableAllFirmware = true; + enableRedistributableFirmware = true; + + graphics = { + enable = true; + enable32Bit = lib.mkForce false; + }; + bluetooth.enable = true; + + # asahi-specific settings! + asahi = { + enable = true; + + # proprietary apple firmware extracted during installation. + # it can also be found in /boot/asahi, but needs to be + # included here for flake purity. + peripheralFirmwareDirectory = ../../assets/m1-firmware; + + # mesa + useExperimentalGPUDriver = true; + experimentalGPUInstallMode = "replace"; # probably no longer used. + # sound + setupAsahiSound = true; + # kernel + withRust = true; + }; + }; + + # internet/wifi + networking = { + networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + wireless.iwd = { + enable = true; + settings.General.EnableNetworkConfiguration = true; + }; + }; + + # sound + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + pulse.enable = true; + jack.enable = true; + }; +} -- cgit 1.4.1