Skip to content

Commit

Permalink
Merge pull request #295020 from philiptaron/remove-top-level-with-in-…
Browse files Browse the repository at this point in the history
…lib-part4

lib/tests: remove top-level `with` in `lib/tests`
  • Loading branch information
roberth committed Mar 11, 2024
2 parents b9a1cf2 + 20abffc commit e8d7a2d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
13 changes: 10 additions & 3 deletions lib/tests/modules/alias-with-priority-can-override.nix
Expand Up @@ -6,12 +6,19 @@

{ config, lib, ... }:

with lib;
let
inherit (lib)
mkAliasOptionModule
mkForce
mkOption
types
;
in

{
options = {
# A simple boolean option that can be enabled or disabled.
enable = lib.mkOption {
enable = mkOption {
type = types.nullOr types.bool;
default = null;
example = true;
Expand Down Expand Up @@ -41,7 +48,7 @@ with lib;
# should override the next import.
( { config, lib, ... }:
{
enableAlias = lib.mkForce false;
enableAlias = mkForce false;
}
)

Expand Down
13 changes: 10 additions & 3 deletions lib/tests/modules/alias-with-priority.nix
Expand Up @@ -6,12 +6,19 @@

{ config, lib, ... }:

with lib;
let
inherit (lib)
mkAliasOptionModule
mkDefault
mkOption
types
;
in

{
options = {
# A simple boolean option that can be enabled or disabled.
enable = lib.mkOption {
enable = mkOption {
type = types.nullOr types.bool;
default = null;
example = true;
Expand Down Expand Up @@ -41,7 +48,7 @@ with lib;
# should be able to be overridden by the next import.
( { config, lib, ... }:
{
enableAlias = lib.mkDefault false;
enableAlias = mkDefault false;
}
)

Expand Down
9 changes: 8 additions & 1 deletion lib/tests/modules/extendModules-168767-imports.nix
Expand Up @@ -2,7 +2,14 @@
, extendModules
, ...
}:
with lib;

let
inherit (lib)
mkOption
mkOverride
types
;
in
{
imports = [

Expand Down

0 comments on commit e8d7a2d

Please sign in to comment.