diff --git a/.gitignore b/.gitignore index ad467a2..99b71d1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ !/nix !/src -!/vendor +!/contrib # Rust/Cargo !/Cargo.lock diff --git a/README.md b/README.md index a974185..caa0a3d 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ stash watch This runs a daemon that monitors the clipboard and stores new entries automatically. This is designed as an alternative to shelling out to `wl-paste --watch` inside a Systemd service or XDG autostart. You may find a -premade Systemd service in `vendor/`. Packagers are encouraged to vendor the +premade Systemd service in `contrib/`. Packagers are encouraged to vendor the service unless adding their own. > [!TIP] @@ -216,8 +216,9 @@ LoadCredential=clipboard_filter:/etc/stash/clipboard_filter ``` The file `/etc/stash/clipboard_filter` should contain your regex pattern (no -quotes). This is done automatically in the vendored Systemd service. Remember to -set the appropriate file permissions if using this option. +quotes). This is done automatically in the +[vendored Systemd service](./contrib/stash.service). Remember to set the +appropriate file permissions if using this option. The service will check the credential file first, then the environment variable. If a clipboard entry matches the regex, it will be skipped and a warning will be diff --git a/vendor/stash.service b/contrib/stash.service similarity index 100% rename from vendor/stash.service rename to contrib/stash.service diff --git a/nix/package.nix b/nix/package.nix index 3c32991..8ca3d8e 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -30,18 +30,12 @@ in strictDeps = true; - # Whether cargo's target directory should be copied as an output - doInstallCargoArtifacts = true; - - # Install Systemd service for Stash into $out/share. - # This can be used to use Stash in 'systemd.packages' + # Since Crane doesn't have a good way of enforcing that our symlinks + # generated by the build wrapper are correctly linked, we should link + # them *manually*. The postInstallCheck phase that follows will check + # to verify if all of those links are in place. postInstall = '' mkdir -p $out - install -Dm755 ${../vendor/stash.service} $out/share/stash.service - - # Since Crane doesn't have a good way of enforcing that our symlinks - # generated by the build wrapper are correctly linked, we should link - # them *manually*. for bin in stash-copy stash-paste wl-copy wl-paste; do ln -sf $out/bin/stash $out/bin/$bin done @@ -51,7 +45,7 @@ in doInstallCheck = true; # After the version check, let's see if all binaries are linked correctly. - # We could probably add a check phase to the versions of each. + # We could probably add a check phase to get the versions of each. postInstallCheck = '' for bin in stash stash-copy stash-paste wl-copy wl-paste; do [ -x "$out/bin/$bin" ] || { echo "$bin missing"; exit 1; }