split waybar into multiple files
This commit is contained in:
parent
53c7532351
commit
7cff7f09c3
29 changed files with 953 additions and 617 deletions
63
modules/user-services/khal.nix
Normal file
63
modules/user-services/khal.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.xyno.user-services.khal;
|
||||
in
|
||||
{
|
||||
options.xyno.user-services.khal.enable = lib.mkEnableOption "enable khal and vdirsyncer";
|
||||
options.xyno.user-services.khal.wantedBy = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "niri.service";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.khal
|
||||
pkgs.vdirsyncer
|
||||
];
|
||||
systemd.packages = [ pkgs.vdirsyncer ];
|
||||
environment.etc."xdg/khal/config".text = ''
|
||||
[locale]
|
||||
weeknumbers = right
|
||||
timeformat = "%H:%M"
|
||||
longdatetimeformat = "%Y-%m-%dT%H:%M:%S"
|
||||
datetimeformat = "%Y-%m-%dT%H:%M:%S"
|
||||
dateformat = "%Y-%m-%d"
|
||||
longdateformat = "%Y-%m-%d"
|
||||
[calendars]
|
||||
[[calendars]]
|
||||
path = ~/.calendars/*
|
||||
type = discover
|
||||
'';
|
||||
systemd.user.services.vdirsyncer = {
|
||||
environment.VDIRSYNCER_CONFIG = config.sops.secrets."vdirsyncer".path;
|
||||
unitConfig = {
|
||||
After = "network-online.target";
|
||||
Wants = "network-online.target";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
script = ''
|
||||
${pkgs.vdirsyncer}/bin/vdirsyncer metasync
|
||||
${pkgs.vdirsyncer}/bin/vdirsyncer sync
|
||||
'';
|
||||
};
|
||||
systemd.user.timers.vdirsyncer = {
|
||||
wantedBy = [ cfg.wantedBy "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*:0/15:00";
|
||||
Unit = "vdirsyncer.service";
|
||||
};
|
||||
};
|
||||
environment.sessionVariables.VDIRSYNCER_CONFIG = config.sops.secrets."vdirsyncer".path;
|
||||
sops.secrets."vdirsyncer" = {
|
||||
sopsFile = ../../secrets/desktop/calendar.yaml;
|
||||
group = "users";
|
||||
owner = config.xyno.system.user.name;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue