types: add systemd unit name

This commit is contained in:
tv 2020-08-05 10:57:09 +02:00
parent b5b90b5984
commit 4227cadb68

View File

@ -530,6 +530,14 @@ rec {
merge = mergeOneOption; 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> # RFC952, B. Lexical grammar, <hname>
hostname = mkOptionType { hostname = mkOptionType {
name = "hostname"; name = "hostname";