1
0
Fork 0

"Fix" gnome by using terminal dav tools

This commit is contained in:
Malte Brandy 2020-12-21 02:37:55 +01:00
parent 74221ff7b5
commit c043dbda64
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
11 changed files with 144 additions and 12 deletions

View file

@ -76,6 +76,10 @@ in {
./roles/mail.nix
./roles/update_tasks.nix
./roles/research.nix
./roles/vdirsyncer.nix
./roles/khard.nix
./roles/khal.nix
(makeAutostart "unlock-ssh")
]);
unrestricted = [
./roles/accounting.nix
@ -85,8 +89,6 @@ in {
./roles/chat.nix
(setStartpage "https://stats.maralorn.de/d/health-status")
(makeBlock [ ])
(makeAutostart "firefox")
(makeAutostart "chat")
];
in {
unrestricted = apolloConfig unrestricted;

View file

@ -79,6 +79,7 @@
shadowOtherUsers = true;
showProgramPath = false;
treeView = true;
sortKey = "USER";
};
ssh = {
controlMaster = "auto";
@ -131,7 +132,11 @@
};
home = {
packages = builtins.attrValues pkgs.home-pkgs;
packages = builtins.attrValues pkgs.home-pkgs ++ [
(pkgs.writeShellScriptBin "unlock-ssh" ''
SSH_ASKPASS="${config.home.sessionVariables.SSH_ASKPASS}" DISPLAY="a" ssh-add < /dev/null
'')
];
sessionVariables = {
PATH = "$HOME/.nix-profile/bin:$PATH";
BROWSER = "${pkgs.firefox}/bin/firefox";

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
let
simpleDesktopItem = name: command:
pkgs.makeDesktopItem {
@ -25,5 +25,6 @@ in {
"hotkeys"
"vim"
"select-mode"
"unlock-ssh"
];
}

View file

@ -0,0 +1,16 @@
{ pkgs, ... }: {
home = {
packages = [ pkgs.khal ];
#[view]
# removed the description from the agend overview. I get a lot of stupid
# Google ICSs files hat contain massive overhead.
#agenda_event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}"
#event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}"
file.".config/khal/config".text = ''
[calendars]
[[all]]
type = discover
path = ~/.calendars/*/*
'';
};
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }: {
home = {
packages = [ pkgs.khard ];
file.".config/khard/khard.conf".text = ''
[addressbooks]
[[notmuch]]
path = ~/.contacts/nextcloud/contacts
[general]
debug = no
default_action = list
'';
};
}

View file

@ -238,7 +238,7 @@ in {
set pgp_default_key="${gpg}"
set timeout = 5
set abort_noattach = ask-yes
set abort_noattach = ask-no
set abort_noattach_regex = "(hängt an|anhäng|anhang|anbei|angehängt|attach|attached|attachments?)"
set abort_unmodified = ask-yes
@ -286,6 +286,8 @@ in {
(lib.imap1 (n: x: "alias f__${toString n} ${name} <${x}>")
alternates)}
send2-hook '~f fill-later' "push <edit-from><kill-line>f__<complete><search>${mail}<enter>"
macro index,pager a "<pipe-message>${pkgs.khard}/bin/khard add-email<return>" "add sender to to khard"
set query_command = "${pkgs.khard}/bin/khard email --parsable %s"
'';
};
};

View file

@ -0,0 +1,78 @@
{ pkgs, lib, ... }:
let
addressbooks = pkgs.privateValue [ ] "addressbooks";
calendars = pkgs.privateValue [ ] "calendars";
mkConfig = config:
(pkgs.formats.ini { }).generate "vdirsyncer-config" (lib.mapAttrs
(name: section:
(lib.mapAttrs (name: option: builtins.toJSON option) section)) config);
mkCalendar = { name, url, username, passwordPath }:
let
pairName = "${name}_calendar";
remoteName = "${pairName}_remote";
localName = "${pairName}_local";
in {
"pair ${pairName}" = {
a = localName;
b = remoteName;
collections = [ "from a" "from b" ];
conflict_resolution = "b wins";
};
"storage ${localName}" = {
type = "filesystem";
path = "~/.calendars/${name}/";
fileext = ".ics";
};
"storage ${remoteName}" = {
type = "caldav";
inherit url username;
"password.fetch" = [ "command" "${pkgs.pass}/bin/pass" passwordPath ];
};
};
mkAddressbook = { name, url, username, passwordPath }:
let
pairName = "${name}_contacts";
remoteName = "${pairName}_remote";
localName = "${pairName}_local";
in {
"pair ${pairName}" = {
a = localName;
b = remoteName;
collections = [ "from a" "from b" ];
conflict_resolution = "b wins";
};
"storage ${localName}" = {
type = "filesystem";
path = "~/.contacts/${name}/";
fileext = ".vcf";
};
"storage ${remoteName}" = {
type = "carddav";
inherit url username;
"password.fetch" = [ "command" "${pkgs.pass}/bin/pass" passwordPath ];
};
};
in {
home = {
packages = [ pkgs.vdirsyncer ];
file.".config/vdirsyncer/config".source = mkConfig
(pkgs.lib.fold (a: b: a // b) {
general.status_path = "~/.vdirsyncer/status";
} (map mkCalendar calendars ++ map mkAddressbook addressbooks));
};
systemd.user = {
services.vdirsyncer = {
Unit.Description = "vdirsyncer sync";
Service = {
Type = "oneshot";
ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync";
};
};
timers.vdirsyncer = {
Unit.Description = "vdirsync sync timer";
Timer.OnCalendar = "*:0/15";
Install.WantedBy = [ "timers.target" ];
};
};
}

View file

@ -1,6 +1,3 @@
if [[ -z $(ssh-add -L) ]] {
DISPLAY="a" ssh-add < /dev/null
}
if [[ -n "$SSH_CONNECTION" && -z "$TMUX" ]] {
exec mytmux
}

View file

@ -25,7 +25,6 @@
},
"kassandra": {
"branch": "master",
"ref": "master",
"repo": "https://git.darmstadt.ccc.de/maralorn/kassandra",
"rev": "1a0d19ce5d384e15ca64f7f043e5817cbaaf9f6d",
"type": "git"

View file

@ -43,7 +43,17 @@ in {
m-0.laptop.enable = true;
programs.sway.enable = true;
programs = {
sway.enable = true;
ssh = {
extraConfig = ''
Host fb04*.mathematik.tu-darmstadt.de
ProxyJump brandy@gwres1.mathematik.tu-darmstadt.de
'';
startAgent = true;
};
seahorse.enable = lib.mkForce false;
};
services = {
fstrim.enable = true;
@ -80,14 +90,22 @@ in {
xserver = {
enable = true;
displayManager = {
gdm.enable = true;
autoLogin = {
enable = true;
user = "maralorn";
};
gdm.enable = true;
};
desktopManager.gnome3.enable = true;
};
gnome3 = {
evolution-data-server.enable = lib.mkForce false;
gnome-keyring.enable = lib.mkForce false;
at-spi2-core.enable = lib.mkForce false;
tracker.enable = false;
tracker-miners.enable = false;
gnome-online-miners.enable = lib.mkForce false;
};
};
boot.kernel.sysctl."fs.inotify.max_user_watches" = 204800;

@ -1 +1 @@
Subproject commit 598ce6b93ceb7ce21c77b35a0a08d3417bbbd76d
Subproject commit 669d2f5eb84aa45976a864394d3c0922cab09a32