commit:     fa553e145220552e70017dcab2fbb3fedde5f0c5
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 13:41:16 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 14:00:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa553e14

app-shells/atuin: install atuin-daemon systemd user units

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-shells/atuin/atuin-18.4.0.ebuild        |  4 ++++
 app-shells/atuin/files/atuin-daemon.service | 10 ++++++++++
 app-shells/atuin/files/atuin-daemon.socket  | 10 ++++++++++
 3 files changed, 24 insertions(+)

diff --git a/app-shells/atuin/atuin-18.4.0.ebuild 
b/app-shells/atuin/atuin-18.4.0.ebuild
index 6b9bb0371321..23dba724e34c 100644
--- a/app-shells/atuin/atuin-18.4.0.ebuild
+++ b/app-shells/atuin/atuin-18.4.0.ebuild
@@ -622,6 +622,10 @@ src_install() {
        dozshcomp "completions/_${PN}"
        dofishcomp "completions/${PN}.fish"
 
+       if use daemon; then
+               systemd_douserunit "${FILESDIR}"/atuin-daemon.{service,socket}
+       fi
+
        if ! use client; then
                return 0
        fi

diff --git a/app-shells/atuin/files/atuin-daemon.service 
b/app-shells/atuin/files/atuin-daemon.service
new file mode 100644
index 000000000000..28ebf65a7874
--- /dev/null
+++ b/app-shells/atuin/files/atuin-daemon.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=atuin shell history daemon
+Requires=atuin-daemon.socket
+
+[Service]
+ExecStart=atuin daemon
+
+[Install]
+Also=atuin-daemon.socket
+WantedBy=default.target

diff --git a/app-shells/atuin/files/atuin-daemon.socket 
b/app-shells/atuin/files/atuin-daemon.socket
new file mode 100644
index 000000000000..6868675409d7
--- /dev/null
+++ b/app-shells/atuin/files/atuin-daemon.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Unix socket activation for atuin shell history daemon
+
+[Socket]
+ListenStream=%t/atuin.sock
+SocketMode=0600
+RemoveOnStop=true
+
+[Install]
+WantedBy=sockets.target

Reply via email to