{ stdenv, lib, ... }:
let
  inherit (lib.fileset) toSource unions intersection maybeMissing gitTracked;
  sourceFiles = unions [
    (gitTracked ./.)
    (maybeMissing ./cap_blow.png)
    (maybeMissing ./cap_filter.png)
  ];
in
lib.fileset.trace sourceFiles
stdenv.mkDerivation {
  name = "my-wallpapers";
  src = toSource {
    root = ./.;
    fileset = sourceFiles;
  };
  installPhase = ''
    mkdir -p $out/usr/local/share/wallpapers
    cp -r *.{jpg,jpeg,png} $out/usr/local/share/wallpapers/
  '';
}
