From b74e861c28643c55b7cc4bf909cd91cb907bb790 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 2 May 2025 12:58:33 +0100 Subject: [PATCH] nixos-rebuild-ng: use Final in constants.py --- .../ni/nixos-rebuild-ng/src/nixos_rebuild/constants.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/constants.py b/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/constants.py index f879130f0336..ef706af7b342 100644 --- a/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/constants.py +++ b/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/constants.py @@ -1,9 +1,11 @@ +from typing import Final + # Build-time flags # Use strings to avoid breaking standalone (e.g.: `python -m nixos_rebuild`) # usage -EXECUTABLE = "@executable@" +EXECUTABLE: Final[str] = "@executable@" # Use either `== "true"` if the default (e.g.: `python -m nixos_rebuild`) is # `False` or `!= "false"` if the default is `True` -WITH_NIX_2_18 = "@withNix218@" != "false" # type: ignore -WITH_REEXEC = "@withReexec@" == "true" # type: ignore -WITH_SHELL_FILES = "@withShellFiles@" == "true" # type: ignore +WITH_NIX_2_18: Final[bool] = "@withNix218@" != "false" +WITH_REEXEC: Final[bool] = "@withReexec@" == "true" +WITH_SHELL_FILES: Final[bool] = "@withShellFiles@" == "true"