How to uninstall Espanso?

I have these errors in my journal:

jan 04 01:14:34 pierre-nixos .espanso-wrapped[232277]: 01:14:34 [daemon(232277)] [ERROR] received unexpected exit code from worker 101, exiting
jan 04 01:14:34 pierre-nixos .espanso-wrapped[232270]: thread 'main' panicked at espanso/src/cli/launcher/mod.rs:213:45:
jan 04 01:14:34 pierre-nixos .espanso-wrapped[232270]: failed to launch daemon: unexpected error, 'espanso daemon' returned a non-zero exit code.
jan 04 01:14:34 pierre-nixos .espanso-wrapped[232270]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
jan 04 01:14:34 pierre-nixos systemd[159755]: espanso.service: Main process exited, code=exited, status=101/n/a
jan 04 01:14:34 pierre-nixos systemd[159755]: espanso.service: Failed with result 'exit-code'.

But I have no mention of Espando in my configuration, and I am unable to find Espando in my list of services.

I don’t know where this is coming from.

Can you please help me find a way to uninstall it?

I could not find any dependencies declared in the nixpkgs tree. Could you find the binary of it? (if it’s in your path, you can use realpath $(which espanso), otherwise check the systemd service definition via systemctl status)
Then you can call nix why-depends /run/current-system $binarypath to see the dependency brings it in afaik.

It should only be coming from services.espanso.enable = true. Are you sure your config does not include that?

My configuration is in a directory with multiple files.

grep -R espanso .

Finds nothing.

Please run systemctl cat espanso.service and post the output here.

I found

│ ├─espanso.service
                 │ │ └─463605 /nix/store/3abwqv1a1bdycmgaydzfw3a0qzxwk8am-systemd-256.8/lib/systemd/systemd-executor --deserialize 122 --log-level info --log-target auto

for

What does this mean?

systemctl cat espanso.service
No files found for espanso.service.

Okay, in that case try systemctl cat --user espanso.service. I think you also want to run systemctl status espanso.service, it may provide more info.

1 Like
systemctl cat --user espanso.service
# /home/pierre/.config/systemd/user/espanso.service
[Unit]
Description=espanso

[Service]
ExecStart=/nix/store/n62ppvghqzn2wgaflv73givf92l2bk2x-espanso-2.1.8/bin/.espanso-wrapped launcher
Restart=on-failure
RestartSec=3

[Install]
WantedBy=default.target
systemctl --user status espanso.service
â—Ź espanso.service - espanso
     Loaded: loaded (/home/pierre/.config/systemd/user/espanso.service; enabled; preset: ignored)
     Active: activating (auto-restart) (Result: exit-code) since Sun 2025-01-05 02:45:24 EST; 521ms ago
 Invocation: 4ff85f75c7b441b6956405978d65b5d3
    Process: 480089 ExecStart=/nix/store/n62ppvghqzn2wgaflv73givf92l2bk2x-espanso-2.1.8/bin/.espanso-wrapped launcher (code=exited, status=101)
   Main PID: 480089 (code=exited, status=101)
   Mem peak: 15.7M
        CPU: 88ms
systemctl --user disable espanso.service
Removed '/home/pierre/.config/systemd/user/default.target.wants/espanso.service'.

OK, the service is now removed.