Add files for displaying a Google Maps picture

This commit is contained in:
Manuel Thalmann 2024-04-25 14:00:00 +02:00
parent 0d8de5ebac
commit 17ecbc3a2a
3 changed files with 41 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,4 +1,3 @@
# ---> Nix
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*

31
default.nix Normal file
View file

@ -0,0 +1,31 @@
{ 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"
];
};
}

10
eval.nix Normal file
View file

@ -0,0 +1,10 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-22.11";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.lib.evalModules {
modules = [
({ config, ... }: { config._module.args = { inherit pkgs; }; })
./default.nix
];
}