feat(home-manager): add webdav module
This commit is contained in:
parent
01092ee7ef
commit
b0d455217f
5 changed files with 183 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
web.qutebrowser.enable = true;
|
||||
web.webcord.enable = true;
|
||||
gaming.lutris.enable = false;
|
||||
accounts.dav.enable = true;
|
||||
desktop.sway = {
|
||||
enable = true;
|
||||
kanshi = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_:
|
||||
{ ... }:
|
||||
{
|
||||
## Specific host home manager configuration
|
||||
wayland.windowManager.sway.config = {
|
||||
|
@ -16,4 +16,5 @@ _:
|
|||
};
|
||||
};
|
||||
};
|
||||
sops.age.keyFile = "/home/ephase/.config/sops/age/keys.txt";
|
||||
}
|
||||
|
|
133
modules/home-manager/accounts/dav/default.nix
Normal file
133
modules/home-manager/accounts/dav/default.nix
Normal file
|
@ -0,0 +1,133 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.accounts.dav;
|
||||
vdirsyncerConf = {
|
||||
enable = true;
|
||||
auth = "basic";
|
||||
userNameCommand = [
|
||||
"cat"
|
||||
"${config.sops.secrets."webdav/username".path}"
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
options.modules.accounts.dav = {
|
||||
enable = mkEnableOption "enable personal Caldav / CardDav";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
## Manage secrets used in this module
|
||||
sops = {
|
||||
secrets = {
|
||||
"webdav/url/caldav" = {
|
||||
sopsFile = ../../../../secrets/accounts.yaml;
|
||||
};
|
||||
"webdav/url/carddav" = {
|
||||
sopsFile = ../../../../secrets/accounts.yaml;
|
||||
};
|
||||
"webdav/username" = {
|
||||
sopsFile = ../../../../secrets/accounts.yaml;
|
||||
};
|
||||
"webdav/password" = {
|
||||
sopsFile = ../../../../secrets/accounts.yaml;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
accounts.calendar.basePath = ".local/share/calendars";
|
||||
accounts.calendar.accounts.personal_calendars = {
|
||||
name = "personal_calendar";
|
||||
remote.type = "caldav";
|
||||
remote.passwordCommand = [
|
||||
"cat"
|
||||
"${config.sops.secrets."webdav/password".path}"
|
||||
];
|
||||
vdirsyncer = vdirsyncerConf // {
|
||||
metadata = [
|
||||
"color"
|
||||
"displayname"
|
||||
];
|
||||
itemTypes = [
|
||||
"VTODO"
|
||||
"VEVENT"
|
||||
];
|
||||
urlCommand = [
|
||||
"cat"
|
||||
"${config.sops.secrets."webdav/url/caldav".path}"
|
||||
];
|
||||
collections = [
|
||||
"from a"
|
||||
"from b"
|
||||
];
|
||||
};
|
||||
khal = {
|
||||
enable = true;
|
||||
type = "discover";
|
||||
color = "auto";
|
||||
};
|
||||
};
|
||||
|
||||
accounts.contact.basePath = ".local/share/contacts";
|
||||
accounts.contact.accounts.personal_contacts = {
|
||||
remote.type = "carddav";
|
||||
remote.passwordCommand = [
|
||||
"cat"
|
||||
"${config.sops.secrets."webdav/password".path}"
|
||||
];
|
||||
local.type = "filesystem";
|
||||
local.fileExt = ".vcf";
|
||||
vdirsyncer = vdirsyncerConf // {
|
||||
|
||||
metadata = [
|
||||
"displayname"
|
||||
];
|
||||
urlCommand = [
|
||||
"cat"
|
||||
"${config.sops.secrets."webdav/url/carddav".path}"
|
||||
];
|
||||
};
|
||||
khal = {
|
||||
enable = true;
|
||||
color = "#26A269";
|
||||
};
|
||||
khard = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
programs.vdirsyncer.enable = true;
|
||||
services.vdirsyncer = {
|
||||
enable = true;
|
||||
frequency = "*:0/15";
|
||||
};
|
||||
programs.khal = {
|
||||
enable = true;
|
||||
locale = {
|
||||
dateformat = "%Y.%m.%d";
|
||||
datetimeformat = "%Y.%m.%d %H:%M";
|
||||
longdateformat = "%d %B %Y";
|
||||
longdatetimeformat = "%d %B %Y %H:%M";
|
||||
timeformat = "%H:%M";
|
||||
};
|
||||
settings = {
|
||||
default = {
|
||||
highlight_event_days = true;
|
||||
};
|
||||
view = {
|
||||
frame = "color";
|
||||
blank_line_before_day = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.khard = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
default_action = "list";
|
||||
editor = ["nvim" "-i" "NONE"];
|
||||
merge_editor = [ "nvim" "-d" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -21,5 +21,6 @@
|
|||
./web/firefox
|
||||
./web/qutebrowser/default.nix
|
||||
./web/webcord
|
||||
./accounts/dav
|
||||
];
|
||||
}
|
||||
|
|
46
secrets/accounts.yaml
Normal file
46
secrets/accounts.yaml
Normal file
|
@ -0,0 +1,46 @@
|
|||
webdav:
|
||||
url:
|
||||
caldav: ENC[AES256_GCM,data:UMoSLlEhxtJ/80wIQlGaqfu/OI4JXodSLYySwAyJJg==,iv:WTGZ8mq3huVEPMNOBDGdghy994Z5vCzvVDMvp5djnlw=,tag:s34QZVjqvNiQT/P9SVCeUw==,type:str]
|
||||
carddav: ENC[AES256_GCM,data:oGLZ4c02b4wiYCqhyQzC1NG210BUpSpSqibi7xvtIjHhW/X4wvYU5QPm2VKCrJYpvqIEeiah1TDwvByqLpBz5d8Ucyme,iv:cwaWTvdS5eEGmwm5+n2N31ajzAXPix4woXECUqXtk3E=,tag:jRK3viRDzwd5JmNh6UVt2A==,type:str]
|
||||
username: ENC[AES256_GCM,data:Z/QVE3Di,iv:pRBgv/K+VzbF5/iaftTDoxZWjvVztPznLJ5LKpKQaoM=,tag:rCw9mLFtzhpp5vO5eVKqvA==,type:str]
|
||||
password: ENC[AES256_GCM,data:X7hjL2VczjPGKF4n2g==,iv:BwqXZ3h+EIHU+Cvx8gDYhgd2NiBkednUz+ksp40sYas=,tag:ngbtcYsfOxvTTcftBE+lMg==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age19kvatn3zpeqh9zy7u8ce0hqe7dyaesxrukewxt8u7pf4cqkj5dfqm5nlwy
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJRk1KamJ3clA4QTBZT3BL
|
||||
blZGaVNQb2tWMTkrWUxicm9PdXV6RTJJbXh3ClJJQTJON3BBRGJ4RWg1UnRQNVoy
|
||||
bFllM0E1djlOUTVRQ1lZc1JEQS9YNXcKLS0tIEhac3FpUVd6TW9pbUMyNlAzbk5P
|
||||
dGZkOExNbTRuS0NvaDgzUmlFRVNvckEK7PSVxtaDd/3yWIIuAMcX586imRu/On09
|
||||
duwFZ5btOY2fxNYgV9sCG7Vr+OGCO8n9OWBS9hLy7MJwAzi/f5l7Fg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-07-20T16:25:53Z"
|
||||
mac: ENC[AES256_GCM,data:4vNjXD26LeHv00B4gDumkUzq7Us9HRWv79Wq3iyTeDjKOXw9lluIQIZsDB1aQS90dTNCEvlbZ6pt1oHRqGySpDcKHId6rsUy9qkeLl683haKKilT47ABpGiMd2sY6xL1FQPiXMH4qc7wxh+EuS0N6Y+mgIY9Kn0qP6ion1s/lqs=,iv:JZ5lnJKBXQeKadihHyItueHDO6zULVMLSPmGCe+Qlz4=,tag:+bh08XI2TWov6yQJ1+KtoA==,type:str]
|
||||
pgp:
|
||||
- created_at: "2024-06-24T20:12:19Z"
|
||||
enc: |-
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
hQIMA9/d8qUtz+3ZAQ/7BoojnrnGgF4TEnFTJMWVy229Cx1knABVot45A1frFWmS
|
||||
kwIGPGQPlCjGF4tyIOmBy8WpQWBuKffYakCC/OklHCyfnLjsyhcR+MSqDVzqMmy3
|
||||
dEThTcGPRCerM1Mu8oWPk0yq5AKzuJagr9+4ITrljsh6tRwA4qmfKxQ6BZhGPQHJ
|
||||
3FZwcQHfaDkuag3o5swNKHX//MIZwEDyXJHKgeTUPhENzc0POdjPU5CZN0HBU4ep
|
||||
98PJAlAiDKyYSQkg1MfOWvCllyfvhGPzTLEPq5jazqpc7lgNKxJGU5kTnUUi2fKS
|
||||
gCJdqRlMBO/3S8wUZg0gIsw1+OwmfL0y99MeMP1ggGaqFkGs6Pqj7sRd6/QcuP0l
|
||||
w2QZgB9S6DOUkfy5m5Xw7VboE2aAX4BOrWNJVDy//358322xxuqZdbp3pIjnsmt/
|
||||
b2gTZb1eGK/o5GmXfgzCf7In1b3wldg/ZSHyxGct1CJIgNBb1nFDMmyVI9J5zER0
|
||||
2ZTflNfN/cxttW2BvGRoL3fWXnO+ThLHz1q1WWWCOC7TLTnESOtAueSCTlrMcij/
|
||||
7zL7Wc98JgdAuxhznMjiYqY9nZK48jhBCBOdC0uool/FNElcStUaOq1O3HRo5qoi
|
||||
s277Wqtp0uZqeLBxgNEGwicEDm9BbrVzH9egYGMaPJI6STIJYduJXBegnPf5KFXS
|
||||
XgHTJyK7u9MrZ58kkiT95455NEqQd27JMqmsGwReX6/LpYs5KJJGT4qGNab8GM5A
|
||||
VMniFb1GOXIOxSbYgfkgaHc+zK43O5UwBwegOneTC6ak/CQYvD9xQS94FKqwF10=
|
||||
=7pZ/
|
||||
-----END PGP MESSAGE-----
|
||||
fp: 26D5035DF6B4BE70F2B51B4C178139E02D2ACF00
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
Loading…
Add table
Add a link
Reference in a new issue