Compare commits

...

17 commits

Author SHA1 Message Date
David Arnold 6639e3a837
home-environment: remove no-op commands
(cherry picked from commit 989d4fa536)
2022-11-08 12:35:31 +01:00
Ronny Pfannschmidt 071e28c869
home-environment: fix activation on new style profiles
When using the new style profiles we get conflicts when trying to
replace the old `home-path` derivation. To avoid this conflict we
delete the old `home-path` before the install.

Unfortunately, `nix profile` does not yet have a equivalent for
`nix-env --set` and we have to do this hackish workaround. See

  https://github.com/NixOS/nix/issues/6349

for the associated issue in Nix.

Fixes #2848

(cherry picked from commit ccc9164b76)
2022-11-08 12:35:30 +01:00
Robert Helgesson 87d55517f6
ci: use the right Nixpkgs channel for 22.05 tests 2022-11-05 20:43:09 +01:00
David Arnold d148e1dd61
targets/generic-linux: use the correct nix package
(cherry picked from commit 183a62f356)
2022-11-05 20:23:41 +01:00
Robert Helgesson d78b3488a7
home-environment: update hm-version generation
Instead of home-made script use the Nixpkgs library functions. This
will hopefully be more robust and give more accurate results.

(cherry picked from commit 423211401c)
2022-11-03 10:51:58 +01:00
Robert Helgesson ce4cfdce2c
home-environment: make getVersion more robust
(cherry picked from commit f67649307d)
2022-11-03 10:51:49 +01:00
Robert Helgesson 2a4d5e6f44
home-environment: add hm-version file
This commits adds a file `hm-version` to the generated generation
directory. This file will contain the release version, and if
available, the Git commit hash.

(cherry picked from commit 32fe7d2ebb)
2022-11-03 10:51:42 +01:00
dependabot[bot] f0ecd4b1db
ci: bump cachix/cachix-action from 11 to 12
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 11 to 12.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v11...v12)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 10:40:27 +00:00
zimbatm a13f155be7
ci: use the cachix auth token
(cherry picked from commit 722e8d65d3)
2022-11-01 11:39:12 +01:00
Robert Helgesson d8b233ad03
docs: bump nmd
Also use `fetchTarball` instead of `fetchFromGitLab`.
2022-10-31 12:44:55 +01:00
dependabot[bot] b81e128fc0
ci: bump cachix/cachix-action from 10 to 11
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 10 to 11.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v10...v11)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 08:44:25 +00:00
dependabot[bot] 152ecaf9ef
ci: bump cachix/install-nix-action from 17 to 18
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 17 to 18.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v17...v18)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 07:31:47 +00:00
Robert Helgesson 737a00f5d2
redshift: remove petabyteboy from maintainers
(cherry picked from commit f2445620d1)
2022-10-17 09:28:48 +02:00
Robert Helgesson 17208be516
home-manager: set state version when uninstalling
Otherwise the switch exits with an error.

Fixes #3320

(cherry picked from commit ebe6d2c747)
2022-10-11 10:01:03 +02:00
Thiago Kenji Okada 4a3d01fb53 docs: update nmd 2022-06-25 16:09:15 +01:00
Eliza Velasquez a839432a5c mujmap: add module
mujmap is a tool that synchronizes mail between a mail server and
notmuch via JMAP. It's very similar to lieer, so I heavily based the
implementation of the notmuch module on lieer's. I did not include an
equivalent to lieer's periodic synchronization service, however,
because I plan to soon introduce a daemon mode to mujmap.

https://github.com/elizagamedev/mujmap
(cherry picked from commit d059b9448a)
2022-06-21 23:51:30 -07:00
Robert Helgesson 40ec43d367 email: add support for JMAP
Co-authored-by: Eliza Velasquez <4576666+elizagamedev@users.noreply.github.com>
(cherry picked from commit 467617947d)
2022-06-21 23:51:13 -07:00
18 changed files with 517 additions and 24 deletions

3
.github/CODEOWNERS vendored
View file

@ -163,6 +163,9 @@
/modules/programs/mu.nix @KarlJoad /modules/programs/mu.nix @KarlJoad
/modules/programs/mujmap.nix @elizagamedev
/tests/modules/programs/mujmap @elizagamedev
/modules/programs/navi.nix @marsam /modules/programs/navi.nix @marsam
/modules/programs/ncmpcpp.nix @olmokramer /modules/programs/ncmpcpp.nix @olmokramer

