From 2bf4fc166bbeb9678557cb16fd0b5de10ebf7ce5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 26 Sep 2023 15:57:59 +0200 Subject: [PATCH] flake: deprecate .lib.lib --- default.nix | 4 ++-- flake.nix | 2 +- lib/default.nix | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index 5e9c277..bf3570e 100644 --- a/default.nix +++ b/default.nix @@ -1,9 +1,9 @@ { lib ? import , 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; diff --git a/flake.nix b/flake.nix index 6a7d28b..1543270 100644 --- a/flake.nix +++ b/flake.nix @@ -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: diff --git a/lib/default.nix b/lib/default.nix index 598081c..a9456d1 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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