From 9f4532133d9e812f492207d61eaa871043193a39 Mon Sep 17 00:00:00 2001 From: Chuck Date: Mon, 19 Apr 2021 15:36:51 -0700 Subject: [PATCH] Offer "overlay" and "overlays" flake outputs This is the preferred way to define packages in flakes according to https://github.com/NixOS/rfcs/pull/49/files#r448298299 --- Changelog | 2 ++ flake.nix | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 59f276a..f81136a 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,6 @@ ## [Unreleased] +### Added +- "overlay" and "overlays" flake outputs ## [1.2.3] - 2020-08-25 diff --git a/flake.nix b/flake.nix index 49594a7..195cc33 100644 --- a/flake.nix +++ b/flake.nix @@ -11,12 +11,17 @@ { }).stdenvBootstrapTools)); packages = for-supported-systems (system: { - git-cache = import ./. { pkgs = nixpkgs.legacyPackages."${system}"; }; + inherit (nixpkgs.legacyPackages."${system}".appendOverlays + [ self.overlay ]) + git-cache; }); in { inherit packages; + overlay = final: prev: { git-cache = import ./. { pkgs = final; }; }; + overlays = { git-cache = self.overlay; }; + defaultApp = for-supported-systems (system: { type = "app"; program = "${packages."${system}".git-cache}/bin/git-cache"; -- 2.44.1