View file

@ -11,13 +11,13 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17 - uses: cachix/install-nix-action@v18
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10 - uses: cachix/cachix-action@v12
with: with:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: | - run: |
nix-build -A docs.html nix-build -A docs.html
cp -r result/share/doc/home-manager public cp -r result/share/doc/home-manager public

View file

@ -12,13 +12,13 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17 - uses: cachix/install-nix-action@v18
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v10 - uses: cachix/cachix-action@v12
with: with:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: | - run: |
if grep -R --exclude stdlib-extended.nix literalExample modules ; then if grep -R --exclude stdlib-extended.nix literalExample modules ; then
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr

View file

@ -5,12 +5,10 @@
let let
nmdSrc = pkgs.fetchFromGitLab { nmdSrc = fetchTarball {
name = "nmd"; url =
owner = "rycee"; "https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169";
repo = "nmd"; sha256 = "0c2nq28rw4v559s3f1nf6y2p6fladgmbqgbsyf3vzs2przn5qn37";
rev = "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd";
sha256 = "1s49gjn1wapcjn0q4gabi8jwp8k5f18354a9c1vji0hfqsaknxzj";
}; };
nmd = import nmdSrc { inherit lib pkgs; }; nmd = import nmdSrc { inherit lib pkgs; };

View file

@ -480,7 +480,10 @@ function doUninstall() {
y|Y) y|Y)
_i "Switching to empty Home Manager configuration..." _i "Switching to empty Home Manager configuration..."
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)" HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG" echo "{ lib, ... }: {" > "$HOME_MANAGER_CONFIG"
echo " home.file = lib.mkForce {};" >> "$HOME_MANAGER_CONFIG"
echo " home.stateVersion = \"18.09\";" >> "$HOME_MANAGER_CONFIG"
echo "}" >> "$HOME_MANAGER_CONFIG"
doSwitch doSwitch
$DRY_RUN_CMD $REMOVE_CMD home-manager-path || true $DRY_RUN_CMD $REMOVE_CMD home-manager-path || true
rm "$HOME_MANAGER_CONFIG" rm "$HOME_MANAGER_CONFIG"

View file

