buildClan: add depercation warnings for directory=self
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
## Inputs
|
## Inputs
|
||||||
self ? null, # Reference to the current flake
|
self ? lib.warn "Argument: 'self' must be set when using 'buildClan'." null, # Reference to the current flake
|
||||||
# allows to include machine-specific modules i.e. machines.${name} = { ... }
|
# allows to include machine-specific modules i.e. machines.${name} = { ... }
|
||||||
# A map from arch to pkgs, if specified this nixpkgs will be only imported once for each system.
|
# A map from arch to pkgs, if specified this nixpkgs will be only imported once for each system.
|
||||||
# This improves performance, but all nipxkgs.* options will be ignored.
|
# This improves performance, but all nipxkgs.* options will be ignored.
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ in
|
|||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
self = lib.mkOption {
|
self = lib.mkOption {
|
||||||
type = types.nullOr types.raw;
|
type = types.raw;
|
||||||
default = self;
|
default = self;
|
||||||
readOnly = true;
|
|
||||||
defaultText = "Reference to the current flake";
|
defaultText = "Reference to the current flake";
|
||||||
description = ''
|
description = ''
|
||||||
This is used to import external clan modules.
|
This is used to import external clan modules.
|
||||||
@@ -19,7 +18,15 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
directory = lib.mkOption {
|
directory = lib.mkOption {
|
||||||
type = types.path;
|
type = types.coercedTo lib.types.raw (
|
||||||
|
v:
|
||||||
|
if lib.isAttrs v then
|
||||||
|
lib.warn "It appears you set 'clan.directory = self'. Instead set 'clan.self = self'. 'clan.directory' expects a path" v
|
||||||
|
else if v == null then
|
||||||
|
throw "Please set either clan.self or clan.directory"
|
||||||
|
else
|
||||||
|
builtins.toString v
|
||||||
|
) lib.types.path;
|
||||||
default = builtins.toString self;
|
default = builtins.toString self;
|
||||||
defaultText = "Root directory of the flake";
|
defaultText = "Root directory of the flake";
|
||||||
description = ''
|
description = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user