NixTutorial/default.nix

32 lines
566 B
Nix

{ pkgs, lib, config, ... }:
{
options = {
scripts.output = lib.mkOption {
type = lib.types.package;
};
requestParams = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
};
config = {
scripts.output = pkgs.writeShellApplication {
name = "map";
runtimeInputs = with pkgs; [
curl
imagemagick
];
text = ''
convert <(${./map} ${lib.concatStringsSep " " config.requestParams}) sixel:-
'';
};
requestParams = [
"size=640x300"
"scale=2"
];
};
}