about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authornikstur <nikstur@outlook.com>2024-05-16 15:37:39 +0200
committernikstur <nikstur@outlook.com>2024-05-16 15:37:41 +0200
commitff776981fe942bc0d55d13ed388940adacfb95fd (patch)
tree256d13df6854e657788c61ec9aa775d7035d61ad /nixos
parentbafcff9b1556f7e06399104d99768aa0f80030e5 (diff)
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/
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/misc/version.nix2
1 files changed, 1 insertions, 1 deletions
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.