Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <[email protected]>
  • Loading branch information
lucasew committed Jan 8, 2025
1 parent d496a92 commit 43e090c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 42 deletions.
5 changes: 3 additions & 2 deletions tests/nowith-meta-toplevel-lib/test.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv
, lib
{
stdenv,
lib,
}:

stdenv.mkDerivation {
Expand Down
5 changes: 3 additions & 2 deletions tests/nowith-meta-with-maintainers/test.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv
, lib
{
stdenv,
lib,
}:

stdenv.mkDerivation {
Expand Down
11 changes: 6 additions & 5 deletions tests/nowith-nixos-submodule-shadow/test.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{ config
, lib
{
config,
lib,
}:

let
cfg = config.foo;
in {
in
{
options.foo = lib.mkOption {
type = # random example from nixpkgs
with lib.types;
Expand Down Expand Up @@ -33,6 +35,5 @@ in {
};
})
);
};
};
}

15 changes: 8 additions & 7 deletions tests/nowith-nixos-submodule-unshadow-inherit/test.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config
, lib
{
config,
lib,
}:

let
Expand All @@ -8,7 +9,7 @@ let
inherit (lib)
mkOption
elem
;
;

inherit (lib.types)
attrsOf
Expand All @@ -18,8 +19,9 @@ let
nullOr
str
addCheck
;
in {
;
in
{
options.foo = mkOption {
type = # random example from nixpkgs
attrsOf (
Expand Down Expand Up @@ -47,6 +49,5 @@ in {
};
})
);
};
};
}

55 changes: 29 additions & 26 deletions tests/nowith-nixos-submodule-unshadow/test.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
{ config
, lib
{
config,
lib,
}:

let
cfg = config.foo;
in {
in
{
options.foo = lib.mkOption {
type = # random example from nixpkgs
lib.types.attrsOf (
lib.types.either lib.types.path (lib.types.submodule {
options = {
service = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "The service on which to perform \<action\> after fetching.";
};
lib.types.either lib.types.path (
lib.types.submodule {
options = {
service = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "The service on which to perform \<action\> after fetching.";
};

action = lib.mkOption {
type = lib.types.addCheck lib.types.str (
x:
cfg.svcManager == "command"
|| lib.elem x [
"restart"
"reload"
"nop"
]
);
default = "nop";
description = "The action to take after fetching.";
action = lib.mkOption {
type = lib.types.addCheck lib.types.str (
x:
cfg.svcManager == "command"
|| lib.elem x [
"restart"
"reload"
"nop"
]
);
default = "nop";
description = "The action to take after fetching.";
};
};
};
})
}
)
);
};
};
}

0 comments on commit 43e090c

Please sign in to comment.