summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-08-05 10:57:09 +0200
committertv <tv@krebsco.de>2020-08-05 11:07:51 +0200
commitd200bf09cba4b614390eadc7bb95fbded0ceefbc (patch)
treef3244ecd9a8faf5e970a79924908c05f0e03228e /lib
parent532c0c90ad6213b151c44abcf0e23b8c4ca7537f (diff)
types: add systemd unit name
Diffstat (limited to 'lib')
-rw-r--r--lib/types.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 82e184b..66b01fd 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -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";