From ff776981fe942bc0d55d13ed388940adacfb95fd Mon Sep 17 00:00:00 2001 From: nikstur Date: Thu, 16 May 2024 15:37:39 +0200 Subject: nixos/version: support UAPI Version Format in IMAGE_VERSION field Add '~' and '^' to the supported characters for the field. These characters are needed to be able to define all versions that are compatible with the UAPI Version Format specification. One example where this is used is the `%A` flag in systemd.unit. If we don't allow these other characters, we for example cannot declare a pre-relase version. systemd, as far as I can tell, doesn't enforce any restrictions on the os-release fields. https://uapi-group.org/specifications/specs/version_format_specification/ --- nixos/modules/misc/version.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index d582e0c162de3..29e9498018ec9 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -135,7 +135,7 @@ in }; version = lib.mkOption { - type = types.nullOr (types.strMatching "^[a-z0-9._-]+$"); + type = types.nullOr (types.strMatching "^[a-z0-9._-~^]+$"); default = null; description = '' Image version. -- cgit 1.4.1