diff --git a/marker.nix b/marker.nix index e31c955..bc53e8c 100644 --- a/marker.nix +++ b/marker.nix @@ -100,6 +100,10 @@ in arrival = { location = "Prague"; }; + + pathStyle = { + weight = 10; + }; }; ganondorf.departure = { diff --git a/path.nix b/path.nix index a415815..cea9759 100644 --- a/path.nix +++ b/path.nix @@ -5,11 +5,35 @@ let locations = lib.mkOption { type = lib.types.listOf lib.types.str; }; + + style = lib.mkOption { + type = pathStyleType; + default = {}; + }; + }; + }; + + pathStyleType = lib.types.submodule { + options = { + weight = lib.mkOption { + type = lib.types.ints.between 1 20; + default = 5; + }; }; }; in { options = { + users = lib.mkOption { + type = lib.types.attrsOf ( + lib.types.submodule { + options.pathStyle = lib.mkOption { + type = pathStyleType; + default = {}; + }; + }); + }; + map.paths = lib.mkOption { type = lib.types.listOf pathType; }; @@ -22,6 +46,8 @@ in user.departure.location user.arrival.location ]; + + style = user.pathStyle; }) (lib.filter ( user: user.departure.location != null @@ -35,7 +61,11 @@ in paramForPath = path: let - attributes = builtins.map attrForLocation path.locations; + attributes = + [ + "weight:${toString path.style.weight}" + ] + ++ builtins.map attrForLocation path.locations; in ''path="${lib.concatStringsSep "|" attributes}"''; in