mirror of
https://github.com/nix-community/disko.git
synced 2026-12-04 06:53:28 +01:00
outputs: Deprecate all unused outputs
I believe that people are either using disko through the flake or via nixpkgs. In both cases, the `default.nix` file contains a lot of outputs that are not needed. Adding scary error messages with a call to action like this should help confirm or deny this theory.
This commit is contained in:
1 parent
94bc0f5bb0
commit
3fc91a7576
1 file changed
+17
-14
+17
-14
@@ -15,9 +15,12 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# We might instead reuse some of the deprecated output names to refer to the values the _cli* outputs currently do,
|
||||||
|
# but this warning allows us to get feedback from users early in case they have a use case we haven't considered.
|
||||||
|
warnDeprecated = name: lib.warn "the ${name} output is deprecated and will be removed, please open an issue if you're using it!";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib = lib.warn "the .lib.lib output is deprecated" diskoLib;
|
lib = warnDeprecated ".lib.lib" diskoLib;
|
||||||
|
|
||||||
_cliDestroy = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroy;
|
_cliDestroy = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroy;
|
||||||
_cliDestroyNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroyNoDeps;
|
_cliDestroyNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroyNoDeps;
|
||||||
@@ -35,24 +38,24 @@ in
|
|||||||
_cliDestroyFormatMountNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroyFormatMountNoDeps;
|
_cliDestroyFormatMountNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).destroyFormatMountNoDeps;
|
||||||
|
|
||||||
# legacy aliases
|
# legacy aliases
|
||||||
create = cfg: builtins.trace "the create output is deprecated, use format instead" (eval cfg).config.disko.devices._create;
|
create = cfg: warnDeprecated "create" (eval cfg).config.disko.devices._create;
|
||||||
createScript = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
createScript = cfg: pkgs: warnDeprecated "createScript" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||||
createScriptNoDeps = cfg: pkgs: builtins.trace "the create output is deprecated, use format instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
createScriptNoDeps = cfg: pkgs: warnDeprecated "createScriptNoDeps" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||||
|
|
||||||
format = cfg: (eval cfg).config.disko.devices._create;
|
format = cfg: warnDeprecated "format" (eval cfg).config.disko.devices._create;
|
||||||
formatScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
formatScript = cfg: pkgs: warnDeprecated "formatScript" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScript;
|
||||||
formatScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
formatScriptNoDeps = cfg: pkgs: warnDeprecated "formatScriptNoDeps" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).formatScriptNoDeps;
|
||||||
|
|
||||||
mount = cfg: (eval cfg).config.disko.devices._mount;
|
mount = cfg: warnDeprecated "mount" (eval cfg).config.disko.devices._mount;
|
||||||
mountScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScript;
|
mountScript = cfg: pkgs: warnDeprecated "mountScript" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScript;
|
||||||
mountScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScriptNoDeps;
|
mountScriptNoDeps = cfg: pkgs: warnDeprecated "mountScriptNoDeps" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).mountScriptNoDeps;
|
||||||
|
|
||||||
disko = cfg: (eval cfg).config.disko.devices._disko;
|
disko = cfg: warnDeprecated "disko" (eval cfg).config.disko.devices._disko;
|
||||||
diskoScript = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScript;
|
diskoScript = cfg: pkgs: warnDeprecated "diskoScript" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScript;
|
||||||
diskoScriptNoDeps = cfg: pkgs: ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
diskoScriptNoDeps = cfg: pkgs: warnDeprecated "diskoScriptNoDeps" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||||
|
|
||||||
# we keep this old output for backwards compatibility
|
# we keep this old output for backwards compatibility
|
||||||
diskoNoDeps = cfg: pkgs: builtins.trace "the diskoNoDeps output is deprecated, please use disko instead" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
diskoNoDeps = cfg: pkgs: warnDeprecated "diskoNoDeps" ((eval cfg).config.disko.devices._scripts { inherit pkgs checked; }).diskoScriptNoDeps;
|
||||||
|
|
||||||
config = cfg: (eval cfg).config.disko.devices._config;
|
config = cfg: (eval cfg).config.disko.devices._config;
|
||||||
packages = cfg: (eval cfg).config.disko.devices._packages;
|
packages = cfg: (eval cfg).config.disko.devices._packages;
|
||||||
|
|||||||
Reference in new issue
Block a user