mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 03:39:47 +01:00
emacs: Fix socket activation
This commit is contained in:
parent
2e4250a532
commit
5136542501
2 changed files with 15 additions and 1 deletions
|
@ -205,9 +205,21 @@ in {
|
||||||
FileDescriptorName = "server";
|
FileDescriptorName = "server";
|
||||||
SocketMode = "0600";
|
SocketMode = "0600";
|
||||||
DirectoryMode = "0700";
|
DirectoryMode = "0700";
|
||||||
|
# This prevents the service from immediately starting again
|
||||||
|
# after being stopped, due to the function
|
||||||
|
# `server-force-stop' present in `kill-emacs-hook', which
|
||||||
|
# calls `server-running-p', which opens the socket file.
|
||||||
|
FlushPending = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = { WantedBy = [ "sockets.target" ]; };
|
Install = {
|
||||||
|
WantedBy = [ "sockets.target" ];
|
||||||
|
# Adding this Requires= dependency ensures that systemd
|
||||||
|
# manages the socket file, in the case where the service is
|
||||||
|
# started when the socket is stopped.
|
||||||
|
# The socket unit is implicitly ordered before the service.
|
||||||
|
RequiredBy = [ "emacs.service" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
[Install]
|
[Install]
|
||||||
|
RequiredBy=emacs.service
|
||||||
WantedBy=sockets.target
|
WantedBy=sockets.target
|
||||||
|
|
||||||
[Socket]
|
[Socket]
|
||||||
DirectoryMode=0700
|
DirectoryMode=0700
|
||||||
FileDescriptorName=server
|
FileDescriptorName=server
|
||||||
|
FlushPending=true
|
||||||
ListenStream=%t/emacs/server
|
ListenStream=%t/emacs/server
|
||||||
SocketMode=0600
|
SocketMode=0600
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue