{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; utils.url = "github:numtide/flake-utils"; naersk = { url = "github:nmattia/naersk/master"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, utils, naersk }: let pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ naersk.overlay ]; }; naersk-lib = pkgs.naersk; in rec { overlay = nixpkgs.lib.composeManyExtensions [ (final: prev: { ha-now-playing = naersk-lib.buildPackage { pname = "ha-now-playing"; root = ./.; buildInputs = [ prev.openssl ]; nativeBuildInputs = [ prev.pkg-config ]; }; }) ]; } // utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; in rec { packages.ha-now-playing = pkgs.ha-now-playing; defaultPackage = packages.ha-now-playing; apps.ha-now-playing = utils.lib.mkApp { drv = self.defaultPackage."${system}"; }; defaultApp = apps.ha-now-playing; devShell = with pkgs; mkShell { buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy ]; RUST_SRC_PATH = rustPlatform.rustLibSrc; }; }); }