more modules
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{ pkgs, lib, config, ... }: {
|
||||
|
||||
options = {
|
||||
scripts.output = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
};
|
||||
|
||||
requestParams = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
@@ -11,8 +15,28 @@
|
||||
name = "map";
|
||||
runtimeInputs = with pkgs; [ curl feh ];
|
||||
text = ''
|
||||
${./map.sh} size=640x640 scale=2 | feh -
|
||||
${./map.sh} ${lib.concatStringsSep " "
|
||||
config.requestParams} | feh -
|
||||
'';
|
||||
};
|
||||
|
||||
requestParams = [
|
||||
"size=640x640"
|
||||
"scale=2"
|
||||
(lib.mkIf (config.map.zoom != null)
|
||||
"zoom=${toString config.map.zoom}")
|
||||
];
|
||||
|
||||
map = {
|
||||
zoom = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = 10;
|
||||
};
|
||||
|
||||
center = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = "switzerland";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user