{pkgs, ...}: { # Add a udev rule that launches a backup using restic when a specific USB device (the backup drive) is plugged in environment.systemPackages = with pkgs; [ restic ]; services.udev.packages = [ (pkgs.writeTextFile { name = "bakc"; text = '' SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", ATTRS{idProduct}=="1969", MODE="0666", TAG+="uaccess", SYMLINK+="stm32_dfu", GROUP="plugdev" ''; destination = "/etc/udev/rules.d/50-zsa.rules"; }) ]; }