25 lines
622 B
Nix
25 lines
622 B
Nix
|
{
|
||
|
config,
|
||
|
pkgs,
|
||
|
...
|
||
|
}: let
|
||
|
resize-images = pkgs.writeTextFile {
|
||
|
name = "resize-images";
|
||
|
executable = true;
|
||
|
destination = "/bin/resize-images";
|
||
|
text = ''
|
||
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
set -o pipefail
|
||
|
|
||
|
for file in *.jpg; do convert $file -resize 1000x1000 -quality 95 $file > /dev/null 2>&1; done
|
||
|
for file in *.JPG; do convert $file -resize 1000x1000 -quality 95 $file > /dev/null 2>&1; done
|
||
|
for file in *.png; do convert $file -resize 1000x1000 -quality 95 $file > /dev/null 2>&1; done
|
||
|
exit 0
|
||
|
'';
|
||
|
};
|
||
|
in {
|
||
|
home.packages = with pkgs; [resize-images];
|
||
|
}
|