mirror of
https://github.com/nix-community/flakelight.git
synced 2025-06-20 17:47:45 +02:00
Remove long deprecated functions
This commit is contained in:
parent
6115244234
commit
068cdd875e
30
default.nix
30
default.nix
@ -7,9 +7,9 @@ let
|
|||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
inherit (builtins) isAttrs isPath readDir;
|
inherit (builtins) isAttrs isPath readDir;
|
||||||
inherit (nixpkgs.lib) all attrNames composeManyExtensions evalModules filter
|
inherit (nixpkgs.lib) all attrNames composeManyExtensions evalModules filter
|
||||||
findFirst fix genAttrs getValues hasSuffix isDerivation isFunction isList
|
fix genAttrs getValues hasSuffix isDerivation isFunction isStringLike
|
||||||
isStringLike mapAttrs mapAttrsToList mkDefault mkOptionType pathExists pipe
|
mapAttrs mapAttrsToList mkDefault mkOptionType pathExists pipe removePrefix
|
||||||
removePrefix removeSuffix singleton warn;
|
removeSuffix singleton;
|
||||||
inherit (nixpkgs.lib.types) coercedTo defaultFunctor functionTo listOf
|
inherit (nixpkgs.lib.types) coercedTo defaultFunctor functionTo listOf
|
||||||
optionDescriptionPhrase;
|
optionDescriptionPhrase;
|
||||||
inherit (nixpkgs.lib.options) mergeEqualOption mergeOneOption;
|
inherit (nixpkgs.lib.options) mergeEqualOption mergeOneOption;
|
||||||
@ -38,7 +38,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
flakelight = {
|
flakelight = {
|
||||||
inherit autoImport autoImportArgs importDir mkFlake selectAttr types;
|
inherit importDir mkFlake selectAttr types;
|
||||||
};
|
};
|
||||||
|
|
||||||
types = rec {
|
types = rec {
|
||||||
@ -168,28 +168,6 @@ let
|
|||||||
else if pathExists (path + "/${p}.nix") then "/${p}.nix"
|
else if pathExists (path + "/${p}.nix") then "/${p}.nix"
|
||||||
else "/${p}")));
|
else "/${p}")));
|
||||||
|
|
||||||
autoImport = dir: name: warn
|
|
||||||
("The autoImport function is deprecated. " +
|
|
||||||
"All options are now automatically auto-loaded.")
|
|
||||||
(if isList name
|
|
||||||
then findFirst (x: x != null) null (map (autoImport dir) name)
|
|
||||||
else
|
|
||||||
if pathExists (dir + "/${name}.nix")
|
|
||||||
then import (dir + "/${name}.nix")
|
|
||||||
else if pathExists (dir + "/${name}/default.nix")
|
|
||||||
then import (dir + "/${name}")
|
|
||||||
else if pathExists (dir + "/${name}")
|
|
||||||
then importDir (dir + "/${name}")
|
|
||||||
else null);
|
|
||||||
|
|
||||||
autoImportArgs = dir: args: name: warn
|
|
||||||
("The autoImportArgs function is deprecated. " +
|
|
||||||
"Wrap the target type in flakelight.types.optCallWith instead.")
|
|
||||||
(
|
|
||||||
let v = autoImport dir name; in
|
|
||||||
if isFunction v then v args else v
|
|
||||||
);
|
|
||||||
|
|
||||||
selectAttr = attr: mapAttrs (_: v: v.${attr} or { });
|
selectAttr = attr: mapAttrs (_: v: v.${attr} or { });
|
||||||
in
|
in
|
||||||
flakelight
|
flakelight
|
||||||
|
Loading…
x
Reference in New Issue
Block a user