Use emacsclient to update mu index to make sure the db isn't locked
This commit is contained in:
parent
2808ce7436
commit
8e1b901372
6 changed files with 401 additions and 377 deletions
|
@ -1,39 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; };
|
||||
in
|
||||
{
|
||||
imports = [ ./base-x.nix ];
|
||||
home-manager.users.charlotte = { pkgs, ... }: {
|
||||
xsession = {
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
bars = [
|
||||
{
|
||||
colors = {
|
||||
background = "#fbffff";
|
||||
statusline = "#535c65";
|
||||
focusedWorkspace = { background = "#2b7ab2"; border = "#2b7ab2"; text = "#fbffff"; };
|
||||
activeWorkspace = { background = "#6d7782"; border = "#6d7782"; text = "#fbffff"; };
|
||||
inactiveWorkspace = { background = "#fbffff"; border = "#fbffff"; text = "535c65"; };
|
||||
urgentWorkspace = { background = "#ae5865"; border = "#ae5865"; text = "#fbffff"; };
|
||||
};
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration}";
|
||||
}
|
||||
];
|
||||
floating.criteria = [{ class = "launcher"; } { class = "accentor.Main"; }];
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
menu = "${pkgs.kitty}/bin/kitty --class launcher -e ${launcher}/bin/launcher";
|
||||
modifier = "Mod4";
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
extraConfig = ''
|
||||
|
||||
config = {
|
||||
home-manager.users.charlotte = { pkgs, ... }: {
|
||||
xsession = {
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
bars = [
|
||||
{
|
||||
colors = {
|
||||
background = "#fbffff";
|
||||
statusline = "#535c65";
|
||||
focusedWorkspace = { background = "#2b7ab2"; border = "#2b7ab2"; text = "#fbffff"; };
|
||||
activeWorkspace = { background = "#6d7782"; border = "#6d7782"; text = "#fbffff"; };
|
||||
inactiveWorkspace = { background = "#fbffff"; border = "#fbffff"; text = "535c65"; };
|
||||
urgentWorkspace = { background = "#ae5865"; border = "#ae5865"; text = "#fbffff"; };
|
||||
};
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration}";
|
||||
}
|
||||
];
|
||||
floating.criteria = [{ class = "launcher"; } { class = "accentor.Main"; }];
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
menu = "${pkgs.kitty}/bin/kitty --class launcher -e ${launcher}/bin/launcher";
|
||||
modifier = "Mod4";
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
extraConfig = ''
|
||||
default_border pixel
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
passwordScript = pkgs.writeShellScript "get_mail_password" ''${pkgs.pass}/bin/pass show "$@" | head -n1 | tr -d "\n"'';
|
||||
notifyScript = name: pkgs.writeShellScript "notify_${name}_mail" ''
|
||||
|
@ -28,7 +28,7 @@ let
|
|||
enable = true;
|
||||
boxes = [ "INBOX" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync ${name}:INBOX";
|
||||
onNotifyPost = "${pkgs.mu}/bin/mu index && ${notifyScript name}";
|
||||
onNotifyPost = "${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\" && ${notifyScript name}";
|
||||
};
|
||||
mbsync = {
|
||||
enable = true;
|
||||
|
@ -75,239 +75,241 @@ let
|
|||
toRecursiveINIBase 1;
|
||||
in
|
||||
{
|
||||
chvp.zfs.homeLinks = [
|
||||
{ path = "mail"; type = "data"; }
|
||||
{ path = ".cache/mu"; type = "cache"; }
|
||||
{ path = ".local/share/contacts"; type = "cache"; }
|
||||
{ path = ".local/share/calendars"; type = "cache"; }
|
||||
{ path = ".local/share/vdirsyncer"; type = "cache"; }
|
||||
];
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
accounts.email = {
|
||||
maildirBasePath = "/data/home/charlotte/mail";
|
||||
accounts = {
|
||||
personal = makeAccount {
|
||||
name = "personal";
|
||||
address = "charlotte@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Personal";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
primary = true;
|
||||
};
|
||||
};
|
||||
work = makeAccount {
|
||||
name = "work";
|
||||
address = "charlotte.vanpetegem@ugent.be";
|
||||
imapHost = "outlook.office365.com";
|
||||
smtpHost = "smtp.office365.com";
|
||||
passFile = "work/UGentNet";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Deleted Items"; };
|
||||
mbsync.extraConfig.account.PipelineDepth = "1";
|
||||
};
|
||||
};
|
||||
work-aap-we-fr = makeAccount {
|
||||
name = "work-aap-we-fr";
|
||||
address = "aap-we-fr@ugent.be";
|
||||
imapHost = "owa.ugent.be";
|
||||
smtpHost = "smtp.ugent.be";
|
||||
passFile = "work/UGentNet";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
folders = { drafts = "Concepten"; inbox = "INBOX"; sent = "Verzonden items"; trash = "Verwijderde items"; };
|
||||
mbsync.extraConfig.account.PipelineDepth = "1";
|
||||
userName = "UGENT\\\\ecvpeteg/aap-we-fr";
|
||||
};
|
||||
};
|
||||
posteo = makeAccount {
|
||||
name = "posteo";
|
||||
address = "chvp@posteo.net";
|
||||
host = "posteo.de";
|
||||
passFile = "mail/Posteo";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
};
|
||||
};
|
||||
jonggroen = makeAccount {
|
||||
name = "jonggroen";
|
||||
address = "charlotte@jonggroen.be";
|
||||
imapHost = "imap.gmail.com";
|
||||
smtpHost = "smtp.gmail.com";
|
||||
passFile = "jonggroen/GoogleAppMail";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
flavor = "gmail.com";
|
||||
folders = {
|
||||
drafts = "[Gmail].Drafts";
|
||||
inbox = "INBOX";
|
||||
sent = "INBOX";
|
||||
trash = "[Gmail].Bin";
|
||||
config = {
|
||||
chvp.zfs.homeLinks = [
|
||||
{ path = "mail"; type = "data"; }
|
||||
{ path = ".cache/mu"; type = "cache"; }
|
||||
{ path = ".local/share/contacts"; type = "cache"; }
|
||||
{ path = ".local/share/calendars"; type = "cache"; }
|
||||
{ path = ".local/share/vdirsyncer"; type = "cache"; }
|
||||
];
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
accounts.email = {
|
||||
maildirBasePath = "/data/home/charlotte/mail";
|
||||
accounts = {
|
||||
personal = makeAccount {
|
||||
name = "personal";
|
||||
address = "charlotte@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Personal";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
primary = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
postbot = makeAccount {
|
||||
name = "postbot";
|
||||
address = "postbot@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Postbot";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
work = makeAccount {
|
||||
name = "work";
|
||||
address = "charlotte.vanpetegem@ugent.be";
|
||||
imapHost = "outlook.office365.com";
|
||||
smtpHost = "smtp.office365.com";
|
||||
passFile = "work/UGentNet";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Deleted Items"; };
|
||||
mbsync.extraConfig.account.PipelineDepth = "1";
|
||||
};
|
||||
};
|
||||
};
|
||||
webmaster = makeAccount {
|
||||
name = "webmaster";
|
||||
address = "webmaster@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Webmaster";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
work-aap-we-fr = makeAccount {
|
||||
name = "work-aap-we-fr";
|
||||
address = "aap-we-fr@ugent.be";
|
||||
imapHost = "owa.ugent.be";
|
||||
smtpHost = "smtp.ugent.be";
|
||||
passFile = "work/UGentNet";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
folders = { drafts = "Concepten"; inbox = "INBOX"; sent = "Verzonden items"; trash = "Verwijderde items"; };
|
||||
mbsync.extraConfig.account.PipelineDepth = "1";
|
||||
userName = "UGENT\\\\ecvpeteg/aap-we-fr";
|
||||
};
|
||||
};
|
||||
posteo = makeAccount {
|
||||
name = "posteo";
|
||||
address = "chvp@posteo.net";
|
||||
host = "posteo.de";
|
||||
passFile = "mail/Posteo";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
};
|
||||
};
|
||||
jonggroen = makeAccount {
|
||||
name = "jonggroen";
|
||||
address = "charlotte@jonggroen.be";
|
||||
imapHost = "imap.gmail.com";
|
||||
smtpHost = "smtp.gmail.com";
|
||||
passFile = "jonggroen/GoogleAppMail";
|
||||
useStartTls = true;
|
||||
extraConfig = {
|
||||
flavor = "gmail.com";
|
||||
folders = {
|
||||
drafts = "[Gmail].Drafts";
|
||||
inbox = "INBOX";
|
||||
sent = "INBOX";
|
||||
trash = "[Gmail].Bin";
|
||||
};
|
||||
};
|
||||
};
|
||||
postbot = makeAccount {
|
||||
name = "postbot";
|
||||
address = "postbot@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Postbot";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
};
|
||||
};
|
||||
webmaster = makeAccount {
|
||||
name = "webmaster";
|
||||
address = "webmaster@vanpetegem.me";
|
||||
host = "mail.vanpetegem.me";
|
||||
passFile = "mail/Webmaster";
|
||||
extraConfig = {
|
||||
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
home = {
|
||||
packages = [ pkgs.khal pkgs.khard ];
|
||||
file.".mailcap".text = ''
|
||||
text/html; ${pkgs.firefox}/bin/firefox %s ; nametemplate=%s.html; needsterminal
|
||||
text/html; ${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -o document_charset=%{charset} %s ; copiousoutput; nametemplate=%s.html
|
||||
text/calendar; ${pkgs.khal}/bin/khal import %s;
|
||||
application/pdf; ${pkgs.okular}/bin/okular %s
|
||||
image/png; ${pkgs.okular}/bin/okular %s
|
||||
image/jpeg; ${pkgs.okular}/bin/okular %s
|
||||
'';
|
||||
};
|
||||
xdg.configFile = {
|
||||
"khal/config".text = toRecursiveINI {
|
||||
calendars = {
|
||||
calendar = {
|
||||
path = "~/.local/share/calendars/*";
|
||||
type = "discover";
|
||||
};
|
||||
};
|
||||
locale = {
|
||||
timeformat = "%H:%M";
|
||||
dateformat = "%Y-%m-%d";
|
||||
longdateformat = "%Y-%m-%d";
|
||||
datetimeformat = "%Y-%m-%d %H:%M";
|
||||
longdatetimeformat = "%Y-%m-%d %H:%M";
|
||||
};
|
||||
home = {
|
||||
packages = [ pkgs.khal pkgs.khard ];
|
||||
file.".mailcap".text = ''
|
||||
text/html; ${pkgs.firefox}/bin/firefox %s ; nametemplate=%s.html; needsterminal
|
||||
text/html; ${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -o document_charset=%{charset} %s ; copiousoutput; nametemplate=%s.html
|
||||
text/calendar; ${pkgs.khal}/bin/khal import %s;
|
||||
application/pdf; ${pkgs.okular}/bin/okular %s
|
||||
image/png; ${pkgs.okular}/bin/okular %s
|
||||
image/jpeg; ${pkgs.okular}/bin/okular %s
|
||||
'';
|
||||
};
|
||||
"khard/khard.conf".text = toRecursiveINI {
|
||||
addressbooks = {
|
||||
contacts = {
|
||||
path = "~/.local/share/contacts/contacts";
|
||||
xdg.configFile = {
|
||||
"khal/config".text = toRecursiveINI {
|
||||
calendars = {
|
||||
calendar = {
|
||||
path = "~/.local/share/calendars/*";
|
||||
type = "discover";
|
||||
};
|
||||
};
|
||||
locale = {
|
||||
timeformat = "%H:%M";
|
||||
dateformat = "%Y-%m-%d";
|
||||
longdateformat = "%Y-%m-%d";
|
||||
datetimeformat = "%Y-%m-%d %H:%M";
|
||||
longdatetimeformat = "%Y-%m-%d %H:%M";
|
||||
};
|
||||
};
|
||||
general = {
|
||||
debug = "no";
|
||||
default_action = "list";
|
||||
editor = "emacs";
|
||||
merge_editor = "${pkgs.writeShellScript "ediff" ''emacs --eval "(ediff-merge-files \"$1\" \"$2\")"''}";
|
||||
};
|
||||
"contact table" = {
|
||||
display = "formatted_name";
|
||||
group_by_addressbook = "no";
|
||||
reverse = "no";
|
||||
show_nicknames = "no";
|
||||
show_uids = "yes";
|
||||
sort = "last_name";
|
||||
localize_dates = "yes";
|
||||
preferred_phone_number_type = "pref, cell, home";
|
||||
preferred_email_address_type = "pref, work, home";
|
||||
};
|
||||
vcard = {
|
||||
private_objects = ",";
|
||||
preferred_version = "4.0";
|
||||
search_in_source_files = "no";
|
||||
skip_unparsable = "no";
|
||||
"khard/khard.conf".text = toRecursiveINI {
|
||||
addressbooks = {
|
||||
contacts = {
|
||||
path = "~/.local/share/contacts/contacts";
|
||||
};
|
||||
};
|
||||
general = {
|
||||
debug = "no";
|
||||
default_action = "list";
|
||||
editor = "emacs";
|
||||
merge_editor = "${pkgs.writeShellScript "ediff" ''emacs --eval "(ediff-merge-files \"$1\" \"$2\")"''}";
|
||||
};
|
||||
"contact table" = {
|
||||
display = "formatted_name";
|
||||
group_by_addressbook = "no";
|
||||
reverse = "no";
|
||||
show_nicknames = "no";
|
||||
show_uids = "yes";
|
||||
sort = "last_name";
|
||||
localize_dates = "yes";
|
||||
preferred_phone_number_type = "pref, cell, home";
|
||||
preferred_email_address_type = "pref, work, home";
|
||||
};
|
||||
vcard = {
|
||||
private_objects = ",";
|
||||
preferred_version = "4.0";
|
||||
search_in_source_files = "no";
|
||||
skip_unparsable = "no";
|
||||
};
|
||||
};
|
||||
"vdirsyncer/config".text =
|
||||
let nextcloudConfig = type: {
|
||||
inherit type;
|
||||
url = "https://nextcloud.vanpetegem.me/remote.php/dav/";
|
||||
username = "chvp";
|
||||
"password.fetch" = [ "command" "${passwordScript}" "social/Nextcloud" ];
|
||||
}; in
|
||||
lib.generators.toINI
|
||||
{ mkKeyValue = lib.generators.mkKeyValueDefault { mkValueString = builtins.toJSON; } "="; }
|
||||
{
|
||||
general.status_path = "~/.local/share/vdirsyncer";
|
||||
"pair nextcloud_contacts" = {
|
||||
a = "nextcloud_contacts_local";
|
||||
b = "nextcloud_contacts_remote";
|
||||
collections = [ "from a" "from b" ];
|
||||
};
|
||||
"storage nextcloud_contacts_local" = {
|
||||
type = "filesystem";
|
||||
path = "~/.local/share/contacts";
|
||||
fileext = ".vcf";
|
||||
};
|
||||
"storage nextcloud_contacts_remote" = nextcloudConfig "carddav";
|
||||
"pair nextcloud_calendars" = {
|
||||
a = "nextcloud_calendars_local";
|
||||
b = "nextcloud_calendars_remote";
|
||||
collections = [ "from a" "from b" ];
|
||||
};
|
||||
"storage nextcloud_calendars_local" = {
|
||||
type = "filesystem";
|
||||
path = "~/.local/share/calendars";
|
||||
fileext = ".ics";
|
||||
};
|
||||
"storage nextcloud_calendars_remote" = nextcloudConfig "caldav";
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
mbsync.enable = true;
|
||||
msmtp.enable = true;
|
||||
mu.enable = true;
|
||||
};
|
||||
"vdirsyncer/config".text =
|
||||
let nextcloudConfig = type: {
|
||||
inherit type;
|
||||
url = "https://nextcloud.vanpetegem.me/remote.php/dav/";
|
||||
username = "chvp";
|
||||
"password.fetch" = [ "command" "${passwordScript}" "social/Nextcloud" ];
|
||||
}; in
|
||||
lib.generators.toINI
|
||||
{ mkKeyValue = lib.generators.mkKeyValueDefault { mkValueString = builtins.toJSON; } "="; }
|
||||
{
|
||||
general.status_path = "~/.local/share/vdirsyncer";
|
||||
"pair nextcloud_contacts" = {
|
||||
a = "nextcloud_contacts_local";
|
||||
b = "nextcloud_contacts_remote";
|
||||
collections = [ "from a" "from b" ];
|
||||
};
|
||||
"storage nextcloud_contacts_local" = {
|
||||
type = "filesystem";
|
||||
path = "~/.local/share/contacts";
|
||||
fileext = ".vcf";
|
||||
};
|
||||
"storage nextcloud_contacts_remote" = nextcloudConfig "carddav";
|
||||
"pair nextcloud_calendars" = {
|
||||
a = "nextcloud_calendars_local";
|
||||
b = "nextcloud_calendars_remote";
|
||||
collections = [ "from a" "from b" ];
|
||||
};
|
||||
"storage nextcloud_calendars_local" = {
|
||||
type = "filesystem";
|
||||
path = "~/.local/share/calendars";
|
||||
fileext = ".ics";
|
||||
};
|
||||
"storage nextcloud_calendars_remote" = nextcloudConfig "caldav";
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
mbsync.enable = true;
|
||||
msmtp.enable = true;
|
||||
mu.enable = true;
|
||||
};
|
||||
services = {
|
||||
imapnotify.enable = true;
|
||||
};
|
||||
systemd.user = {
|
||||
services = {
|
||||
mbsync = {
|
||||
Unit = {
|
||||
Description = "MBSync email fetcher";
|
||||
After = "network-online.target";
|
||||
Wants = "network-online.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = [ "${pkgs.isync}/bin/mbsync -a" "${pkgs.mu}/bin/mu index" ];
|
||||
};
|
||||
};
|
||||
vdirsyncer = {
|
||||
Unit = {
|
||||
Description = "VDirSyncer WebDAV syncer";
|
||||
After = "network-online.target";
|
||||
Wants = "network-online.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync";
|
||||
};
|
||||
};
|
||||
imapnotify.enable = true;
|
||||
};
|
||||
timers = {
|
||||
mbsync = {
|
||||
Unit = { Description = "MBSync email fetcher"; };
|
||||
Timer = {
|
||||
OnCalendar = "*:0/5";
|
||||
Unit = "mbsync.service";
|
||||
systemd.user = {
|
||||
services = {
|
||||
mbsync = {
|
||||
Unit = {
|
||||
Description = "MBSync email fetcher";
|
||||
After = "network-online.target";
|
||||
Wants = "network-online.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = [ "${pkgs.isync}/bin/mbsync -a" "${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\"" ];
|
||||
};
|
||||
};
|
||||
vdirsyncer = {
|
||||
Unit = {
|
||||
Description = "VDirSyncer WebDAV syncer";
|
||||
After = "network-online.target";
|
||||
Wants = "network-online.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync";
|
||||
};
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
vdirsyncer = {
|
||||
Unit = { Description = "VDirSyncer WebDAV syncer"; };
|
||||
Timer = {
|
||||
OnCalendar = "*:0/5";
|
||||
Unit = "vdirsyncer.service";
|
||||
timers = {
|
||||
mbsync = {
|
||||
Unit = { Description = "MBSync email fetcher"; };
|
||||
Timer = {
|
||||
OnCalendar = "*:0/5";
|
||||
Unit = "mbsync.service";
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
vdirsyncer = {
|
||||
Unit = { Description = "VDirSyncer WebDAV syncer"; };
|
||||
Timer = {
|
||||
OnCalendar = "*:0/5";
|
||||
Unit = "vdirsyncer.service";
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,123 +1,124 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; };
|
||||
color-picker = import ./sway/color-picker.nix { inherit pkgs; };
|
||||
screenshot = import ./sway/screenshot.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; };
|
||||
in
|
||||
{
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
security.pam.services.swaylock = { };
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
gtkUsePortal = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ];
|
||||
};
|
||||
home-manager.users.charlotte = { pkgs, lib, ... }: {
|
||||
home.packages = [ color-picker screenshot ];
|
||||
programs.mako = {
|
||||
config = {
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
security.pam.services.swaylock = { };
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
font = "Fira Code Normal 9";
|
||||
gtkUsePortal = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ];
|
||||
};
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
"home-undocked" = {
|
||||
outputs = [
|
||||
{ criteria = "Unknown 0x2036 0x00000000"; position = "0,0"; mode = "2560x1440"; scale = 1.0; }
|
||||
];
|
||||
};
|
||||
"home-docked" = {
|
||||
outputs = [
|
||||
{ criteria = "Unknown 0x2036 0x00000000"; position = "0,0"; mode = "2560x1440"; scale = 1.0; }
|
||||
{ criteria = "Dell Inc. DELL U2718Q FN84K01T095L"; position = "2560,0"; mode = "3840x2160"; scale = 1.25; }
|
||||
];
|
||||
};
|
||||
"work-undocked" = {
|
||||
outputs = [
|
||||
{ criteria = "Chimei Innolux Corporation 0x14D3 0x00000000"; position = "0,0"; mode = "1920x1080"; scale = 1.0; }
|
||||
];
|
||||
};
|
||||
"work-docked" = {
|
||||
outputs = [
|
||||
{ criteria = "Chimei Innolux Corporation 0x14D3 0x00000000"; position = "0,0"; mode = "1920x1080"; scale = 1.0; }
|
||||
{ criteria = "Dell Inc. DELL U2718Q FN84K83Q1KHL"; position = "1920,0"; mode = "3840x2160"; scale = 1.25; }
|
||||
];
|
||||
home-manager.users.charlotte = { pkgs, lib, ... }: {
|
||||
home.packages = [ color-picker screenshot ];
|
||||
programs.mako = {
|
||||
enable = true;
|
||||
font = "Fira Code Normal 9";
|
||||
};
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
"home-undocked" = {
|
||||
outputs = [
|
||||
{ criteria = "Unknown 0x2036 0x00000000"; position = "0,0"; mode = "2560x1440"; scale = 1.0; }
|
||||
];
|
||||
};
|
||||
"home-docked" = {
|
||||
outputs = [
|
||||
{ criteria = "Unknown 0x2036 0x00000000"; position = "0,0"; mode = "2560x1440"; scale = 1.0; }
|
||||
{ criteria = "Dell Inc. DELL U2718Q FN84K01T095L"; position = "2560,0"; mode = "3840x2160"; scale = 1.25; }
|
||||
];
|
||||
};
|
||||
"work-undocked" = {
|
||||
outputs = [
|
||||
{ criteria = "Chimei Innolux Corporation 0x14D3 0x00000000"; position = "0,0"; mode = "1920x1080"; scale = 1.0; }
|
||||
];
|
||||
};
|
||||
"work-docked" = {
|
||||
outputs = [
|
||||
{ criteria = "Chimei Innolux Corporation 0x14D3 0x00000000"; position = "0,0"; mode = "1920x1080"; scale = 1.0; }
|
||||
{ criteria = "Dell Inc. DELL U2718Q FN84K83Q1KHL"; position = "1920,0"; mode = "3840x2160"; scale = 1.25; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = rec {
|
||||
modifier = "Mod4";
|
||||
left = "h";
|
||||
down = "j";
|
||||
up = "k";
|
||||
right = "l";
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
menu = "${terminal} --class launcher -e ${launcher}/bin/launcher";
|
||||
bars = [
|
||||
{
|
||||
colors = {
|
||||
background = "#ffffff";
|
||||
statusline = "#000000";
|
||||
activeWorkspace = { border = "#f2eff3"; background = "#f2eff3"; text = "#000000"; };
|
||||
focusedWorkspace = { border = "#6aaeff"; background = "#6aaeff"; text = "#000000"; };
|
||||
inactiveWorkspace = { border = "#ffffff"; background = "#ffffff"; text = "#000000"; };
|
||||
urgentWorkspace = { border = "#ff8892"; background = "#ff8892"; text = "#000000"; };
|
||||
};
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration}";
|
||||
extraConfig = ''
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = rec {
|
||||
modifier = "Mod4";
|
||||
left = "h";
|
||||
down = "j";
|
||||
up = "k";
|
||||
right = "l";
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
menu = "${terminal} --class launcher -e ${launcher}/bin/launcher";
|
||||
bars = [
|
||||
{
|
||||
colors = {
|
||||
background = "#ffffff";
|
||||
statusline = "#000000";
|
||||
activeWorkspace = { border = "#f2eff3"; background = "#f2eff3"; text = "#000000"; };
|
||||
focusedWorkspace = { border = "#6aaeff"; background = "#6aaeff"; text = "#000000"; };
|
||||
inactiveWorkspace = { border = "#ffffff"; background = "#ffffff"; text = "#000000"; };
|
||||
urgentWorkspace = { border = "#ff8892"; background = "#ff8892"; text = "#000000"; };
|
||||
};
|
||||
fonts = [ "Fira Code Normal 9" ];
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration}";
|
||||
extraConfig = ''
|
||||
status_padding 0
|
||||
icon_theme Arc
|
||||
'';
|
||||
}
|
||||
];
|
||||
output = {
|
||||
"Unknown 0x2036 0x00000000" = { position = "0,0"; mode = "2560x1440"; scale = "1.0"; };
|
||||
"Dell Inc. DELL U2718Q FN84K01T095L" = { position = "2560,0"; mode = "3840x2160"; scale = "1.25"; };
|
||||
"Chimei Innolux Corporation 0x14D3 0x00000000" = { position = "0,0"; mode = "1920x1080"; scale = "1.0"; };
|
||||
"Dell Inc. DELL U2718Q FN84K83Q1KHL" = { position = "1920,0"; mode = "3840x2160"; scale = "1.25"; };
|
||||
}
|
||||
];
|
||||
output = {
|
||||
"Unknown 0x2036 0x00000000" = { position = "0,0"; mode = "2560x1440"; scale = "1.0"; };
|
||||
"Dell Inc. DELL U2718Q FN84K01T095L" = { position = "2560,0"; mode = "3840x2160"; scale = "1.25"; };
|
||||
"Chimei Innolux Corporation 0x14D3 0x00000000" = { position = "0,0"; mode = "1920x1080"; scale = "1.0"; };
|
||||
"Dell Inc. DELL U2718Q FN84K83Q1KHL" = { position = "1920,0"; mode = "3840x2160"; scale = "1.25"; };
|
||||
};
|
||||
startup = [
|
||||
{
|
||||
command = "${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' timeout 150 '${pkgs.sway}/bin/swaymsg \"output * dpms off\"' resume '${pkgs.sway}/bin/swaymsg \"output * dpms on\"' before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'";
|
||||
}
|
||||
];
|
||||
window.commands = [
|
||||
{ command = "floating enable"; criteria = { app_id = "launcher"; }; }
|
||||
{ command = "floating enable"; criteria = { title = "Quick Format Citation"; class = "Zotero"; }; }
|
||||
];
|
||||
input = {
|
||||
"type:keyboard" = { xkb_layout = "us"; xkb_variant = "altgr-intl"; xkb_numlock = "enabled"; xkb_options = "compose:caps"; };
|
||||
"type:touchpad" = { drag = "enabled"; dwt = "enabled"; scroll_method = "two_finger"; tap = "enabled"; };
|
||||
};
|
||||
modes = { }; # Unset default "resize" mode
|
||||
keybindings = lib.mkOptionDefault {
|
||||
"${modifier}+Shift+q" = "nop Unset default kill";
|
||||
"${modifier}+r" = "nop Unset default resize mode";
|
||||
"${modifier}+Shift+c" = "kill";
|
||||
"${modifier}+Shift+r" = "reload";
|
||||
"${modifier}+c" = "exec ${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
||||
"${modifier}+i" = "inhibit_idle open; border normal; mark --add inhibiting_idle";
|
||||
"${modifier}+Shift+i" = "inhibit_idle none; border pixel; unmark inhibiting_idle";
|
||||
"Print" = "exec ${screenshot}/bin/screenshot";
|
||||
"Alt+Print" = "exec ${screenshot}/bin/screenshot -d";
|
||||
"Shift+Print" = "exec ${screenshot}/bin/screenshot -r";
|
||||
"Alt+Shift+Print" = "exec ${screenshot}/bin/screenshot -r -d";
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%";
|
||||
"${modifier}+Alt+Left" = "move workspace to output left";
|
||||
"${modifier}+Alt+Right" = "move workspace to output right";
|
||||
};
|
||||
};
|
||||
startup = [
|
||||
{
|
||||
command = "${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' timeout 150 '${pkgs.sway}/bin/swaymsg \"output * dpms off\"' resume '${pkgs.sway}/bin/swaymsg \"output * dpms on\"' before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000'";
|
||||
}
|
||||
];
|
||||
window.commands = [
|
||||
{ command = "floating enable"; criteria = { app_id = "launcher"; }; }
|
||||
{ command = "floating enable"; criteria = { title = "Quick Format Citation"; class = "Zotero"; }; }
|
||||
];
|
||||
input = {
|
||||
"type:keyboard" = { xkb_layout = "us"; xkb_variant = "altgr-intl"; xkb_numlock = "enabled"; xkb_options = "compose:caps"; };
|
||||
"type:touchpad" = { drag = "enabled"; dwt = "enabled"; scroll_method = "two_finger"; tap = "enabled"; };
|
||||
};
|
||||
modes = { }; # Unset default "resize" mode
|
||||
keybindings = lib.mkOptionDefault {
|
||||
"${modifier}+Shift+q" = "nop Unset default kill";
|
||||
"${modifier}+r" = "nop Unset default resize mode";
|
||||
"${modifier}+Shift+c" = "kill";
|
||||
"${modifier}+Shift+r" = "reload";
|
||||
"${modifier}+c" = "exec ${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
||||
"${modifier}+i" = "inhibit_idle open; border normal; mark --add inhibiting_idle";
|
||||
"${modifier}+Shift+i" = "inhibit_idle none; border pixel; unmark inhibiting_idle";
|
||||
"Print" = "exec ${screenshot}/bin/screenshot";
|
||||
"Alt+Print" = "exec ${screenshot}/bin/screenshot -d";
|
||||
"Shift+Print" = "exec ${screenshot}/bin/screenshot -r";
|
||||
"Alt+Shift+Print" = "exec ${screenshot}/bin/screenshot -r -d";
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%";
|
||||
"${modifier}+Alt+Left" = "move workspace to output left";
|
||||
"${modifier}+Alt+Right" = "move workspace to output right";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
extraConfig = ''
|
||||
workspace 1 output eDP-1
|
||||
workspace 2 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
|
||||
workspace 3 output DP-3 DP-4 DP-5 HDMI-A-1 eDP-1
|
||||
|
@ -140,7 +141,7 @@ in
|
|||
|
||||
default_border pixel
|
||||
'';
|
||||
extraSessionCommands = ''
|
||||
extraSessionCommands = ''
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||
|
@ -151,11 +152,12 @@ in
|
|||
export MOZ_ENABLE_WAYLAND=1
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
'';
|
||||
wrapperFeatures = {
|
||||
base = true;
|
||||
gtk = true;
|
||||
wrapperFeatures = {
|
||||
base = true;
|
||||
gtk = true;
|
||||
};
|
||||
xwayland = true;
|
||||
};
|
||||
xwayland = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
mic-status = pkgs.writeShellScript "mic-status" ''
|
||||
if [ "$(${pkgs.pulseaudio}/bin/pactl list sources | grep -o 'Mute: yes')" = "Mute: yes" ]
|
||||
|
@ -95,7 +95,7 @@ pkgs.writeText "configuration.toml" ''
|
|||
json = true
|
||||
command = "${mail-status}"
|
||||
interval = 1
|
||||
on_click = "${pkgs.isync}/bin/mbsync -a"
|
||||
on_click = "${pkgs.isync}/bin/mbsync -a && ${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\""
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue