more modules

This commit is contained in:
2026-02-26 10:49:48 -05:00
parent db6534a1eb
commit e97dec5058

View File

@@ -1,9 +1,13 @@
{ pkgs, lib, ... }: { { pkgs, lib, config, ... }: {
options = { options = {
scripts.output = lib.mkOption { scripts.output = lib.mkOption {
type = lib.types.package; type = lib.types.package;
}; };
requestParams = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
}; };
config = { config = {
@@ -11,8 +15,28 @@
name = "map"; name = "map";
runtimeInputs = with pkgs; [ curl feh ]; runtimeInputs = with pkgs; [ curl feh ];
text = '' 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";
};
};
}; };
} }