{ description = "Spotify, native and fast"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # rust-toolchain.toml pins the compiler so local builds and CI agree. # This reads that file rather than restating the version here. rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nixpkgs, rust-overlay, ... }: let systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems ( system: f ( import nixpkgs { inherit system; overlays = [ (import rust-overlay) ]; } ) ); in { devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ (rust-bin.fromRustupToolchainFile ./rust-toolchain.toml) rust-analyzer pkg-config ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk ] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libpulseaudio libxkbcommon wayland libGL xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr ]; # The GUI dlopens its Wayland, X11 and GL libraries at run time. LD_LIBRARY_PATH = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux ( pkgs.lib.makeLibraryPath ( with pkgs; [ libxkbcommon wayland libGL xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr ] ) ); }; }); formatter = forAllSystems (pkgs: pkgs.nixfmt-tree); }; }