Compare commits
2 commits
a8a685ccf3
...
077ce8bf35
Author | SHA1 | Date | |
---|---|---|---|
077ce8bf35 | |||
3237fe5d84 |
2 changed files with 31 additions and 1 deletions
|
@ -98,11 +98,13 @@ in
|
|||
};
|
||||
|
||||
arrival = {
|
||||
location = "Prague";
|
||||
location = "Chile";
|
||||
};
|
||||
|
||||
pathStyle = {
|
||||
weight = 10;
|
||||
color = "purple";
|
||||
geodesic = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
28
path.nix
28
path.nix
|
@ -19,8 +19,34 @@ let
|
|||
type = lib.types.ints.between 1 20;
|
||||
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
|
||||
{
|
||||
options = {
|
||||
|
@ -64,6 +90,8 @@ in
|
|||
attributes =
|
||||
[
|
||||
"weight:${toString path.style.weight}"
|
||||
"color:${path.style.color}"
|
||||
"geodesic:${lib.boolToString path.style.geodesic}"
|
||||
]
|
||||
++ builtins.map attrForLocation path.locations;
|
||||
in
|
||||
|
|
Loading…
Reference in a new issue