@ -123,6 +123,38 @@ let
}; };
}; };
jmapModule = types.submodule {
options = {
host = mkOption {
type = types.nullOr types.str;
default = null;
example = "jmap.example.org";
description = ''
Hostname of JMAP server.
</para><para>
If both this option and <xref
linkend="opt-accounts.email.accounts._name_.jmap.sessionUrl"/> are specified,
<code>host</code> is preferred by applications when establishing a
session.
'';
};
sessionUrl = mkOption {
type = types.nullOr types.str;
default = null;
example = "https://jmap.example.org:443/.well-known/jmap";
description = ''
URL for the JMAP Session resource.
</para><para>
If both this option and <xref
linkend="opt-accounts.email.accounts._name_.jmap.host"/> are specified,
<code>host</code> is preferred by applications when establishing a
session.
'';
};
};
};
smtpModule = types.submodule { smtpModule = types.submodule {
options = { options = {
host = mkOption { host = mkOption {
@ -205,7 +237,7 @@ let
indicate the nature of the provider. indicate the nature of the provider.
</para><para> </para><para>
When this indicates a specific provider then, for example, When this indicates a specific provider then, for example,
the IMAP and SMTP server configuration may be set the IMAP, SMTP, and JMAP server configuration may be set
automatically. automatically.
''; '';
}; };
@ -234,7 +266,7 @@ let
default = null; default = null;
description = '' description = ''
The server username of this account. This will be used as The server username of this account. This will be used as
the SMTP and IMAP user name. the SMTP, IMAP, and JMAP user name.
''; '';
}; };
@ -299,6 +331,14 @@ let
''; '';
}; };
jmap = mkOption {
type = types.nullOr jmapModule;
default = null;
description = ''
The JMAP configuration to use for this account.
'';
};
signature = mkOption { signature = mkOption {
type = signatureModule; type = signatureModule;
default = { }; default = { };
@ -343,10 +383,16 @@ let
host = "smtp.fastmail.com"; host = "smtp.fastmail.com";
port = if config.smtp.tls.useStartTls then 587 else 465; port = if config.smtp.tls.useStartTls then 587 else 465;
}; };
imap = { imap = {
host = "imap.fastmail.com"; host = "imap.fastmail.com";
port = 993; port = 993;
}; };
jmap = {
host = "fastmail.com";
sessionUrl = "https://jmap.fastmail.com/.well-known/jmap";
};
}) })
(mkIf (config.flavor == "gmail.com") { (mkIf (config.flavor == "gmail.com") {
userName = mkDefault config.address; userName = mkDefault config.address;

View file

@ -581,7 +581,6 @@ in
if [[ -e "$nixProfilePath"/manifest.json ]] ; then if [[ -e "$nixProfilePath"/manifest.json ]] ; then
nix profile list \ nix profile list \
| { grep 'home-manager-path$' || test $? = 1; } \ | { grep 'home-manager-path$' || test $? = 1; } \
| awk -F ' ' '{ print $4 }' \
| cut -d ' ' -f 4 \ | cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
else else
@ -592,22 +591,36 @@ in
'' ''
else else
'' ''
function nixReplaceProfile() {
local oldNix="$(command -v nix)"
nix profile list \
| { grep 'home-manager-path$' || test $? = 1; } \
| cut -d ' ' -f 4 \
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
$DRY_RUN_CMD $oldNix profile install $1
}
if [[ -e "$nixProfilePath"/manifest.json ]] ; then if [[ -e "$nixProfilePath"/manifest.json ]] ; then
INSTALL_CMD="nix profile install" INSTALL_CMD="nix profile install"
INSTALL_CMD_ACTUAL="nixReplaceProfile"
LIST_CMD="nix profile list" LIST_CMD="nix profile list"
REMOVE_CMD_SYNTAX='nix profile remove {number | store path}' REMOVE_CMD_SYNTAX='nix profile remove {number | store path}'
else else
INSTALL_CMD="nix-env -i" INSTALL_CMD="nix-env -i"
INSTALL_CMD_ACTUAL="$DRY_RUN_CMD nix-env -i"
LIST_CMD="nix-env -q" LIST_CMD="nix-env -q"
REMOVE_CMD_SYNTAX='nix-env -e {package name}' REMOVE_CMD_SYNTAX='nix-env -e {package name}'
fi fi
if ! $DRY_RUN_CMD $INSTALL_CMD ${cfg.path} ; then if ! $INSTALL_CMD_ACTUAL ${cfg.path} ; then
echo echo
_iError $'Oops, Nix failed to install your new Home Manager profile!\n\nPerhaps there is a conflict with a package that was installed using\n"%s"? Try running\n\n %s\n\nand if there is a conflicting package you can remove it with\n\n %s\n\nThen try activating your Home Manager configuration again.' "$INSTALL_CMD" "$LIST_CMD" "$REMOVE_CMD_SYNTAX" _iError $'Oops, Nix failed to install your new Home Manager profile!\n\nPerhaps there is a conflict with a package that was installed using\n"%s"? Try running\n\n %s\n\nand if there is a conflicting package you can remove it with\n\n %s\n\nThen try activating your Home Manager configuration again.' "$INSTALL_CMD" "$LIST_CMD" "$REMOVE_CMD_SYNTAX"
exit 1 exit 1
fi fi
unset INSTALL_CMD LIST_CMD REMOVE_CMD_SYNTAX unset -f nixReplaceProfile
unset INSTALL_CMD INSTALL_CMD_ACTUAL LIST_CMD REMOVE_CMD_SYNTAX
'' ''
); );
@ -685,6 +698,8 @@ in
'' ''
mkdir -p $out mkdir -p $out
echo "${config.home.version.full}" > $out/hm-version
cp ${activationScript} $out/activate cp ${activationScript} $out/activate
mkdir $out/bin mkdir $out/bin

View file

@ -554,6 +554,13 @@ in
A new module is available: 'services.mopidy'. A new module is available: 'services.mopidy'.
''; '';
} }
{
time = "2022-06-21T22:29:37+00:00";
message = ''
A new module is available: 'programs.mujmap'.
'';
}
]; ];
}; };
} }

View file

@ -30,5 +30,39 @@ with lib;
conversion or moving files. conversion or moving files.
''; '';
}; };
home.version = {
full = mkOption {
internal = true;
readOnly = true;
type = types.str;
default = let
inherit (config.home.version) release revision;
suffix =
optionalString (revision != null) "+${substring 0 8 revision}";
in "${release}${suffix}";
example = "22.05+213a0629";
description = "The full Home Manager version.";
};
release = mkOption {
internal = true;
readOnly = true;
type = types.str;
default = fileContents ../../.release;
example = "22.05";
description = "The Home Manager release.";
};
revision = mkOption {
internal = true;
type = types.nullOr types.str;
default = let gitRepo = "${toString ./../..}/.git";
in if pathIsGitRepo gitRepo then commitIdFromGitRepo gitRepo else null;
description = ''
The Git revision from which this Home Manager configuration was built.
'';
};
};
}; };
} }

