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.
This commit is contained in:
parent
1284023e7a
commit
9b718da230
1 changed files with 19 additions and 2 deletions
|
|
@ -26,7 +26,16 @@ in {
|
||||||
extra-overlays ? [],
|
extra-overlays ? [],
|
||||||
}: channels: let
|
}: channels: let
|
||||||
user-overlays = snowfall-lib.fs.get-default-nix-files-recursive src;
|
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-overlay = final: prev: let
|
||||||
user-packages = snowfall-lib.package.create-packages {
|
user-packages = snowfall-lib.package.create-packages {
|
||||||
pkgs = final;
|
pkgs = final;
|
||||||
|
|
@ -89,7 +98,15 @@ in {
|
||||||
name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory file);
|
name = builtins.unsafeDiscardStringContext (snowfall-lib.path.get-parent-directory file);
|
||||||
overlay = final: prev: let
|
overlay = final: prev: let
|
||||||
channels = channel-systems.${prev.system};
|
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;
|
packages = user-packages-overlay final prev;
|
||||||
prev-with-packages =
|
prev-with-packages =
|
||||||
if package-namespace == null
|
if package-namespace == null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue