*: nix fmt
This commit is contained in:
@@ -57,17 +57,20 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
expr = slib.parseOptions (lib.evalModules {
|
expr =
|
||||||
modules = [
|
slib.parseOptions
|
||||||
{
|
(lib.evalModules {
|
||||||
freeformType = with lib.types; attrsOf int;
|
modules = [
|
||||||
options = {
|
{
|
||||||
enable = lib.mkEnableOption "enable this";
|
freeformType = with lib.types; attrsOf int;
|
||||||
};
|
options = {
|
||||||
}
|
enable = lib.mkEnableOption "enable this";
|
||||||
default
|
};
|
||||||
];
|
}
|
||||||
}).options { };
|
default
|
||||||
|
];
|
||||||
|
}).options
|
||||||
|
{ };
|
||||||
expected = {
|
expected = {
|
||||||
"$schema" = "http://json-schema.org/draft-07/schema#";
|
"$schema" = "http://json-schema.org/draft-07/schema#";
|
||||||
"$exportedModuleInfo" = {
|
"$exportedModuleInfo" = {
|
||||||
|
|||||||
@@ -4,9 +4,12 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(lib.mkRenamedOptionModule [ "clanCore" ] [
|
(lib.mkRenamedOptionModule
|
||||||
"clan"
|
[ "clanCore" ]
|
||||||
"core"
|
[
|
||||||
])
|
"clan"
|
||||||
|
"core"
|
||||||
|
]
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from .arg_actions import AppendOptionAction
|
|||||||
from .clan import show, update
|
from .clan import show, update
|
||||||
|
|
||||||
# API endpoints that are not used in the cli.
|
# API endpoints that are not used in the cli.
|
||||||
__all__ = ["directory", "mdns_discovery", "modules", "update", "disk", "admin", "iwd"]
|
__all__ = ["admin", "directory", "disk", "iwd", "mdns_discovery", "modules", "update"]
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
backups,
|
backups,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from typing import (
|
|||||||
|
|
||||||
from .serde import dataclass_to_dict, from_dict, sanitize_string
|
from .serde import dataclass_to_dict, from_dict, sanitize_string
|
||||||
|
|
||||||
__all__ = ["from_dict", "dataclass_to_dict", "sanitize_string"]
|
__all__ = ["dataclass_to_dict", "from_dict", "sanitize_string"]
|
||||||
|
|
||||||
from clan_cli.errors import ClanError
|
from clan_cli.errors import ClanError
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class ClanURI:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_str(
|
def from_str(
|
||||||
cls, # noqa
|
cls,
|
||||||
url: str,
|
url: str,
|
||||||
machine_name: str | None = None,
|
machine_name: str | None = None,
|
||||||
) -> "ClanURI":
|
) -> "ClanURI":
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ from .classes import (
|
|||||||
# Re export classes here
|
# Re export classes here
|
||||||
# This allows to renaming of classes in the generated code
|
# This allows to renaming of classes in the generated code
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"from_dict",
|
|
||||||
"dataclass_to_dict",
|
|
||||||
"Service",
|
|
||||||
"Machine",
|
|
||||||
"Meta",
|
|
||||||
"Inventory",
|
"Inventory",
|
||||||
|
"Machine",
|
||||||
"MachineDeploy",
|
"MachineDeploy",
|
||||||
|
"Meta",
|
||||||
|
"Service",
|
||||||
|
"dataclass_to_dict",
|
||||||
|
"from_dict",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class KeyType(enum.Enum):
|
|||||||
PGP = enum.auto()
|
PGP = enum.auto()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate(cls, value: str | None) -> "KeyType | None": # noqa: ANN102
|
def validate(cls, value: str | None) -> "KeyType | None":
|
||||||
if value:
|
if value:
|
||||||
return cls.__members__.get(value.upper())
|
return cls.__members__.get(value.upper())
|
||||||
return None
|
return None
|
||||||
@@ -114,14 +114,14 @@ class SopsKey:
|
|||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_dir(cls, folder: Path) -> "SopsKey": # noqa: ANN102
|
def load_dir(cls, folder: Path) -> "SopsKey":
|
||||||
"""Load from the file named `keys.json` in the given directory."""
|
"""Load from the file named `keys.json` in the given directory."""
|
||||||
pubkey, key_type = read_key(folder)
|
pubkey, key_type = read_key(folder)
|
||||||
username = ""
|
username = ""
|
||||||
return cls(pubkey, username, key_type)
|
return cls(pubkey, username, key_type)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def collect_public_keys(cls) -> Sequence["SopsKey"]: # noqa: ANN102
|
def collect_public_keys(cls) -> Sequence["SopsKey"]:
|
||||||
return [
|
return [
|
||||||
cls(pubkey=key, username="", key_type=key_type)
|
cls(pubkey=key, username="", key_type=key_type)
|
||||||
for key_type in KeyType
|
for key_type in KeyType
|
||||||
@@ -159,7 +159,7 @@ class ExitStatus(enum.IntEnum): # see: cmd/sops/codes/codes.go
|
|||||||
FILE_ALREADY_ENCRYPTED = 203
|
FILE_ALREADY_ENCRYPTED = 203
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parse(cls, code: int) -> "ExitStatus | None": # noqa: ANN102
|
def parse(cls, code: int) -> "ExitStatus | None":
|
||||||
return ExitStatus(code) if code in ExitStatus else None
|
return ExitStatus(code) if code in ExitStatus else None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user