Merge pull request 'Automatic flake update - nixpkgs - 2024-12-02T00:00+00:00' (#2530) from flake-update-nixpkgs-2024-12-02 into main

This commit is contained in:
clan-bot
2024-12-02 14:21:56 +00:00
8 changed files with 36 additions and 30 deletions

6
flake.lock generated
View File

@@ -57,11 +57,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1732238832, "lastModified": 1733024928,
"narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "narHash": "sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "rev": "2c27ab2e60502d1ebb7cf38909de38663f762a79",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -57,7 +57,9 @@
}; };
in in
{ {
expr = slib.parseOptions (lib.evalModules { expr =
slib.parseOptions
(lib.evalModules {
modules = [ modules = [
{ {
freeformType = with lib.types; attrsOf int; freeformType = with lib.types; attrsOf int;
@@ -67,7 +69,8 @@
} }
default default
]; ];
}).options { }; }).options
{ };
expected = { expected = {
"$schema" = "http://json-schema.org/draft-07/schema#"; "$schema" = "http://json-schema.org/draft-07/schema#";
"$exportedModuleInfo" = { "$exportedModuleInfo" = {

View File

@@ -4,9 +4,12 @@
}: }:
{ {
imports = [ imports = [
(lib.mkRenamedOptionModule [ "clanCore" ] [ (lib.mkRenamedOptionModule
[ "clanCore" ]
[
"clan" "clan"
"core" "core"
]) ]
)
]; ];
} }

View File

@@ -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,

View File

@@ -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

View File

@@ -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":

View File

@@ -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",
] ]

View File

@@ -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