Compare commits

...

2 commits

2 changed files with 31 additions and 1 deletions

View file

@ -98,11 +98,13 @@ in
}; };
arrival = { arrival = {
location = "Prague"; location = "Chile";
}; };
pathStyle = { pathStyle = {
weight = 10; weight = 10;
color = "purple";
geodesic = true;
}; };
}; };

View file

@ -19,8 +19,34 @@ let
type = lib.types.ints.between 1 20; type = lib.types.ints.between 1 20;
default = 5; default = 5;
}; };
color = lib.mkOption {
type = colorType;
default = "blue";
};
geodesic = lib.mkOption {
type = lib.types.bool;
default = false;
};
}; };
}; };
colorType = lib.types.either
(lib.types.strMatching "0x[0-9A-F]{3}([0-9A-F]([0-9A-F]{2}([0-9A-F]{2})?)?)?")
(
lib.types.enum [
"black"
"blue"
"brown"
"gray"
"green"
"orange"
"purple"
"red"
"white"
"yellow"
]);
in in
{ {
options = { options = {
@ -64,6 +90,8 @@ in
attributes = attributes =
[ [
"weight:${toString path.style.weight}" "weight:${toString path.style.weight}"
"color:${path.style.color}"
"geodesic:${lib.boolToString path.style.geodesic}"
] ]
++ builtins.map attrForLocation path.locations; ++ builtins.map attrForLocation path.locations;
in in