types: add systemd unit name

This commit is contained in:
tv 2020-08-05 10:57:09 +02:00
parent b5b90b5984
commit 4227cadb68
1 changed files with 8 additions and 0 deletions

View File

@ -530,6 +530,14 @@ rec {
merge = mergeOneOption;
};
systemd.unit-name = mkOptionType {
name = "systemd unit name";
check = x:
test "^[0-9A-Za-z:_.\\-]+@?\\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$" x &&
stringLength x <= 256;
merge = mergeOneOption;
};
# RFC952, B. Lexical grammar, <hname>
hostname = mkOptionType {
name = "hostname";