`pgrep -x somecommand` exits with a non-zero status if it finds no
process running with the given name. When using home-manager as a
NixOS module, on boot (when sway isn't running) this script would
fail and then fail the unit since it seems the onChange scripts
are running with the -e switch.
This change ensures we're always returning a 0 exit status where we
attempt to get the pid of sway - we're only interested in either the
pid or an empty string, the exit status isn't important.
The `ExecStart=` option of systemd must take arguments fully quoted.
That is,
"-sshargs=-i somekey"
and not
-ssargs="-i somekey"
Additionally, inside arguments passed to unison, `=` characters must
be quoted. After unquotation by systemd, one must have
-sshargs=-o Foo\=4
instead of
-sshargs=-o Foo=4
When running the service start script with `DISPLAY` set, a `gi`
import error is triggered. Blanking the variable will make the script
use a different code path that does not attempt to import `gi`.
Also moves activation script up into start of script instead.
PR #1415
This option can be used to enable optional Spotifyd features, such as
looking up the Spotify password in the system keyring or enabling
MPRIS support.
PR #1390
Emacs populates 'exec-path' at launch from the 'PATH' environment
variable. Likewise, the emacs derivation from nixpkgs populates
'load-path' from the 'NIX_PROFILES' variable. As neither of these are
available by default in the systemd user manager, revert to the
previous behavior of launching the Emacs daemon from a login shell.
Fixes#1354Fixes#1340
PR #1355
Add 'services.emacs.socketActivation.enable' for generating an
'emacs.socket' systemd unit.
Emacs since version 26 has supported socket activation, whereby an
external process manager such as systemd listens on a socket and passes
it to the Emacs daemon when the manager launches it. This improves
startup time of the user session and avoids launching the daemon when not
needed, for example when launching the user session via SSH.
This implementation hard-codes the socket path to the default for the
version of 'programs.emacs.finalPackage', because systemd does not
perform shell expansion in the socket unit's 'ListenStream' parameter
and it seems like an advanced use-case to change the socket path. Shell
expansion would be desirable as the socket path usually resides in
directories such as $XDG_RUNTIME_DIR or $TMPDIR.
Tests were added to verify behavior in the following cases:
- Emacs service with socket activation disabled
- Emacs 26 with socket activation enabled
- Emacs 27 with socket activation enabled
PR #1314
Add an option to enable a .desktop file for the Emacs client.
PR #1223
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: Robert Helgesson <robert@rycee.net>
Nixpkgs no longer packages compton, and instead packages picom, a
(mostly) compatible fork of compton, providing an alias from compton
to picom. Because some configuration options have been changed, and
all references to "compton" have been made deprecated and replaced
with "picom", 'services.compton' has been deprecated in favor of the
new 'services.picom'.
Resolves#878
PR #1101