mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
Merge branch 'master' into smug/init
This commit is contained in:
commit
09af317fc8
28 changed files with 237 additions and 212 deletions
|
@ -2166,6 +2166,17 @@ in {
|
|||
See https://github.com/ivaaaan/smug for more information.
|
||||
'';
|
||||
}
|
||||
{
|
||||
time = "2025-03-24T22:31:45+00:00";
|
||||
message = ''
|
||||
The following default values change from 'true' to
|
||||
'false':
|
||||
|
||||
- programs.zellij.enableBashIntegration
|
||||
- programs.zellij.enableFishIntegration
|
||||
- programs.zellij.enableZshIntegration
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -237,14 +237,16 @@ let
|
|||
else
|
||||
''named-mailboxes "${extra.name}" "${mailboxroot}/${extra.mailbox}"'')
|
||||
account.neomutt.extraMailboxes;
|
||||
in with account; ''
|
||||
# register account ${name}
|
||||
${optionalString account.neomutt.showDefaultMailbox
|
||||
''${mailboxes} "${mailroot}/${folders.inbox}"''}
|
||||
${extraMailboxes}
|
||||
${hookName} ${mailroot}/ " \
|
||||
source ${accountFilename account} "
|
||||
'';
|
||||
in with account;
|
||||
[ "## register account ${name}" ]
|
||||
++ optional account.neomutt.showDefaultMailbox
|
||||
''${mailboxes} "${mailroot}/${folders.inbox}"'' ++ [
|
||||
extraMailboxes
|
||||
''
|
||||
${hookName} ${mailroot}/ " \
|
||||
source ${accountFilename account} "
|
||||
''
|
||||
];
|
||||
|
||||
mraSection = account:
|
||||
with account;
|
||||
|
@ -300,7 +302,7 @@ let
|
|||
"set signature = ${
|
||||
pkgs.writeText "signature.txt" account.signature.text
|
||||
}";
|
||||
in ''
|
||||
in concatStringsSep "\n" ([''
|
||||
# Generated by Home Manager.${
|
||||
optionalString cfg.unmailboxes ''
|
||||
|
||||
|
@ -323,21 +325,18 @@ let
|
|||
|
||||
# MTA section
|
||||
${optionsStr (mtaSection account)}
|
||||
''] ++ (lib.optional (cfg.checkStatsInterval != null) mailCheckSection)
|
||||
++ (lib.optional cfg.sidebar.enable sidebarSection) ++ [''
|
||||
# MRA section
|
||||
${mraSection account}
|
||||
|
||||
${optionalString (cfg.checkStatsInterval != null) mailCheckSection}
|
||||
# Extra configuration
|
||||
${account.neomutt.extraConfig}
|
||||
|
||||
${optionalString cfg.sidebar.enable sidebarSection}
|
||||
|
||||
# MRA section
|
||||
${mraSection account}
|
||||
|
||||
# Extra configuration
|
||||
${account.neomutt.extraConfig}
|
||||
|
||||
${signature}
|
||||
''
|
||||
+ optionalString (account.notmuch.enable && account.notmuch.neomutt.enable)
|
||||
(notmuchSection account);
|
||||
${signature}
|
||||
'']
|
||||
++ lib.optional (account.notmuch.enable && account.notmuch.neomutt.enable)
|
||||
(notmuchSection account));
|
||||
|
||||
in {
|
||||
options = {
|
||||
|
@ -454,43 +453,40 @@ in {
|
|||
# otherwise use the first neomutt account as primary.
|
||||
primary =
|
||||
head (filter (a: a.primary) neomuttAccounts ++ neomuttAccounts);
|
||||
in ''
|
||||
# Generated by Home Manager.
|
||||
set header_cache = "${config.xdg.cacheHome}/neomutt/headers/"
|
||||
set message_cachedir = "${config.xdg.cacheHome}/neomutt/messages/"
|
||||
set editor = "${cfg.editor}"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
in concatStringsSep "\n" ([
|
||||
"# Generated by Home Manager."
|
||||
''set header_cache = "${config.xdg.cacheHome}/neomutt/headers/"''
|
||||
''set message_cachedir = "${config.xdg.cacheHome}/neomutt/messages/"''
|
||||
''set editor = "${cfg.editor}"''
|
||||
"set implicit_autoview = yes"
|
||||
"set crypt_use_gpgme = yes"
|
||||
"alternative_order text/enriched text/plain text"
|
||||
"set delete = yes"
|
||||
(optionalString cfg.vimKeys
|
||||
"source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc")
|
||||
] ++ (lib.optionals (cfg.binds != [ ]) [
|
||||
''
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
# Binds''
|
||||
bindSection
|
||||
]) ++ [
|
||||
''
|
||||
|
||||
set delete = yes
|
||||
|
||||
${optionalString cfg.vimKeys
|
||||
"source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"}
|
||||
|
||||
# Binds
|
||||
${bindSection}
|
||||
|
||||
# Macros
|
||||
${macroSection}
|
||||
|
||||
# Register accounts
|
||||
${
|
||||
optionalString (accountCommandNeeded) ''
|
||||
set account_command = '${accountCommand}/bin/account-command.sh'
|
||||
''
|
||||
}${concatMapStringsSep "\n" registerAccount neomuttAccounts}
|
||||
|
||||
${optionalString cfg.sourcePrimaryAccount ''
|
||||
# Macros''
|
||||
macroSection
|
||||
"# Register accounts"
|
||||
(optionalString (accountCommandNeeded) ''
|
||||
set account_command = '${accountCommand}/bin/account-command.sh'
|
||||
'')
|
||||
] ++ (lib.flatten (map registerAccount neomuttAccounts)) ++ [
|
||||
(optionalString cfg.sourcePrimaryAccount ''
|
||||
# Source primary account
|
||||
source ${accountFilename primary}''}
|
||||
|
||||
# Extra configuration
|
||||
${optionsStr cfg.settings}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
source ${accountFilename primary}
|
||||
'')
|
||||
"# Extra configuration"
|
||||
(optionsStr cfg.settings)
|
||||
cfg.extraConfig
|
||||
]);
|
||||
};
|
||||
|
||||
assertions = [{
|
||||
|
|
|
@ -1,32 +1,28 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
|
||||
cfg = config.programs.zellij;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
zellijCmd = getExe cfg.package;
|
||||
|
||||
mkShellIntegrationOption = option:
|
||||
option // {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.mainrs ];
|
||||
meta.maintainers = [ lib.maintainers.khaneliman lib.hm.maintainers.mainrs ];
|
||||
|
||||
options.programs.zellij = {
|
||||
enable = mkEnableOption "zellij";
|
||||
enable = lib.mkEnableOption "Zellij";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.zellij;
|
||||
defaultText = literalExpression "pkgs.zellij";
|
||||
description = ''
|
||||
The zellij package to install.
|
||||
'';
|
||||
};
|
||||
package = lib.mkPackageOption pkgs "zellij" { };
|
||||
|
||||
settings = mkOption {
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
theme = "custom";
|
||||
themes.custom.fg = "#ffffff";
|
||||
|
@ -44,42 +40,81 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
enableBashIntegration =
|
||||
lib.hm.shell.mkBashIntegrationOption { inherit config; };
|
||||
attachExistingSession = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to attach to the default session after being autostarted if a Zellij session already exists.
|
||||
|
||||
enableFishIntegration =
|
||||
lib.hm.shell.mkFishIntegrationOption { inherit config; };
|
||||
Variable is checked in `auto-start` script. Requires shell integration to be enabled to have effect.
|
||||
'';
|
||||
};
|
||||
|
||||
enableZshIntegration =
|
||||
lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||
exitShellOnExit = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to exit the shell when Zellij exits after being autostarted.
|
||||
|
||||
Variable is checked in `auto-start` script. Requires shell integration to be enabled to have effect.
|
||||
'';
|
||||
};
|
||||
|
||||
enableBashIntegration = mkShellIntegrationOption
|
||||
(lib.hm.shell.mkBashIntegrationOption { inherit config; });
|
||||
|
||||
enableFishIntegration = mkShellIntegrationOption
|
||||
(lib.hm.shell.mkFishIntegrationOption { inherit config; });
|
||||
|
||||
enableZshIntegration = mkShellIntegrationOption
|
||||
(lib.hm.shell.mkZshIntegrationOption { inherit config; });
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = let
|
||||
shellIntegrationEnabled = (cfg.enableBashIntegration
|
||||
|| cfg.enableZshIntegration || cfg.enableFishIntegration);
|
||||
in mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
# Zellij switched from yaml to KDL in version 0.32.0:
|
||||
# https://github.com/zellij-org/zellij/releases/tag/v0.32.0
|
||||
xdg.configFile."zellij/config.yaml" = mkIf
|
||||
(cfg.settings != { } && (versionOlder cfg.package.version "0.32.0")) {
|
||||
(cfg.settings != { } && (lib.versionOlder cfg.package.version "0.32.0")) {
|
||||
source = yamlFormat.generate "zellij.yaml" cfg.settings;
|
||||
};
|
||||
|
||||
xdg.configFile."zellij/config.kdl" = mkIf
|
||||
(cfg.settings != { } && (versionAtLeast cfg.package.version "0.32.0")) {
|
||||
xdg.configFile."zellij/config.kdl" = mkIf (cfg.settings != { }
|
||||
&& (lib.versionAtLeast cfg.package.version "0.32.0")) {
|
||||
text = lib.hm.generators.toKDL { } cfg.settings;
|
||||
};
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkOrder 200 ''
|
||||
eval "$(${zellijCmd} setup --generate-auto-start bash)"
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||
eval "$(${lib.getExe cfg.package} setup --generate-auto-start bash)"
|
||||
'';
|
||||
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration (lib.mkOrder 200 ''
|
||||
eval "$(${lib.getExe cfg.package} setup --generate-auto-start zsh)"
|
||||
'');
|
||||
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration (mkOrder 200 ''
|
||||
eval "$(${zellijCmd} setup --generate-auto-start zsh)"
|
||||
'');
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
||||
eval (${
|
||||
lib.getExe cfg.package
|
||||
} setup --generate-auto-start fish | string collect)
|
||||
'';
|
||||
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration
|
||||
(mkOrder 200 ''
|
||||
eval (${zellijCmd} setup --generate-auto-start fish | string collect)
|
||||
'');
|
||||
home.sessionVariables = mkIf shellIntegrationEnabled {
|
||||
ZELLIJ_AUTO_ATTACH =
|
||||
if cfg.attachExistingSession then "true" else "false";
|
||||
ZELLIJ_AUTO_EXIT = if cfg.exitShellOnExit then "true" else "false";
|
||||
};
|
||||
|
||||
warnings =
|
||||
lib.optional (cfg.attachExistingSession && !shellIntegrationEnabled) ''
|
||||
You have enabled `programs.zellij.attachExistingSession`, but none of the shell integrations are enabled.
|
||||
This option will have no effect.
|
||||
'' ++ lib.optional (cfg.exitShellOnExit && !shellIntegrationEnabled) ''
|
||||
You have enabled `programs.zellij.exitShellOnExit`, but none of the shell integrations are enabled.
|
||||
This option will have no effect.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -732,10 +732,11 @@ in
|
|||
|
||||
(lib.mkIf (aliasesStr != "" || cfg.shellGlobalAliases != {}) (mkOrder 1100
|
||||
((optionalString (aliasesStr != "") aliasesStr) +
|
||||
(optionalString (cfg.shellGlobalAliases != {})
|
||||
(optionalString (cfg.shellGlobalAliases != {})
|
||||
(optionalString (cfg.shellAliases != {}) "\n" +
|
||||
(concatStringsSep "\n" (lib.mapAttrsToList
|
||||
(k: v: "alias -g -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}")
|
||||
cfg.shellGlobalAliases))))))
|
||||
cfg.shellGlobalAliases)))))))
|
||||
|
||||
(lib.mkIf (dirHashesStr != "") (mkOrder 1150 ''
|
||||
# Named Directory Hashes
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtps://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
@ -32,6 +28,7 @@ color status cyan default
|
|||
|
||||
|
||||
unset signature
|
||||
|
||||
# notmuch section
|
||||
set nm_default_uri = "notmuch:///home/hm-user/Mail"
|
||||
virtual-mailboxes "My INBOX" "notmuch://?query=tag%3Ainbox"
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtps://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtps://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='imaps://home.manager@imap.example.com:993'
|
||||
set from='hm@example.com'
|
||||
|
|
|
@ -12,10 +12,6 @@ set sort = "threads"
|
|||
# MTA section
|
||||
set sendmail='msmtpq --read-envelope-from --read-recipients'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
|
|
@ -12,10 +12,6 @@ set sort = "threads"
|
|||
# MTA section
|
||||
set sendmail='msmtpq --read-envelope-from --read-recipients'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set from='hm@example.com'
|
||||
set postponed='+Drafts'
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtps://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
@ -32,6 +28,7 @@ color status cyan default
|
|||
|
||||
|
||||
set signature = "/nix/store/00000000000000000000000000000000-signature|"
|
||||
|
||||
# notmuch section
|
||||
set nm_default_uri = "notmuch:///home/hm-user/Mail"
|
||||
virtual-mailboxes "My INBOX" "notmuch://?query=tag%3Ainbox"
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtps://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
@ -32,6 +28,7 @@ color status cyan default
|
|||
|
||||
|
||||
set signature = /nix/store/00000000000000000000000000000000-signature.txt
|
||||
|
||||
# notmuch section
|
||||
set nm_default_uri = "notmuch:///home/hm-user/Mail"
|
||||
virtual-mailboxes "My INBOX" "notmuch://?query=tag%3Ainbox"
|
||||
|
|
|
@ -13,10 +13,6 @@ set sort = "threads"
|
|||
set smtp_pass="`password-command`"
|
||||
set smtp_url='smtp://home.manager@smtp.example.com'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
@ -32,6 +28,7 @@ color status cyan default
|
|||
|
||||
|
||||
unset signature
|
||||
|
||||
# notmuch section
|
||||
set nm_default_uri = "notmuch:///home/hm-user/Mail"
|
||||
virtual-mailboxes "My INBOX" "notmuch://?query=tag%3Ainbox"
|
||||
|
|
|
@ -14,10 +14,6 @@ set sort = "threads"
|
|||
# MTA section
|
||||
set sendmail='msmtpq --read-envelope-from --read-recipients'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# MRA section
|
||||
set folder='/home/hm-user/Mail/hm@example.com'
|
||||
set from='hm@example.com'
|
||||
|
|
|
@ -4,31 +4,22 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
|
||||
|
||||
# Macros
|
||||
|
||||
|
||||
# Register accounts
|
||||
# register account hm@example.com
|
||||
|
||||
## register account hm@example.com
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Inbox"
|
||||
|
||||
folder-hook /home/hm-user/Mail/hm@example.com/ " \
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm@example.com
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,31 +4,22 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
|
||||
|
||||
# Macros
|
||||
|
||||
|
||||
# Register accounts
|
||||
# register account hm-account
|
||||
|
||||
## register account hm-account
|
||||
mailboxes "/home/hm-user/Mail/hm-account/Inbox"
|
||||
|
||||
folder-hook /home/hm-user/Mail/hm-account/ " \
|
||||
source /home/hm-user/.config/neomutt/hm-account "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm-account "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm-account
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-not-primary-expected.conf
|
||||
}
|
||||
'';
|
||||
|
|
|
@ -4,13 +4,10 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
bind editor <Tab> "complete-query"
|
||||
bind index,pager \Cp "sidebar-prev"
|
||||
|
@ -18,19 +15,16 @@ bind index,pager \Cp "sidebar-prev"
|
|||
# Macros
|
||||
macro index s "<save-message>?<tab>"
|
||||
macro index,pager c "<change-folder>?<change-dir><home>^K=<enter><tab>"
|
||||
|
||||
# Register accounts
|
||||
# register account hm@example.com
|
||||
|
||||
## register account hm@example.com
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Inbox"
|
||||
|
||||
folder-hook /home/hm-user/Mail/hm@example.com/ " \
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm@example.com
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -52,10 +52,10 @@
|
|||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-with-binds-expected.conf
|
||||
}
|
||||
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/hm@example.com) ${
|
||||
./hm-example.com-expected
|
||||
}
|
||||
'';
|
||||
|
|
|
@ -48,10 +48,10 @@
|
|||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-with-binds-expected.conf
|
||||
}
|
||||
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/hm@example.com) ${
|
||||
./hm-example.com-expected
|
||||
}
|
||||
'';
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-expected.conf
|
||||
}
|
||||
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
||||
|
|
|
@ -4,32 +4,23 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
|
||||
|
||||
# Macros
|
||||
|
||||
|
||||
# Register accounts
|
||||
set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh'
|
||||
# register account hm@example.com
|
||||
|
||||
## register account hm@example.com
|
||||
mailboxes "imaps://home.manager@imap.example.com:993/Inbox"
|
||||
|
||||
account-hook imaps://home.manager@imap.example.com:993/ " \
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm@example.com
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,34 +4,25 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
|
||||
|
||||
# Macros
|
||||
|
||||
|
||||
# Register accounts
|
||||
set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh'
|
||||
# register account hm@example.com
|
||||
|
||||
## register account hm@example.com
|
||||
named-mailboxes "someCustomName" "/home/hm-user/Mail/hm@example.com/Inbox"
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Sent"
|
||||
named-mailboxes "Spam" "imaps://home.manager@imap.example.com:993/Junk Email"
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Trash"
|
||||
folder-hook /home/hm-user/Mail/hm@example.com/ " \
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm@example.com
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,33 +4,24 @@ set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
|
|||
set editor = "$EDITOR"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
|
||||
set delete = yes
|
||||
|
||||
|
||||
|
||||
# Binds
|
||||
|
||||
|
||||
# Macros
|
||||
|
||||
|
||||
# Register accounts
|
||||
# register account hm@example.com
|
||||
|
||||
## register account hm@example.com
|
||||
named-mailboxes "someCustomName" "/home/hm-user/Mail/hm@example.com/Inbox"
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Sent"
|
||||
named-mailboxes "Spam" "/home/hm-user/Mail/hm@example.com/Junk Email"
|
||||
mailboxes "/home/hm-user/Mail/hm@example.com/Trash"
|
||||
folder-hook /home/hm-user/Mail/hm@example.com/ " \
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
source /home/hm-user/.config/neomutt/hm@example.com "
|
||||
|
||||
# Source primary account
|
||||
source /home/hm-user/.config/neomutt/hm@example.com
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-with-named-mailboxes-expected.conf
|
||||
}
|
||||
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/neomuttrc
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
||||
assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${
|
||||
./neomutt-expected.conf
|
||||
}
|
||||
expectedSignature=$(normalizeStorePaths "home-files/.config/neomutt/hm@example.com")
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
programs = {
|
||||
zellij = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
|
||||
attachExistingSession = true;
|
||||
exitShellOnExit = true;
|
||||
|
||||
enableZshIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
bash.enable = true;
|
||||
zsh.enable = true;
|
||||
|
@ -32,5 +36,13 @@
|
|||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
'eval (@zellij@/bin/zellij setup --generate-auto-start fish | string collect)'
|
||||
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileContains \
|
||||
home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'export ZELLIJ_AUTO_ATTACH="true"'
|
||||
assertFileContains \
|
||||
home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'export ZELLIJ_AUTO_EXIT="true"'
|
||||
'';
|
||||
}
|
||||
|
|
52
tests/modules/programs/zsh/aliases.nix
Normal file
52
tests/modules/programs/zsh/aliases.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
||||
shellAliases = {
|
||||
test1 = "alias";
|
||||
test2 = "alias2";
|
||||
};
|
||||
shellGlobalAliases = { global = "test"; };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
|
||||
assertFileContent home-files/.zshrc ${
|
||||
builtins.toFile "expected-.zshrc" ''
|
||||
typeset -U path cdpath fpath manpath
|
||||
for profile in ''${(z)NIX_PROFILES}; do
|
||||
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
||||
done
|
||||
|
||||
HELPDIR="@zsh@/share/zsh/$ZSH_VERSION/help"
|
||||
|
||||
autoload -U compinit && compinit
|
||||
# History options should be set in .zshrc and after oh-my-zsh sourcing.
|
||||
# See https://github.com/nix-community/home-manager/issues/177.
|
||||
HISTSIZE="10000"
|
||||
SAVEHIST="10000"
|
||||
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
mkdir -p "$(dirname "$HISTFILE")"
|
||||
|
||||
setopt HIST_FCNTL_LOCK
|
||||
unsetopt APPEND_HISTORY
|
||||
setopt HIST_IGNORE_DUPS
|
||||
unsetopt HIST_IGNORE_ALL_DUPS
|
||||
unsetopt HIST_SAVE_NO_DUPS
|
||||
unsetopt HIST_FIND_NO_DUPS
|
||||
setopt HIST_IGNORE_SPACE
|
||||
unsetopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt SHARE_HISTORY
|
||||
unsetopt EXTENDED_HISTORY
|
||||
|
||||
|
||||
alias -- test1=alias
|
||||
alias -- test2=alias2
|
||||
alias -g -- global=test''
|
||||
}
|
||||
'';
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
zsh-session-variables = ./session-variables.nix;
|
||||
zsh-history-path-new-default = ./history-path-new-default.nix;
|
||||
zsh-history-path-new-custom = ./history-path-new-custom.nix;
|
||||
zsh-history-path-old-default = ./history-path-old-default.nix;
|
||||
zsh-history-path-old-custom = ./history-path-old-custom.nix;
|
||||
zsh-abbr = ./zsh-abbr.nix;
|
||||
zsh-aliases = ./aliases.nix;
|
||||
zsh-history-ignore-pattern = ./history-ignore-pattern.nix;
|
||||
zsh-history-path-new-custom = ./history-path-new-custom.nix;
|
||||
zsh-history-path-new-default = ./history-path-new-default.nix;
|
||||
zsh-history-path-old-custom = ./history-path-old-custom.nix;
|
||||
zsh-history-path-old-default = ./history-path-old-default.nix;
|
||||
zsh-history-substring-search = ./history-substring-search.nix;
|
||||
zsh-prezto = ./prezto.nix;
|
||||
zsh-session-variables = ./session-variables.nix;
|
||||
zsh-syntax-highlighting = ./syntax-highlighting.nix;
|
||||
zsh-abbr = ./zsh-abbr.nix;
|
||||
zshrc-contents-priorities = ./zshrc-content-priorities.nix;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue