{ description = "A Spotify client for Gnome"; inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; rust-overlay.url = "github:oxalica/rust-overlay"; crane = { url = "github:ipetkov/crane"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, flake-utils, crane, rust-overlay, ... }: flake-utils.lib.eachDefaultSystem (system: let craneLib = (crane.mkLib nixpkgs.legacyPackages.${system}); pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlays.default ]; }; nativeBuildInputs = with pkgs; [ gettext meson ninja pkg-config gtk4 # for gtk-update-icon-cache glib # for glib-compile-schemas desktop-file-utils cargo rustPlatform.cargoSetupHook rustc wrapGAppsHook4 blueprint-compiler ]; buildInputs = with pkgs; [ glib gtk4 libadwaita libhandy openssl alsa-lib libpulseaudio gst_all_1.gst-plugins-base gst_all_1.gstreamer ]; cargoLock = { lockFile = "./Cargo.lock"; }; cargoArtifacts = craneLib.buildDepsOnly ({ src = craneLib.cleanCargoSource (craneLib.path ./.); inherit buildInputs nativeBuildInputs; pname = "spot"; }); in with pkgs; { packages = rec { spot = craneLib.buildPackage { src = craneLib.path ./.; inherit buildInputs nativeBuildInputs cargoArtifacts; }; default = spot; }; devShells.default = mkShell { inherit buildInputs nativeBuildInputs; packages = with pkgs; [ (rust-bin.stable.latest.default.override { extensions = [ "rust-src" "rust-analyzer" ]; }) meson ninja cargo ]; }; }) // { overlays.default = final: prev: { inherit (self.packages.${final.system}) spot; }; }; }