Compare commits
20 commits
master
...
release-18
Author | SHA1 | Date | |
---|---|---|---|
bbe82a3ac5 | |||
ee242ec757 | |||
038f1eac11 | |||
44a1e72d2e | |||
f34e5f1c6c | |||
d268605244 | |||
091f52197d | |||
68228fce93 | |||
26b16162b7 | |||
b17b760755 | |||
9d7f7fe3a8 | |||
b19478d820 | |||
e11f110b4b | |||
451f376231 | |||
f3c02513a9 | |||
85cd97e616 | |||
b641138602 | |||
310b604f92 | |||
94fad32e41 | |||
163588b61b |
|
@ -6,6 +6,52 @@ let
|
||||||
|
|
||||||
cfg = config.accounts.email;
|
cfg = config.accounts.email;
|
||||||
|
|
||||||
|
gpgModule = types.submodule {
|
||||||
|
options = {
|
||||||
|
key = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The key to use as listed in <command>gpg --list-keys</command>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
signByDefault = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Sign messages by default.";
|
||||||
|
};
|
||||||
|
|
||||||
|
encryptByDefault = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Encrypt outgoing messages by default.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
signatureModule = types.submodule {
|
||||||
|
options = {
|
||||||
|
text = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
--
|
||||||
|
Luke Skywalker
|
||||||
|
May the force be with you.
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Signature content.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
showSignature = mkOption {
|
||||||
|
type = types.enum [ "append" "attach" "none" ];
|
||||||
|
default = "none";
|
||||||
|
description = "Method to communicate the signature.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
tlsModule = types.submodule {
|
tlsModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
@ -237,6 +283,22 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
signature = mkOption {
|
||||||
|
type = signatureModule;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Signature configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
gpg = mkOption {
|
||||||
|
type = types.nullOr gpgModule;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
GPG configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
smtp = mkOption {
|
smtp = mkOption {
|
||||||
type = types.nullOr smtpModule;
|
type = types.nullOr smtpModule;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -317,6 +379,7 @@ in
|
||||||
accounts = mkOption {
|
accounts = mkOption {
|
||||||
type = types.attrsOf (types.submodule [
|
type = types.attrsOf (types.submodule [
|
||||||
mailAccountOpts
|
mailAccountOpts
|
||||||
|
(import ../programs/alot-accounts.nix)
|
||||||
(import ../programs/mbsync-accounts.nix)
|
(import ../programs/mbsync-accounts.nix)
|
||||||
(import ../programs/msmtp-accounts.nix)
|
(import ../programs/msmtp-accounts.nix)
|
||||||
(import ../programs/notmuch-accounts.nix)
|
(import ../programs/notmuch-accounts.nix)
|
||||||
|
|
14
modules/misc/lib.nix
Normal file
14
modules/misc/lib.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
lib = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
This option allows modules to define helper functions,
|
||||||
|
constants, etc.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -779,6 +779,34 @@ in
|
||||||
A new module is available: 'programs.offlineimap'.
|
A new module is available: 'programs.offlineimap'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2018-09-18T21:25:14+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.taskwarrior'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2018-09-18T21:43:54+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.zathura'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2018-09-20T22:10:45+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.go'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2018-09-28T21:38:48+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.alot'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,13 @@ let
|
||||||
./manual.nix
|
./manual.nix
|
||||||
./misc/fontconfig.nix
|
./misc/fontconfig.nix
|
||||||
./misc/gtk.nix
|
./misc/gtk.nix
|
||||||
|
./misc/lib.nix
|
||||||
./misc/news.nix
|
./misc/news.nix
|
||||||
./misc/nixpkgs.nix
|
./misc/nixpkgs.nix
|
||||||
./misc/pam.nix
|
./misc/pam.nix
|
||||||
./misc/qt.nix
|
./misc/qt.nix
|
||||||
./misc/xdg.nix
|
./misc/xdg.nix
|
||||||
|
./programs/alot.nix
|
||||||
./programs/autorandr.nix
|
./programs/autorandr.nix
|
||||||
./programs/bash.nix
|
./programs/bash.nix
|
||||||
./programs/beets.nix
|
./programs/beets.nix
|
||||||
|
@ -38,6 +40,7 @@ let
|
||||||
./programs/fzf.nix
|
./programs/fzf.nix
|
||||||
./programs/git.nix
|
./programs/git.nix
|
||||||
./programs/gnome-terminal.nix
|
./programs/gnome-terminal.nix
|
||||||
|
./programs/go.nix
|
||||||
./programs/home-manager.nix
|
./programs/home-manager.nix
|
||||||
./programs/htop.nix
|
./programs/htop.nix
|
||||||
./programs/info.nix
|
./programs/info.nix
|
||||||
|
@ -53,9 +56,11 @@ let
|
||||||
./programs/pidgin.nix
|
./programs/pidgin.nix
|
||||||
./programs/rofi.nix
|
./programs/rofi.nix
|
||||||
./programs/ssh.nix
|
./programs/ssh.nix
|
||||||
|
./programs/taskwarrior.nix
|
||||||
./programs/termite.nix
|
./programs/termite.nix
|
||||||
./programs/texlive.nix
|
./programs/texlive.nix
|
||||||
./programs/vim.nix
|
./programs/vim.nix
|
||||||
|
./programs/zathura.nix
|
||||||
./programs/zsh.nix
|
./programs/zsh.nix
|
||||||
./services/blueman-applet.nix
|
./services/blueman-applet.nix
|
||||||
./services/compton.nix
|
./services/compton.nix
|
||||||
|
@ -93,7 +98,6 @@ let
|
||||||
./xresources.nix
|
./xresources.nix
|
||||||
./xsession.nix
|
./xsession.nix
|
||||||
<nixpkgs/nixos/modules/misc/assertions.nix>
|
<nixpkgs/nixos/modules/misc/assertions.nix>
|
||||||
<nixpkgs/nixos/modules/misc/lib.nix>
|
|
||||||
<nixpkgs/nixos/modules/misc/meta.nix>
|
<nixpkgs/nixos/modules/misc/meta.nix>
|
||||||
]
|
]
|
||||||
++
|
++
|
||||||
|
|
32
modules/programs/alot-accounts.nix
Normal file
32
modules/programs/alot-accounts.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
options.alot = {
|
||||||
|
sendMailCommand = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = ''
|
||||||
|
Command to send a mail. If msmtp is enabled for the account,
|
||||||
|
then this is set to
|
||||||
|
<command>msmtpq --read-envelope-from --read-recipients</command>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Extra settings to add to this Alot account configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf config.notmuch.enable {
|
||||||
|
alot.sendMailCommand = mkOptionDefault (
|
||||||
|
if config.msmtp.enable
|
||||||
|
then "msmtpq --read-envelope-from --read-recipients"
|
||||||
|
else null
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
167
modules/programs/alot.nix
Normal file
167
modules/programs/alot.nix
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
# alot config loader is sensitive to leading space !
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.alot;
|
||||||
|
|
||||||
|
alotAccounts = filter (a: a.notmuch.enable)
|
||||||
|
(attrValues config.accounts.email.accounts);
|
||||||
|
|
||||||
|
boolStr = v: if v then "True" else "False";
|
||||||
|
|
||||||
|
accountStr = account: with account;
|
||||||
|
concatStringsSep "\n" (
|
||||||
|
[ "[[${name}]]" ]
|
||||||
|
++ mapAttrsToList (n: v: n + "=" + v) (
|
||||||
|
{
|
||||||
|
address = address;
|
||||||
|
realname = realName;
|
||||||
|
sendmail_command =
|
||||||
|
optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
|
||||||
|
}
|
||||||
|
// optionalAttrs (gpg != null) {
|
||||||
|
gpg_key = gpg.key;
|
||||||
|
encrypt_by_default = if gpg.encryptByDefault then "all" else "none";
|
||||||
|
sign_by_default = boolStr gpg.signByDefault;
|
||||||
|
}
|
||||||
|
// optionalAttrs (signature.showSignature != "none") {
|
||||||
|
signature = pkgs.writeText "signature.txt" signature.text;
|
||||||
|
signature_as_attachment =
|
||||||
|
boolStr (signature.showSignature == "attach");
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
+ "\n"
|
||||||
|
+ alot.extraConfig;
|
||||||
|
|
||||||
|
configFile =
|
||||||
|
let
|
||||||
|
bindingsToStr = attrSet:
|
||||||
|
concatStringsSep "\n" (mapAttrsToList (n: v: "${n} = ${v}") attrSet);
|
||||||
|
in
|
||||||
|
''
|
||||||
|
# Generated by Home Manager.
|
||||||
|
# See http://alot.readthedocs.io/en/latest/configuration/config_options.html
|
||||||
|
|
||||||
|
${cfg.extraConfig}
|
||||||
|
|
||||||
|
[bindings]
|
||||||
|
${bindingsToStr cfg.bindings.global}
|
||||||
|
|
||||||
|
[[bufferlist]]
|
||||||
|
${bindingsToStr cfg.bindings.bufferlist}
|
||||||
|
[[search]]
|
||||||
|
${bindingsToStr cfg.bindings.search}
|
||||||
|
[[envelope]]
|
||||||
|
${bindingsToStr cfg.bindings.envelope}
|
||||||
|
[[taglist]]
|
||||||
|
${bindingsToStr cfg.bindings.taglist}
|
||||||
|
[[thread]]
|
||||||
|
${bindingsToStr cfg.bindings.thread}
|
||||||
|
|
||||||
|
[accounts]
|
||||||
|
|
||||||
|
${concatStringsSep "\n\n" (map accountStr alotAccounts)}
|
||||||
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.programs.alot = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable the Alot mail user agent. Alot uses the
|
||||||
|
Notmuch email system and will therefore be automatically
|
||||||
|
enabled for each email account that is managed by Notmuch.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hooks = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Content of the hooks file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
bindings = mkOption {
|
||||||
|
type = types.submodule {
|
||||||
|
options = {
|
||||||
|
global = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Global keybindings.";
|
||||||
|
};
|
||||||
|
|
||||||
|
bufferlist = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Bufferlist mode keybindings.";
|
||||||
|
};
|
||||||
|
|
||||||
|
search = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Search mode keybindings.";
|
||||||
|
};
|
||||||
|
|
||||||
|
envelope = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Envelope mode keybindings.";
|
||||||
|
};
|
||||||
|
|
||||||
|
taglist = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Taglist mode keybindings.";
|
||||||
|
};
|
||||||
|
|
||||||
|
thread = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = "Thread mode keybindings.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Keybindings.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = ''
|
||||||
|
auto_remove_unread = True
|
||||||
|
ask_subject = False
|
||||||
|
handle_mouse = True
|
||||||
|
initial_command = "search tag:inbox AND NOT tag:killed"
|
||||||
|
input_timeout = 0.3
|
||||||
|
prefer_plaintext = True
|
||||||
|
thread_indent_replies = 4
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Extra lines added to alot configuration file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.alot ];
|
||||||
|
|
||||||
|
xdg.configFile."alot/config".text = configFile;
|
||||||
|
|
||||||
|
xdg.configFile."alot/hooks.py".text =
|
||||||
|
''
|
||||||
|
# Generated by Home Manager.
|
||||||
|
''
|
||||||
|
+ cfg.hooks;
|
||||||
|
};
|
||||||
|
}
|
|
@ -155,7 +155,7 @@ in
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
programs.bash.bashrcExtra = ''
|
programs.bash.bashrcExtra = ''
|
||||||
# Commands that should be applied only for interactive shells.
|
# Commands that should be applied only for interactive shells.
|
||||||
if [[ -n $PS1 ]]; then
|
if [[ $- == *i* ]]; then
|
||||||
${historyControlStr}
|
${historyControlStr}
|
||||||
|
|
||||||
${shoptsStr}
|
${shoptsStr}
|
||||||
|
|
|
@ -33,10 +33,19 @@ in
|
||||||
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
||||||
description = "Extra packages available to Emacs.";
|
description = "Extra packages available to Emacs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
finalPackage = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
internal = true;
|
||||||
|
readOnly = true;
|
||||||
|
description = "The Emacs package including any extra packages.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ (emacsWithPackages cfg.extraPackages) ];
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
|
||||||
|
programs.emacs.finalPackage = emacsWithPackages cfg.extraPackages;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
75
modules/programs/go.nix
Normal file
75
modules/programs/go.nix
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.go;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
meta.maintainers = [ maintainers.rvolosatovs ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
programs.go = {
|
||||||
|
enable = mkEnableOption "Go";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.go;
|
||||||
|
defaultText = "pkgs.go";
|
||||||
|
description = "The Go package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
packages = mkOption {
|
||||||
|
type = with types; attrsOf path;
|
||||||
|
default = {};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
"golang.org/x/text" = builtins.fetchGit "https://go.googlesource.com/text";
|
||||||
|
"golang.org/x/time" = builtins.fetchGit "https://go.googlesource.com/time";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = "Packages to add to GOPATH.";
|
||||||
|
};
|
||||||
|
|
||||||
|
goPath = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "go";
|
||||||
|
description = "GOPATH relative to HOME";
|
||||||
|
};
|
||||||
|
|
||||||
|
goBin = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = ".local/bin.go";
|
||||||
|
description = "GOBIN relative to HOME";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
home.file =
|
||||||
|
let
|
||||||
|
goPath = if cfg.goPath != null then cfg.goPath else "go";
|
||||||
|
|
||||||
|
mkSrc = n: v: {
|
||||||
|
target = "${goPath}/src/${n}";
|
||||||
|
source = v;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mapAttrsToList mkSrc cfg.packages;
|
||||||
|
}
|
||||||
|
(mkIf (cfg.goPath != null) {
|
||||||
|
home.sessionVariables.GOPATH = builtins.toPath "${config.home.homeDirectory}/${cfg.goPath}";
|
||||||
|
})
|
||||||
|
(mkIf (cfg.goBin != null) {
|
||||||
|
home.sessionVariables.GOBIN = builtins.toPath "${config.home.homeDirectory}/${cfg.goBin}";
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
extraConfigType = with lib.types; attrsOf (either (either str int) bool);
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.mbsync = {
|
options.mbsync = {
|
||||||
enable = mkEnableOption "synchronization using mbsync";
|
enable = mkEnableOption "synchronization using mbsync";
|
||||||
|
@ -53,5 +59,49 @@ with lib;
|
||||||
Pattern of mailboxes to synchronize.
|
Pattern of mailboxes to synchronize.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig.channel = mkOption {
|
||||||
|
type = extraConfigType;
|
||||||
|
default = {};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
MaxMessages = 10000;
|
||||||
|
MaxSize = "1m";
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Per channel extra configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig.local = mkOption {
|
||||||
|
type = extraConfigType;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Local store extra configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig.remote = mkOption {
|
||||||
|
type = extraConfigType;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Remote store extra configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig.account = mkOption {
|
||||||
|
type = extraConfigType;
|
||||||
|
default = {};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
PipelineDepth = 10;
|
||||||
|
Timeout = 60;
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Account section extra configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,14 @@ let
|
||||||
genSection = header: entries:
|
genSection = header: entries:
|
||||||
let
|
let
|
||||||
escapeValue = escape [ "\"" ];
|
escapeValue = escape [ "\"" ];
|
||||||
|
hasSpace = v: builtins.match ".* .*" v != null;
|
||||||
genValue = v:
|
genValue = v:
|
||||||
if isList v
|
if isList v
|
||||||
then concatMapStringsSep " " genValue v
|
then concatMapStringsSep " " genValue v
|
||||||
else "\"${escapeValue v}\"";
|
else if isBool v then (if v then "yes" else "no")
|
||||||
|
else if isInt v then toString v
|
||||||
|
else if hasSpace v then "\"${escapeValue v}\""
|
||||||
|
else v;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
${header}
|
${header}
|
||||||
|
@ -54,15 +58,17 @@ let
|
||||||
User = userName;
|
User = userName;
|
||||||
PassCmd = toString passwordCommand;
|
PassCmd = toString passwordCommand;
|
||||||
}
|
}
|
||||||
//
|
// genTlsConfig imap.tls
|
||||||
genTlsConfig imap.tls
|
// optionalAttrs (imap.port != null) { Port = toString imap.port; }
|
||||||
//
|
// mbsync.extraConfig.account
|
||||||
optionalAttrs (imap.port != null) { Port = toString imap.port; }
|
|
||||||
)
|
)
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ genSection "IMAPStore ${name}-remote" {
|
+ genSection "IMAPStore ${name}-remote" (
|
||||||
Account = name;
|
{
|
||||||
}
|
Account = name;
|
||||||
|
}
|
||||||
|
// mbsync.extraConfig.remote
|
||||||
|
)
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ genSection "MaildirStore ${name}-local" (
|
+ genSection "MaildirStore ${name}-local" (
|
||||||
{
|
{
|
||||||
|
@ -70,19 +76,22 @@ let
|
||||||
Inbox = "${maildir.absPath}/${folders.inbox}";
|
Inbox = "${maildir.absPath}/${folders.inbox}";
|
||||||
SubFolders = "Verbatim";
|
SubFolders = "Verbatim";
|
||||||
}
|
}
|
||||||
//
|
// optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
||||||
optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
// mbsync.extraConfig.local
|
||||||
)
|
)
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ genSection "Channel ${name}" {
|
+ genSection "Channel ${name}" (
|
||||||
Master = ":${name}-remote:";
|
{
|
||||||
Slave = ":${name}-local:";
|
Master = ":${name}-remote:";
|
||||||
Patterns = mbsync.patterns;
|
Slave = ":${name}-local:";
|
||||||
Create = masterSlaveMapping.${mbsync.create};
|
Patterns = mbsync.patterns;
|
||||||
Remove = masterSlaveMapping.${mbsync.remove};
|
Create = masterSlaveMapping.${mbsync.create};
|
||||||
Expunge = masterSlaveMapping.${mbsync.expunge};
|
Remove = masterSlaveMapping.${mbsync.remove};
|
||||||
SyncState = "*";
|
Expunge = masterSlaveMapping.${mbsync.expunge};
|
||||||
}
|
SyncState = "*";
|
||||||
|
}
|
||||||
|
// mbsync.extraConfig.channel
|
||||||
|
)
|
||||||
+ "\n";
|
+ "\n";
|
||||||
|
|
||||||
genGroupConfig = name: channels:
|
genGroupConfig = name: channels:
|
||||||
|
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.programs.msmtp;
|
cfg = config.programs.msmtp;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
msmtpAccounts = filter (a: a.msmtp.enable)
|
msmtpAccounts = filter (a: a.msmtp.enable)
|
||||||
(attrValues config.accounts.email.accounts);
|
(attrValues config.accounts.email.accounts);
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
cfg = config.programs.notmuch;
|
cfg = config.programs.notmuch;
|
||||||
|
|
||||||
mkIniKeyValue = key: value:
|
mkIniKeyValue = key: value:
|
||||||
|
@ -24,12 +22,12 @@ let
|
||||||
database = {
|
database = {
|
||||||
path = config.accounts.email.maildirBasePath;
|
path = config.accounts.email.maildirBasePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
new = {
|
new = {
|
||||||
ignore = cfg.new.ignore;
|
ignore = cfg.new.ignore;
|
||||||
tags = cfg.new.tags;
|
tags = cfg.new.tags;
|
||||||
};
|
};
|
||||||
|
|
||||||
user =
|
user =
|
||||||
let
|
let
|
||||||
accounts =
|
accounts =
|
||||||
|
@ -42,7 +40,7 @@ let
|
||||||
primary_email = catAttrs "address" primary;
|
primary_email = catAttrs "address" primary;
|
||||||
other_email = catAttrs "address" secondaries;
|
other_email = catAttrs "address" secondaries;
|
||||||
};
|
};
|
||||||
|
|
||||||
search = {
|
search = {
|
||||||
exclude_tags = [ "deleted" "spam" ];
|
exclude_tags = [ "deleted" "spam" ];
|
||||||
};
|
};
|
||||||
|
@ -168,7 +166,7 @@ in
|
||||||
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
|
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
|
||||||
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc"
|
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc"
|
||||||
export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug"
|
export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug"
|
||||||
|
|
||||||
${cmds}
|
${cmds}
|
||||||
'';
|
'';
|
||||||
executable = true;
|
executable = true;
|
||||||
|
|
|
@ -280,7 +280,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
configPath = mkOption {
|
configPath = mkOption {
|
||||||
default = ".config/rofi/config";
|
default = "${config.xdg.configHome}/rofi/config";
|
||||||
type = types.string;
|
type = types.string;
|
||||||
description = "Path where to put generated configuration file.";
|
description = "Path where to put generated configuration file.";
|
||||||
};
|
};
|
||||||
|
|
112
modules/programs/taskwarrior.nix
Normal file
112
modules/programs/taskwarrior.nix
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.taskwarrior;
|
||||||
|
|
||||||
|
themePath = theme: "${pkgs.taskwarrior}/share/doc/task/rc/${theme}.theme";
|
||||||
|
|
||||||
|
includeTheme = location:
|
||||||
|
if location == null then ""
|
||||||
|
else if isString location then "include ${themePath location}"
|
||||||
|
else "include ${location}";
|
||||||
|
|
||||||
|
formatValue = value:
|
||||||
|
if isBool value then if value then "true" else "false"
|
||||||
|
else if isList value then concatMapStringsSep "," formatValue value
|
||||||
|
else toString value;
|
||||||
|
|
||||||
|
formatLine = key: value:
|
||||||
|
"${key}=${formatValue value}";
|
||||||
|
|
||||||
|
formatSet = key: values:
|
||||||
|
(concatStringsSep "\n"
|
||||||
|
(mapAttrsToList
|
||||||
|
(subKey: subValue: formatPair "${key}.${subKey}" subValue)
|
||||||
|
values));
|
||||||
|
|
||||||
|
formatPair = key: value:
|
||||||
|
if isAttrs value then formatSet key value
|
||||||
|
else formatLine key value;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
programs.taskwarrior = {
|
||||||
|
enable = mkEnableOption "Task Warrior";
|
||||||
|
|
||||||
|
config = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
confirmation = false;
|
||||||
|
report.minimal.filter = "status:pending";
|
||||||
|
report.active.columns = [ "id" "start" "entry.age" "priority" "project" "due" "description" ];
|
||||||
|
report.active.labels = [ "ID" "Started" "Age" "Priority" "Project" "Due" "Description" ];
|
||||||
|
taskd = {
|
||||||
|
certificate = "/path/to/cert";
|
||||||
|
key = "/path/to/key";
|
||||||
|
ca = "/path/to/ca";
|
||||||
|
server = "host.domain:53589";
|
||||||
|
credentials = "Org/First Last/cf31f287-ee9e-43a8-843e-e8bbd5de4294";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Key-value configuration written to
|
||||||
|
<filename>~/.taskrc</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
dataLocation = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${config.xdg.dataHome}/task";
|
||||||
|
defaultText = "$XDG_DATA_HOME/task";
|
||||||
|
description = ''
|
||||||
|
Location where Task Warrior will store its data.
|
||||||
|
</para><para>
|
||||||
|
Home Manager will attempt to create this directory.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
colorTheme = mkOption {
|
||||||
|
type = with types; nullOr (either str path);
|
||||||
|
default = null;
|
||||||
|
example = "dark-blue-256";
|
||||||
|
description = ''
|
||||||
|
Either one of the default provided theme as string, or a
|
||||||
|
path to a theme configuration file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Additional content written at the end of
|
||||||
|
<filename>~/.taskrc</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.taskwarrior ];
|
||||||
|
|
||||||
|
home.file."${cfg.dataLocation}/.keep".text = "";
|
||||||
|
|
||||||
|
home.file.".taskrc".text = ''
|
||||||
|
data.location=${cfg.dataLocation}
|
||||||
|
${includeTheme cfg.colorTheme}
|
||||||
|
|
||||||
|
${concatStringsSep "\n" (
|
||||||
|
mapAttrsToList formatPair cfg.config)}
|
||||||
|
|
||||||
|
${cfg.extraConfig}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -75,8 +75,8 @@ in
|
||||||
default = defaultPlugins;
|
default = defaultPlugins;
|
||||||
example = [ "YankRing" ];
|
example = [ "YankRing" ];
|
||||||
description = ''
|
description = ''
|
||||||
List of vim plugins to install. For supported plugins see:
|
List of vim plugins to install. To get a list of supported plugins run:
|
||||||
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/vim-plugins/vim-plugin-names"/>.
|
<command>nix-env -f '<nixpkgs>' -qaP -A vimPlugins</command>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
61
modules/programs/zathura.nix
Normal file
61
modules/programs/zathura.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{ config, lib, pkgs, ...}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.zathura;
|
||||||
|
|
||||||
|
formatLine = n: v:
|
||||||
|
let
|
||||||
|
formatValue = v:
|
||||||
|
if isBool v then (if v then "true" else "false")
|
||||||
|
else toString v;
|
||||||
|
in
|
||||||
|
"set ${n}\t\"${formatValue v}\"";
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
meta.maintainers = [ maintainers.rprospero ];
|
||||||
|
|
||||||
|
options.programs.zathura = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
Zathura, a highly customizable and functional document viewer
|
||||||
|
focused on keyboard interaction'';
|
||||||
|
|
||||||
|
options = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = with types; attrsOf (either str (either bool int));
|
||||||
|
description = ''
|
||||||
|
Add <option>:set</option> command options to zathura and make
|
||||||
|
them permanent. See
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>zathurarc</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum>
|
||||||
|
</citerefentry>
|
||||||
|
for the full list of options.
|
||||||
|
'';
|
||||||
|
example = { default-bg = "#000000"; default-fg = "#FFFFFF"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Additional commands for zathura that will be added to the
|
||||||
|
<filename>zathurarc</filename> file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.zathura ];
|
||||||
|
|
||||||
|
xdg.configFile."zathura/zathurarc".text =
|
||||||
|
concatStringsSep "\n" ([]
|
||||||
|
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||||
|
++ mapAttrsToList formatLine cfg.options
|
||||||
|
) + "\n";
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.services.polybar;
|
cfg = config.services.polybar;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
toPolybarIni = generators.toINI {
|
toPolybarIni = generators.toINI {
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
let
|
let
|
||||||
|
@ -61,7 +59,7 @@ in
|
||||||
(p: { "section/base" = { include-file = "${p}"; }; })
|
(p: { "section/base" = { include-file = "${p}"; }; })
|
||||||
(types.attrsOf types.attrs);
|
(types.attrsOf types.attrs);
|
||||||
description = ''
|
description = ''
|
||||||
Polybar configuration. Can be either path to a file, or set of attibutes
|
Polybar configuration. Can be either path to a file, or set of attributes
|
||||||
that will be used to create the final configuration.
|
that will be used to create the final configuration.
|
||||||
'';
|
'';
|
||||||
default = {};
|
default = {};
|
||||||
|
|
|
@ -27,19 +27,19 @@ in
|
||||||
|
|
||||||
config = mkIf config.services.taffybar.enable {
|
config = mkIf config.services.taffybar.enable {
|
||||||
systemd.user.services.taffybar = {
|
systemd.user.services.taffybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Taffybar desktop bar";
|
Description = "Taffybar desktop bar";
|
||||||
After = [ "graphical-session-pre.target" ];
|
After = [ "graphical-session-pre.target" ];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${cfg.package}/bin/taffybar";
|
ExecStart = "${cfg.package}/bin/taffybar";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "graphical-session.target" ];
|
WantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.xsession.windowManager.i3;
|
cfg = config.xsession.windowManager.i3;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
commonOptions = {
|
commonOptions = {
|
||||||
fonts = mkOption {
|
fonts = mkOption {
|
||||||
type = types.listOf types.string;
|
type = types.listOf types.string;
|
||||||
|
@ -378,7 +376,7 @@ let
|
||||||
type = types.attrsOf (types.listOf criteriaModule);
|
type = types.attrsOf (types.listOf criteriaModule);
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
An attribute set that assignes applications to workspaces based
|
An attribute set that assigns applications to workspaces based
|
||||||
on criteria.
|
on criteria.
|
||||||
'';
|
'';
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
|
@ -408,6 +406,11 @@ let
|
||||||
"${cfg.config.modifier}+Up" = "focus up";
|
"${cfg.config.modifier}+Up" = "focus up";
|
||||||
"${cfg.config.modifier}+Right" = "focus right";
|
"${cfg.config.modifier}+Right" = "focus right";
|
||||||
|
|
||||||
|
"${cfg.config.modifier}+Shift+Left" = "move left";
|
||||||
|
"${cfg.config.modifier}+Shift+Down" = "move down";
|
||||||
|
"${cfg.config.modifier}+Shift+Up" = "move up";
|
||||||
|
"${cfg.config.modifier}+Shift+Right" = "move right";
|
||||||
|
|
||||||
"${cfg.config.modifier}+h" = "split h";
|
"${cfg.config.modifier}+h" = "split h";
|
||||||
"${cfg.config.modifier}+v" = "split v";
|
"${cfg.config.modifier}+v" = "split v";
|
||||||
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
||||||
|
@ -417,6 +420,7 @@ let
|
||||||
"${cfg.config.modifier}+e" = "layout toggle split";
|
"${cfg.config.modifier}+e" = "layout toggle split";
|
||||||
|
|
||||||
"${cfg.config.modifier}+Shift+space" = "floating toggle";
|
"${cfg.config.modifier}+Shift+space" = "floating toggle";
|
||||||
|
"${cfg.config.modifier}+space" = "focus mode_toggle";
|
||||||
|
|
||||||
"${cfg.config.modifier}+1" = "workspace 1";
|
"${cfg.config.modifier}+1" = "workspace 1";
|
||||||
"${cfg.config.modifier}+2" = "workspace 2";
|
"${cfg.config.modifier}+2" = "workspace 2";
|
||||||
|
@ -469,7 +473,7 @@ let
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
An attribute set that assignes keypress to an action using key code.
|
An attribute set that assigns keypress to an action using key code.
|
||||||
See <link xlink:href="https://i3wm.org/docs/userguide.html#keybindings"/>.
|
See <link xlink:href="https://i3wm.org/docs/userguide.html#keybindings"/>.
|
||||||
'';
|
'';
|
||||||
example = { "214" = "exec --no-startup-id /bin/script.sh"; };
|
example = { "214" = "exec --no-startup-id /bin/script.sh"; };
|
||||||
|
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.xsession.windowManager.xmonad;
|
cfg = config.xsession.windowManager.xmonad;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
xmonad = pkgs.xmonad-with-packages.override {
|
xmonad = pkgs.xmonad-with-packages.override {
|
||||||
ghcWithPackages = cfg.haskellPackages.ghcWithPackages;
|
ghcWithPackages = cfg.haskellPackages.ghcWithPackages;
|
||||||
packages = self:
|
packages = self:
|
||||||
|
|
|
@ -69,10 +69,17 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.properties != null || cfg.extraConfig != "") {
|
config = mkIf (cfg.properties != null || cfg.extraConfig != "") {
|
||||||
home.file.".Xresources".text =
|
home.file.".Xresources" = {
|
||||||
concatStringsSep "\n" ([]
|
text =
|
||||||
++ (optional (cfg.extraConfig != "") cfg.extraConfig)
|
concatStringsSep "\n" ([]
|
||||||
++ (optionals (cfg.properties != null) (mapAttrsToList formatLine cfg.properties))
|
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||||
) + "\n";
|
++ optionals (cfg.properties != null) (mapAttrsToList formatLine cfg.properties)
|
||||||
|
) + "\n";
|
||||||
|
onChange = ''
|
||||||
|
if [[ -v DISPLAY ]] ; then
|
||||||
|
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,16 @@ in
|
||||||
xsession = {
|
xsession = {
|
||||||
enable = mkEnableOption "X Session";
|
enable = mkEnableOption "X Session";
|
||||||
|
|
||||||
|
scriptPath = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = ".xsession";
|
||||||
|
example = ".xsession-hm";
|
||||||
|
description = ''
|
||||||
|
Path, relative <envar>HOME</envar>, where Home Manager
|
||||||
|
should write the X session script.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
windowManager.command = mkOption {
|
windowManager.command = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
|
@ -117,7 +127,7 @@ in
|
||||||
export HM_XPROFILE_SOURCED=1
|
export HM_XPROFILE_SOURCED=1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.file.".xsession" = {
|
home.file.${cfg.scriptPath} = {
|
||||||
executable = true;
|
executable = true;
|
||||||
text = ''
|
text = ''
|
||||||
if [[ ! -v HM_XPROFILE_SOURCED ]]; then
|
if [[ ! -v HM_XPROFILE_SOURCED ]]; then
|
||||||
|
|
Loading…
Reference in a new issue