View file

@ -109,6 +109,7 @@ let
./programs/mpv.nix ./programs/mpv.nix
./programs/msmtp.nix ./programs/msmtp.nix
./programs/mu.nix ./programs/mu.nix
./programs/mujmap.nix
./programs/navi.nix ./programs/navi.nix
./programs/ncmpcpp.nix ./programs/ncmpcpp.nix
./programs/ncspot.nix ./programs/ncspot.nix

315
modules/programs/mujmap.nix Normal file
View file

@ -0,0 +1,315 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.mujmap;
mujmapAccounts =
filter (a: a.mujmap.enable) (attrValues config.accounts.email.accounts);
missingNotmuchAccounts = map (a: a.name)
(filter (a: !a.notmuch.enable && a.mujmap.notmuchSetupWarning)
mujmapAccounts);
notmuchConfigHelp =
map (name: "accounts.email.accounts.${name}.notmuch.enable = true;")
missingNotmuchAccounts;
settingsFormat = pkgs.formats.toml { };
filterNull = attrs: attrsets.filterAttrs (n: v: v != null) attrs;
configFile = account:
let
settings'' = if (account.jmap == null) then
{ }
else
filterNull {
fqdn = account.jmap.host;
session_url = account.jmap.sessionUrl;
};
settings' = settings'' // {
username = account.userName;
password_command = escapeShellArgs account.passwordCommand;
} // filterNull account.mujmap.settings;
settings = if (hasAttr "fqdn" settings') then
(removeAttrs settings' [ "session_url" ])
else
settings';
in {
name = "${account.maildir.absPath}/mujmap.toml";
value.source = settingsFormat.generate
"mujmap-${lib.replaceStrings [ "@" ] [ "_at_" ] account.address}.toml"
settings;
};
tagsOpts = {
lowercase = mkOption {
type = types.bool;
default = false;
description = ''
If true, translate all mailboxes to lowercase names when mapping to notmuch
tags.
'';
};
directory_separator = mkOption {
type = types.str;
default = "/";
example = ".";
description = ''
Directory separator for mapping notmuch tags to maildirs.
'';
};
inbox = mkOption {
type = types.str;
default = "inbox";
description = ''
Tag for notmuch to use for messages stored in the mailbox labeled with the
<code>Inbox</code> name attribute.
</para><para>
If set to an empty string, this mailbox <emphasis>and its child
mailboxes</emphasis> are not synchronized with a tag.
'';
};
deleted = mkOption {
type = types.str;
default = "deleted";
description = ''
Tag for notmuch to use for messages stored in the mailbox labeled with the
<code>Trash</code> name attribute.
</para><para>
If set to an empty string, this mailbox <emphasis>and its child
mailboxes</emphasis> are not synchronized with a tag.
'';
};
sent = mkOption {
type = types.str;
default = "sent";
description = ''
Tag for notmuch to use for messages stored in the mailbox labeled with the
<code>Sent</code> name attribute.
</para><para>
If set to an empty string, this mailbox <emphasis>and its child
mailboxes</emphasis> are not synchronized with a tag.
'';
};
spam = mkOption {
type = types.str;
default = "spam";
description = ''
Tag for notmuch to use for messages stored in the mailbox labeled with the
<code>Junk</code> name attribute and/or with the <code>$Junk</code> keyword,
<emphasis>except</emphasis> for messages with the <code>$NotJunk</code> keyword.
</para><para>
If set to an empty string, this mailbox, <emphasis>its child
mailboxes</emphasis>, and these keywords are not synchronized with a tag.
'';
};
important = mkOption {
type = types.str;
default = "important";
description = ''
Tag for notmuch to use for messages stored in the mailbox labeled with the
<code>Important</code> name attribute and/or with the <code>$Important</code>
keyword.
</para><para>
If set to an empty string, this mailbox, <emphasis>its child
mailboxes</emphasis>, and these keywords are not synchronized with a tag.
'';
};
phishing = mkOption {
type = types.str;
default = "phishing";
description = ''
Tag for notmuch to use for the IANA <code>$Phishing</code> keyword.
</para><para>
If set to an empty string, this keyword is not synchronized with a tag.
'';
};
};
rootOpts = {
username = mkOption {
type = types.nullOr types.str;
default = null;
example = "alice@example.com";
description = ''
Username for basic HTTP authentication.
</para><para>
If <literal>null</literal>, defaults to
<xref linkend="opt-accounts.email.accounts._name_.userName"/>.
'';
};
password_command = mkOption {
type = types.nullOr (types.either types.str (types.listOf types.str));
default = null;
apply = p: if isList p then escapeShellArgs p else p;
example = "pass alice@example.com";
description = ''
Shell command which will print a password to stdout for basic HTTP
authentication.
</para><para>
If <literal>null</literal>, defaults to
<xref linkend="opt-accounts.email.accounts._name_.passwordCommand"/>.
'';
};
fqdn = mkOption {
type = types.nullOr types.str;
default = null;
example = "example.com";
description = ''
Fully qualified domain name of the JMAP service.
</para><para>
mujmap looks up the JMAP SRV record for this host to determine the JMAP session
URL. Mutually exclusive with
<xref linkend="opt-accounts.email.accounts._name_.mujmap.settings.session_url"/>.
</para><para>
If <literal>null</literal>, defaults to
<xref linkend="opt-accounts.email.accounts._name_.jmap.host"/>.
'';
};
session_url = mkOption {
type = types.nullOr types.str;
default = null;
example = "https://jmap.example.com/.well-known/jmap";
description = ''
Sesion URL to connect to.
</para><para>
Mutually exclusive with
<xref linkend="opt-accounts.email.accounts._name_.mujmap.settings.fqdn"/>.
</para><para>
If <literal>null</literal>, defaults to
<xref linkend="opt-accounts.email.accounts._name_.jmap.sessionUrl"/>.
'';
};
auto_create_new_mailboxes = mkOption {
type = types.bool;
default = true;
description = ''
Whether to create new mailboxes automatically on the server from notmuch
tags.
'';
};
cache_dir = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
The cache directory in which to store mail files while they are being
downloaded. The default is operating-system specific.
'';
};
tags = mkOption {
type = types.submodule {
freeformType = settingsFormat.type;
options = tagsOpts;
};
default = { };
description = ''
Tag configuration.
</para><para>
Beware that there are quirks that require manual consideration if changing the
values of these files; please see
<link xlink:href="https://github.com/elizagamedev/mujmap/blob/main/mujmap.toml.example"/>
for more details.
'';
};
};
mujmapOpts = {
enable = mkEnableOption "mujmap JMAP synchronization for notmuch";
notmuchSetupWarning = mkOption {
type = types.bool;
default = true;
description = ''
Warn if Notmuch is not also enabled for this account.
</para><para>
This can safely be disabled if <filename>mujmap.toml</filename> is managed
outside of Home Manager.
'';
};
settings = mkOption {
type = types.submodule {
freeformType = settingsFormat.type;
options = rootOpts;
};
default = { };
description = ''
Settings which are applied to <filename>mujmap.toml</filename>
for the account.
</para><para>
See the <link xlink:href="https://github.com/elizagamedev/mujmap">mujmap project</link>
for documentation of settings not explicitly covered by this module.
'';
};
};
mujmapModule = types.submodule { options = { mujmap = mujmapOpts; }; };
in {
meta.maintainers = with maintainers; [ elizagamedev ];
options = {
programs.mujmap = {
enable = mkEnableOption "mujmap Gmail synchronization for notmuch";
package = mkOption {
type = types.package;
default = pkgs.mujmap;
defaultText = "pkgs.mujmap";
description = ''
mujmap package to use.
'';
};
};
accounts.email.accounts =
mkOption { type = with types; attrsOf mujmapModule; };
};
config = mkIf cfg.enable (mkMerge [
(mkIf (missingNotmuchAccounts != [ ]) {
warnings = [''
mujmap is enabled for the following email accounts, but notmuch is not:
${concatStringsSep "\n " missingNotmuchAccounts}
Notmuch can be enabled with:
${concatStringsSep "\n " notmuchConfigHelp}
If you have configured notmuch outside of Home Manager, you can suppress this
warning with:
programs.mujmap.notmuchSetupWarning = false;
''];
})
{
warnings = flatten (map (account: account.warnings) mujmapAccounts);
home.packages = [ cfg.package ];
# Notmuch should ignore non-mail files created by mujmap.
programs.notmuch.new.ignore = [ "/.*[.](toml|json|lock)$/" ];
home.file = listToAttrs (map configFile mujmapAccounts);
}
]);
}

View file

@ -10,9 +10,7 @@ let
settingsFormat = pkgs.formats.ini { }; settingsFormat = pkgs.formats.ini { };
in { in {
meta = { meta.maintainers = with maintainers; [ rycee thiagokokada ];
maintainers = with maintainers; [ rycee petabyteboy thiagokokada ];
};
imports = let imports = let
mkRenamed = old: new: mkRenamed = old: new:

View file

@ -8,6 +8,8 @@ let
profileDirectory = config.home.profileDirectory; profileDirectory = config.home.profileDirectory;
nixPkg = if config.nix.package == null then pkgs.nix else config.nix.package;
in { in {
imports = [ imports = [
(mkRenamedOptionModule [ "targets" "genericLinux" "extraXdgDataDirs" ] [ (mkRenamedOptionModule [ "targets" "genericLinux" "extraXdgDataDirs" ] [
@ -55,7 +57,7 @@ in {
}; };
home.sessionVariablesExtra = '' home.sessionVariablesExtra = ''
. "${pkgs.nix}/etc/profile.d/nix.sh" . "${nixPkg}/etc/profile.d/nix.sh"
# reset TERM with new TERMINFO available (if any) # reset TERM with new TERMINFO available (if any)
export TERM="$TERM" export TERM="$TERM"
@ -64,7 +66,7 @@ in {
# We need to source both nix.sh and hm-session-vars.sh as noted in # We need to source both nix.sh and hm-session-vars.sh as noted in
# https://github.com/nix-community/home-manager/pull/797#issuecomment-544783247 # https://github.com/nix-community/home-manager/pull/797#issuecomment-544783247
programs.bash.initExtra = '' programs.bash.initExtra = ''
. "${pkgs.nix}/etc/profile.d/nix.sh" . "${nixPkg}/etc/profile.d/nix.sh"
. "${profileDirectory}/etc/profile.d/hm-session-vars.sh" . "${profileDirectory}/etc/profile.d/hm-session-vars.sh"
''; '';

View file

@ -79,6 +79,7 @@ import nmt {
./modules/programs/mbsync ./modules/programs/mbsync
./modules/programs/mpv ./modules/programs/mpv
./modules/programs/mu ./modules/programs/mu
./modules/programs/mujmap
./modules/programs/ncmpcpp ./modules/programs/ncmpcpp
./modules/programs/ne ./modules/programs/ne
./modules/programs/neomutt ./modules/programs/neomutt

View file

@ -0,0 +1,5 @@
{
mujmap-defaults = ./mujmap-defaults.nix;
mujmap-fqdn-and-session-url-specified =
./mujmap-fqdn-and-session-url-specified.nix;
}

View file

@ -0,0 +1,14 @@
auto_create_new_mailboxes = true
fqdn = "example.com"
password_command = "'password-command'"
username = "home.manager"
[tags]
deleted = "deleted"
directory_separator = "/"
important = "important"
inbox = "inbox"
lowercase = false
phishing = "phishing"
sent = "sent"
spam = "spam"

View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
with lib;
{
imports = [ ../../accounts/email-test-accounts.nix ];
config = {
programs.mujmap.enable = true;
programs.mujmap.package = config.lib.test.mkStubPackage { };
accounts.email.accounts."hm@example.com" = {
jmap.host = "example.com";
mujmap.enable = true;
notmuch.enable = true;
};
nmt.script = ''
assertFileExists home-files/Mail/hm@example.com/mujmap.toml
assertFileContent home-files/Mail/hm@example.com/mujmap.toml ${
./mujmap-defaults-expected.toml
}
'';
};
}

View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
with lib;
{
imports = [ ../../accounts/email-test-accounts.nix ];
config = {
programs.mujmap.enable = true;
programs.mujmap.package = config.lib.test.mkStubPackage { };
accounts.email.accounts."hm@example.com" = {
jmap.host = "example.com";
jmap.sessionUrl = "https://jmap.example.com/";
mujmap.enable = true;
notmuch.enable = true;
};
nmt.script = ''
assertFileExists home-files/Mail/hm@example.com/mujmap.toml
assertFileContent home-files/Mail/hm@example.com/mujmap.toml ${
./mujmap-defaults-expected.toml
}
'';
};
}