flake: deprecate .lib.lib

This commit is contained in:
lassulus 2023-09-26 15:57:59 +02:00 committed by mergify[bot]
parent c2bdc227e4
commit 2bf4fc166b
3 changed files with 6 additions and 6 deletions

View file

@ -1,9 +1,9 @@
{ lib ? import <nixpkgs/lib>
, rootMountPoint ? "/mnt"
, checked ? false
, diskoLib ? import ./lib { inherit lib rootMountPoint; }
}:
let
diskoLib = import ./lib { inherit lib rootMountPoint; };
eval = cfg: lib.evalModules {
modules = lib.singleton {
# _file = toString input;
@ -17,7 +17,7 @@ let
};
in
{
lib = diskoLib;
lib = lib.warn "the .lib.lib output is deprecated" diskoLib;
# legacy alias
create = cfg: builtins.trace "the create output is deprecated, use format instead" (eval cfg).config.disko.devices._create;

View file

@ -19,7 +19,7 @@
{
nixosModules.default = self.nixosModules.disko; # convention
nixosModules.disko = import ./module.nix;
lib = import ./. {
lib = import ./lib {
inherit (nixpkgs) lib;
};
packages = forAllSystems (system:

View file

@ -7,7 +7,7 @@ with lib;
with builtins;
let
outputs = import ../default.nix { inherit lib diskoLib; };
diskoLib = {
# like make-disk-image.nix from nixpkgs, but with disko config
@ -19,7 +19,7 @@ let
testLib = import ./tests.nix { inherit lib makeTest eval-config; };
# like lib.types.oneOf but instead of a list takes an attrset
# uses the field "type" to find the correct type in the attrset
subType = { types, extraArgs ? { parent = { type = "rootNode"; name = "root"; }; } }: lib.mkOptionType rec {
subType = { types, extraArgs ? { parent = { type = "rootNode"; name = "root"; }; } }: lib.mkOptionType {
name = "subType";
description = "one of ${concatStringsSep "," (attrNames types)}";
check = x: if x ? type then types.${x.type}.check x else throw "No type option set in:\n${generators.toPretty {} x}";
@ -584,6 +584,6 @@ let
(lib.attrNames (builtins.readDir ./types))
);
};
} // outputs;
in
diskoLib