From 1020bbe7ddc949dd3cd69724bdb683c668ac856a Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Sun, 9 Oct 2022 14:16:29 -0700 Subject: [PATCH] Remove deprecated `package` bindings --- CHANGELOG.md | 4 ++++ flake.nix | 14 +++++++++++--- pkgs/default.nix | 17 ++++------------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a0683..c166bbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Changed +* **Breaking**: all setup hooks have been removed from the `packages` flake + output. They can still be accessed via the `lib` flake output. + ## [0.8.0] - 2022-10-09 ### Added diff --git a/flake.nix b/flake.nix index 2595538..2a5e31b 100644 --- a/flake.nix +++ b/flake.nix @@ -16,12 +16,17 @@ inherit (pkgs) lib newScope; }; - myPkgsFor = pkgs: import ./pkgs (mkLib pkgs); + myPkgsFor = { pkgs, myLib }: import ./pkgs { + inherit pkgs myLib; + }; in { inherit mkLib; - overlays.default = final: prev: myPkgsFor final; + overlays.default = final: prev: myPkgsFor { + pkgs = final; + myLib = mkLib final; + }; templates = rec { alt-registry = { @@ -63,7 +68,10 @@ # To override do: lib.overrideScope' (self: super: { ... }); lib = mkLib pkgs; - myPkgs = myPkgsFor pkgs; + myPkgs = myPkgsFor { + inherit pkgs; + myLib = lib; + }; checks = pkgs.callPackages ./checks { inherit pkgs myPkgs; diff --git a/pkgs/default.nix b/pkgs/default.nix index 371b0a5..49f041e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,15 +1,6 @@ -myLib: -let - mkDeprecated = name: - builtins.trace "packages.${name} is deprecated, please use craneLib.${name} instead" - myLib.${name}; -in +{ myLib +, pkgs +}: + { - cargoHelperFunctionsHook = mkDeprecated "cargoHelperFunctionsHook"; - configureCargoCommonVarsHook = mkDeprecated "configureCargoCommonVarsHook"; - configureCargoVendoredDepsHook = mkDeprecated "configureCargoVendoredDepsHook"; - inheritCargoArtifactsHook = mkDeprecated "inheritCargoArtifactsHook"; - installCargoArtifactsHook = mkDeprecated "installCargoArtifactsHook"; - installFromCargoBuildLogHook = mkDeprecated "installFromCargoBuildLogHook"; - removeReferencesToVendoredSourcesHook = mkDeprecated "removeReferencesToVendoredSourcesHook"; }