From 3ad0e19cbe585115e9af27a111e8473a966aa0b9 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 16 Mar 2025 17:53:32 -0400 Subject: [PATCH 1/5] spotlights-macbook-air: Override virglrenderer only for muvm --- .../spotlights-macbook-air/configuration.nix | 18 +++++++----------- .../spotlights-macbook-air/libkrun/package.nix | 13 ++++++++++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/hosts/linux/spotlights-macbook-air/configuration.nix b/hosts/linux/spotlights-macbook-air/configuration.nix index 37b254b..8c1a52f 100644 --- a/hosts/linux/spotlights-macbook-air/configuration.nix +++ b/hosts/linux/spotlights-macbook-air/configuration.nix @@ -57,19 +57,15 @@ ''; }); - # muvm requires a few things for libkrun. + # muvm requires a few custom flags for libkrun. + # Additionally, we override the upstream version of + # `virglrenderer` to use separate other flags. + # + # This could also be accomplished with overriding inputs, + # but as we control the actual source, this is easier. libkrun = prev.callPackage ./libkrun/package.nix { }; - # https://github.com/NixOS/nixpkgs/pull/347792#issuecomment-2667343848 - virglrenderer = prev.virglrenderer.overrideAttrs (old: { - src = final.fetchurl { - url = "https://gitlab.freedesktop.org/asahi/virglrenderer/-/archive/asahi-20241205.2/virglrenderer-asahi-20241205.2.tar.bz2"; - hash = "sha256-mESFaB//RThS5Uts8dCRExfxT5DQ+QQgTDWBoQppU7U="; - }; - mesonFlags = old.mesonFlags ++ [ (final.lib.mesonOption "drm-renderers" "asahi-experimental") ]; - }); - - # https://github.com/NixOS/nixpkgs/pull/347792 + # Derived from https://github.com/NixOS/nixpkgs/pull/347792 muvm = prev.callPackage ./muvm/package.nix { }; }) ]; diff --git a/hosts/linux/spotlights-macbook-air/libkrun/package.nix b/hosts/linux/spotlights-macbook-air/libkrun/package.nix index 4dc32b3..240b226 100644 --- a/hosts/linux/spotlights-macbook-air/libkrun/package.nix +++ b/hosts/linux/spotlights-macbook-air/libkrun/package.nix @@ -1,5 +1,6 @@ { lib , stdenv +, fetchurl , fetchFromGitHub , rustPlatform , cargo @@ -57,7 +58,17 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals withGpu [ libepoxy libdrm - virglrenderer + # We want to override the virglrenderer input. + # (Overriding for all of nixpkgs means that QEMU is repeatedly rebuilt.) + # https://github.com/NixOS/nixpkgs/pull/347792#issuecomment-2667343848 + (virglrenderer.overrideAttrs + (old: { + src = fetchurl { + url = "https://gitlab.freedesktop.org/asahi/virglrenderer/-/archive/asahi-20241205.2/virglrenderer-asahi-20241205.2.tar.bz2"; + hash = "sha256-mESFaB//RThS5Uts8dCRExfxT5DQ+QQgTDWBoQppU7U="; + }; + mesonFlags = old.mesonFlags ++ [ (lib.mesonOption "drm-renderers" "asahi-experimental") ]; + })) ] ++ lib.optional withSound pipewire ++ lib.optional sevVariant openssl; From 6a516d63fce709eeffb8c56ef07acb2af641fc69 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 16 Mar 2025 17:53:51 -0400 Subject: [PATCH 2/5] linux: Use beacondb.net for geolocation --- hosts/linux/shared.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/linux/shared.nix b/hosts/linux/shared.nix index d0f4ace..b3f1bf6 100644 --- a/hosts/linux/shared.nix +++ b/hosts/linux/shared.nix @@ -68,7 +68,12 @@ # we'll use geolocation via the Arch Linux API key. geoclue2 = { enable = true; - geoProviderUrl = "https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM"; + geoProviderUrl = "https://api.beacondb.net/v1/geolocate"; + + # Let's be generous :) + submitData = true; + submissionUrl = "https://api.beacondb.net/v2/geosubmit"; + submissionNick = "geoclue"; }; }; From ca364e6f1434d79babd825b4a97e8431df4d4593 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 16 Mar 2025 17:54:15 -0400 Subject: [PATCH 3/5] spotlights-macbook-air: WireGuard support --- hosts/linux/spotlights-macbook-air/configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/linux/spotlights-macbook-air/configuration.nix b/hosts/linux/spotlights-macbook-air/configuration.nix index 8c1a52f..1008ffb 100644 --- a/hosts/linux/spotlights-macbook-air/configuration.nix +++ b/hosts/linux/spotlights-macbook-air/configuration.nix @@ -32,6 +32,9 @@ enable = true; settings.General.EnableNetworkConfiguration = true; }; + + # Necessary for WireGuard + firewall.checkReversePath = false; }; nixpkgs.overlays = [ @@ -101,6 +104,7 @@ legcord muvm vscode +wireguard-tools ]; # :( From 4a1a073f1104e95789b4fb2f0d316f74184bc6a3 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 16 Mar 2025 17:54:34 -0400 Subject: [PATCH 4/5] spotlights-macbook-air: Set timezone via geolocation --- hosts/linux/spotlights-macbook-air/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hosts/linux/spotlights-macbook-air/configuration.nix b/hosts/linux/spotlights-macbook-air/configuration.nix index 1008ffb..041ac9d 100644 --- a/hosts/linux/spotlights-macbook-air/configuration.nix +++ b/hosts/linux/spotlights-macbook-air/configuration.nix @@ -17,6 +17,12 @@ efi.canTouchEfiVariables = false; }; + # Allow GNOME to dynamically set the + # time zone based on current location. + # + # https://www.reddit.com/r/NixOS/comments/1411gjs/comment/jo4wau3/ + time.timeZone = lib.mkForce null; + # Asahi Linux support hardware.asahi = { peripheralFirmwareDirectory = /boot/asahi; From a8d2ffb56fe47b4ec645587778117652fe5e5981 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 16 Mar 2025 17:55:54 -0400 Subject: [PATCH 5/5] spotlights-macbook-air: Enable usbmuxd for iOS tethering --- flake.lock | 12 ++++++------ hosts/linux/spotlights-macbook-air/configuration.nix | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index f863486..367e334 100644 --- a/flake.lock +++ b/flake.lock @@ -24,11 +24,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1741663108, - "narHash": "sha256-9RaZ3HuOptioE94IQ/nnzC2x5cMaRi6NX8d8ZOqhJ68=", + "lastModified": 1742098834, + "narHash": "sha256-l98XVpNXW6hr0AsxCeQZbdf6EGT8OpHdkWBi7sdel4s=", "owner": "tpwrules", "repo": "nixos-apple-silicon", - "rev": "4264de082e92e7d7ba7fa2ad5b5b1a8818b5d048", + "rev": "8457960249bcfd34c22838e20eaa7d8261428688", "type": "github" }, "original": { @@ -142,11 +142,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741851582, - "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", "type": "github" }, "original": { diff --git a/hosts/linux/spotlights-macbook-air/configuration.nix b/hosts/linux/spotlights-macbook-air/configuration.nix index 041ac9d..58d1d3f 100644 --- a/hosts/linux/spotlights-macbook-air/configuration.nix +++ b/hosts/linux/spotlights-macbook-air/configuration.nix @@ -98,10 +98,16 @@ }; }; + # Docker users.users.spotlight.extraGroups = [ "docker" ]; virtualisation.docker.enable = true; - services.syncthing.enable = true; + services = { + # iOS tethering, etc + usbmuxd.enable = true; + + syncthing.enable = true; + }; environment.systemPackages = with pkgs; [ # For usage with FEXRootFSFetcher