configuration/packages/organize-downloads.nix

26 lines
701 B
Nix
Raw Normal View History

2023-01-21 02:59:40 +00:00
{ config, pkgs, ... }:
2022-06-08 20:53:00 +00:00
let
2023-11-28 17:46:03 +00:00
inherit (builtins) readFile;
2022-08-02 18:34:45 +00:00
handler = with pkgs; resholve.writeScriptBin "organize-downloads" {
interpreter = "${bash}/bin/bash";
inputs = [ coreutils efficient-compression-tool ];
2023-11-28 17:46:03 +00:00
} (readFile ./resources/organize-downloads);
2022-06-08 20:53:00 +00:00
in
{
config = {
systemd.user.paths.organize-downloads = {
Unit.Description = "Watch downloads";
Path.PathExistsGlob = "%h/Downloads/Screen{s,\\ S}hot\\ *.png";
Install.WantedBy = [ "default.target" ];
};
systemd.user.services.organize-downloads = {
Unit.Description = "Organize downloads";
Service.ExecStart = "${handler}/bin/organize-downloads";
Service.Nice = 10;
};
};
}