From fcb1f44ac9fa741eef3a05ce0fd7934294bc1a1c Mon Sep 17 00:00:00 2001 From: Clan Merge Bot Date: Mon, 2 Dec 2024 00:00:28 +0000 Subject: [PATCH 1/2] update flake lock - nixpkgs - 2024-12-02T00:00+00:00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/8edf06bea5bcbee082df1b7369ff973b91618b8d?narHash=sha256-sQxuJm8rHY20xq6Ah%2BGwIUkF95tWjGRd1X8xF%2BPkk38%3D' (2024-11-22) → 'github:NixOS/nixpkgs/2c27ab2e60502d1ebb7cf38909de38663f762a79?narHash=sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw%3D' (2024-12-01) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 6d006bafc..1e42502ac 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732238832, - "narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", + "lastModified": 1733024928, + "narHash": "sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", + "rev": "2c27ab2e60502d1ebb7cf38909de38663f762a79", "type": "github" }, "original": { From 79a2283c710ebe43c09c3090522d97b5ad597194 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 2 Dec 2024 15:14:40 +0100 Subject: [PATCH 2/2] *: nix fmt --- lib/jsonschema/test_parseOptions.nix | 25 +++++++++++--------- nixosModules/clanCore/options.nix | 11 +++++---- pkgs/clan-cli/clan_cli/__init__.py | 2 +- pkgs/clan-cli/clan_cli/api/__init__.py | 2 +- pkgs/clan-cli/clan_cli/clan_uri.py | 2 +- pkgs/clan-cli/clan_cli/inventory/__init__.py | 10 ++++---- pkgs/clan-cli/clan_cli/secrets/sops.py | 8 +++---- 7 files changed, 33 insertions(+), 27 deletions(-) diff --git a/lib/jsonschema/test_parseOptions.nix b/lib/jsonschema/test_parseOptions.nix index d9e8573e6..137bf52a1 100644 --- a/lib/jsonschema/test_parseOptions.nix +++ b/lib/jsonschema/test_parseOptions.nix @@ -57,17 +57,20 @@ }; in { - expr = slib.parseOptions (lib.evalModules { - modules = [ - { - freeformType = with lib.types; attrsOf int; - options = { - enable = lib.mkEnableOption "enable this"; - }; - } - default - ]; - }).options { }; + expr = + slib.parseOptions + (lib.evalModules { + modules = [ + { + freeformType = with lib.types; attrsOf int; + options = { + enable = lib.mkEnableOption "enable this"; + }; + } + default + ]; + }).options + { }; expected = { "$schema" = "http://json-schema.org/draft-07/schema#"; "$exportedModuleInfo" = { diff --git a/nixosModules/clanCore/options.nix b/nixosModules/clanCore/options.nix index ba92d1d18..1eb76ce76 100644 --- a/nixosModules/clanCore/options.nix +++ b/nixosModules/clanCore/options.nix @@ -4,9 +4,12 @@ }: { imports = [ - (lib.mkRenamedOptionModule [ "clanCore" ] [ - "clan" - "core" - ]) + (lib.mkRenamedOptionModule + [ "clanCore" ] + [ + "clan" + "core" + ] + ) ]; } diff --git a/pkgs/clan-cli/clan_cli/__init__.py b/pkgs/clan-cli/clan_cli/__init__.py index c967a1e67..1ecc6ddd4 100644 --- a/pkgs/clan-cli/clan_cli/__init__.py +++ b/pkgs/clan-cli/clan_cli/__init__.py @@ -11,7 +11,7 @@ from .arg_actions import AppendOptionAction from .clan import show, update # 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 ( backups, diff --git a/pkgs/clan-cli/clan_cli/api/__init__.py b/pkgs/clan-cli/clan_cli/api/__init__.py index a83660dcb..9f62a7fde 100644 --- a/pkgs/clan-cli/clan_cli/api/__init__.py +++ b/pkgs/clan-cli/clan_cli/api/__init__.py @@ -13,7 +13,7 @@ from typing import ( 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 diff --git a/pkgs/clan-cli/clan_cli/clan_uri.py b/pkgs/clan-cli/clan_cli/clan_uri.py index f0890f81b..c34d780cb 100644 --- a/pkgs/clan-cli/clan_cli/clan_uri.py +++ b/pkgs/clan-cli/clan_cli/clan_uri.py @@ -72,7 +72,7 @@ class ClanURI: @classmethod def from_str( - cls, # noqa + cls, url: str, machine_name: str | None = None, ) -> "ClanURI": diff --git a/pkgs/clan-cli/clan_cli/inventory/__init__.py b/pkgs/clan-cli/clan_cli/inventory/__init__.py index a3095bc0e..11ed1a627 100644 --- a/pkgs/clan-cli/clan_cli/inventory/__init__.py +++ b/pkgs/clan-cli/clan_cli/inventory/__init__.py @@ -36,13 +36,13 @@ from .classes import ( # Re export classes here # This allows to renaming of classes in the generated code __all__ = [ - "from_dict", - "dataclass_to_dict", - "Service", - "Machine", - "Meta", "Inventory", + "Machine", "MachineDeploy", + "Meta", + "Service", + "dataclass_to_dict", + "from_dict", ] diff --git a/pkgs/clan-cli/clan_cli/secrets/sops.py b/pkgs/clan-cli/clan_cli/secrets/sops.py index af753cf20..246ad5556 100644 --- a/pkgs/clan-cli/clan_cli/secrets/sops.py +++ b/pkgs/clan-cli/clan_cli/secrets/sops.py @@ -29,7 +29,7 @@ class KeyType(enum.Enum): PGP = enum.auto() @classmethod - def validate(cls, value: str | None) -> "KeyType | None": # noqa: ANN102 + def validate(cls, value: str | None) -> "KeyType | None": if value: return cls.__members__.get(value.upper()) return None @@ -114,14 +114,14 @@ class SopsKey: } @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.""" pubkey, key_type = read_key(folder) username = "" return cls(pubkey, username, key_type) @classmethod - def collect_public_keys(cls) -> Sequence["SopsKey"]: # noqa: ANN102 + def collect_public_keys(cls) -> Sequence["SopsKey"]: return [ cls(pubkey=key, username="", key_type=key_type) for key_type in KeyType @@ -159,7 +159,7 @@ class ExitStatus(enum.IntEnum): # see: cmd/sops/codes/codes.go FILE_ALREADY_ENCRYPTED = 203 @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