From 3b33c60e64a7aa5b02fbbdee1182d9ad70ad8f58 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Sun, 21 Nov 2021 17:07:58 +0100 Subject: [PATCH] Fix flake overlay now? --- flake.nix | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index c3d1660..631756e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,27 +7,34 @@ }; outputs = { self, nixpkgs, utils, naersk }: + let + pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ naersk.overlay ]; }; + # naersk-lib = builtins.trace naersk nixpkgs.legacyPackages.x86_64-linux.callPackage naersk { }; + naersk-lib = pkgs.naersk; + in rec { - overlay = final: prev: { - ha-now-playing = final.callPackage ./.; - }; + 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; }; - naersk-lib = pkgs.callPackage naersk { }; + pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; in rec { - packages.ha-now-playing = naersk-lib.buildPackage { - pname = "ha-now-playing"; - root = ./.; - - buildInputs = with pkgs;[ - openssl - ]; - nativeBuildInputs = with pkgs; [ - pkg-config - ]; - }; + packages.ha-now-playing = pkgs.ha-now-playing; defaultPackage = packages.ha-now-playing; apps.ha-now-playing = utils.lib.mkApp {