This is the same method as is used in creating an email account, named
`<name>` under `accounts.email.accounts.<name>`. This allows the user
to specify groups and channels, in a list-like format, but still gets
the "namespacing" to more easily handle the options available in each
of these locations.
This function takes in a set of groups, which includes their
consituent channels and writes the appropriate .mbsyncrc block for the
channel. The block that is generated is shown below:
Channel groupName1-channelName1
Master :<accountName>-remote:<master-pattern>
Slave :<accountName>-local:<slave-pattern>
Channel groupName2-channelName2
Master :<accountName>-remote:<master-pattern>
Slave :<accountName>-local:<slave-pattern>
Each group must have a unique name, no matter which account it is
declared under. The same holds true for channels.
Using channels with the patterns set up this way allows one to specify
which maildir directories are to be synchronized FROM the master TO
the slave. In addition, it allows for these maildirs to be remapped,
between the master server and the local slave.
This is critical, because Gmail has a strange way of storing its mail
that makes using mbsync, mu, and mu4e more difficult.
There are additional channel parameters that are already present in
this codebase from the previous use of group-channel configuration,
which will be reused.
This function takes in a set of groups, and their consituent
channels and writes the appropriate .mbsyncrc block. The block is as
shown below:
Group groupName1
Channel channelName1
Channel channelName2
Group groupName2
Channel channelName3
Each group must have a unique name, no matter which account it is
declared under. The same holds true for channels. However, if there is
a group that shares the same name as the channel, the channel will
effectively be "shadowed" by the group, and mbsync will default to
working with the group in that case.
This is the end of the configuration that the end-user will use.
They will specify an attribute set that contains the name for the
group, so they can say
`accounts.email.accounts.<aname>.groups.<gname>` to access the
configuration for the group with the name `<gname>`.
A group is a grouping of channels together, so that many channels with
very different names can be handled as a single entity.
Groups are unique in mbsync because they will shadow channels that
have the same name on the command-line.
A channel is a relationship between 2 directories/boxes/mailboxes
between the local machine (slave) and the remote mail server (master).
Each channel must be given at least:
* an account-unique name
* a pattern for which mailboxes to sync from master
* a pattern for what directory where that mail ends up on the
slave
Additional options can be added later.
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