mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 13:33:28 +01:00
disko2: Add evaluation for configs and flakes
This commit is contained in:
1 parent
ed506048a4
commit
8acd24950d
8 files changed
+277
-27
No files matched your search
+8
-2
@@ -1,7 +1,7 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Generic, Literal, TypeVar
|
||||
from typing import Any, Generic, Literal, TypeVar
|
||||
|
||||
from lib.logging import DiskoMessage, debug, print_msg
|
||||
from lib.logging import DiskoMessage, debug, print_msg, MessageCode
|
||||
|
||||
T = TypeVar("T", covariant=True)
|
||||
|
||||
@@ -19,6 +19,12 @@ class DiskoError:
|
||||
context: str
|
||||
success: Literal[False] = False
|
||||
|
||||
@classmethod
|
||||
def single_message(
|
||||
cls, code: MessageCode, details: dict[str, Any], context: str
|
||||
) -> "DiskoError":
|
||||
return cls([DiskoMessage(code, details)], context)
|
||||
|
||||
|
||||
DiskoResult = DiskoSuccess[T] | DiskoError
|
||||
|
||||
|
||||
Reference in new issue
Block a user