nixos-config/modules/programs/curl-scripts.nix
Ingolf Wagner 54bab918d7
init
2019-10-24 02:24:33 +02:00

34 lines
640 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
weatherScript = pkgs.writeShellScriptBin "weather" ''
${pkgs.curl}/bin/curl wttr.in/Berlin
'';
qrCodeScript = pkgs.writeShellScriptBin "qrCode" ''
${pkgs.curl}/bin/curl "qrenco.de/$1"
'';
cheatSheetScript = pkgs.writeShellScriptBin "cheatsheet" ''
${pkgs.curl}/bin/curl "cheat.sh/$1"
'';
cfg = config.programs.custom.curlScripts;
in {
options.programs.custom.curlScripts.enable = mkEnableOption "enable curl scripts";
config = mkIf cfg.enable {
environment.systemPackages = [
weatherScript
qrCodeScript
cheatSheetScript
];
};
}