From 9b718da230d07de8f6f76455bb499a53a7d4a9b4 Mon Sep 17 00:00:00 2001 From: Jake Hamilton Date: Fri, 23 Feb 2024 08:57:44 -0800 Subject: [PATCH] feat: add lib and inputs args to overlay Overlays previously would only receive a "channels" argument and the rest of the attribute set would be the flake's inputs. This is now changing to support passing "lib", the same instance you would get in your system configuration, and "inputs", an attribute set of the flake's inputs. Referencing flake inputs by name here is now deprecated and will be removed in a future update. --- snowfall-lib/overlay/default.nix | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/snowfall-lib/overlay/default.nix b/snowfall-lib/overlay/default.nix index 5dd702c..4419542 100644 --- a/snowfall-lib/overlay/default.nix +++ b/snowfall-lib/overlay/default.nix @@ -26,7 +26,16 @@ in { extra-overlays ? [], }: channels: let user-overlays = snowfall-lib.fs.get-default-nix-files-recursive src; - create-overlay = overlay: import overlay (user-inputs // {inherit channels;}); + create-overlay = overlay: + import overlay ( + # Deprecated: Use `inputs.*` instead of referencing the input name directly. + user-inputs + // { + inherit channels; + inputs = user-inputs; + lib = snowfall-lib.internal.system-lib; + } + ); user-packages-overlay = final: prev: let user-packages = snowfall-lib.package.create-packages { pkgs = final; @@ -89,7 +98,15 @@ in { name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory file); overlay = final: prev: let channels = channel-systems.${prev.system}; - user-overlay = import file (user-inputs // {inherit channels;}); + user-overlay = import file ( + # Deprecated: Use `inputs.*` instead of referencing the input name directly. + user-inputs + // { + inherit channels; + inputs = user-inputs; + lib = snowfall-lib.internal.system-lib; + } + ); packages = user-packages-overlay final prev; prev-with-packages = if package-namespace == null