NixOS/home/modules/hyprland/eww.nix

62 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2024-11-20 20:39:05 +07:00
{
config,
pkgs,
lib,
...
}:
let
cfg = config.profile.hyprland;
inherit (lib) mkIf;
gcalcliExec = (
pkgs.writeShellScriptBin "gcalcli" ''
client_id=$(cat ${config.sops.secrets."gcalcli/client/id".path})
client_secret=$(cat ${config.sops.secrets."gcalcli/client/secret".path})
${pkgs.gcalcli}/bin/gcalcli --client-id=$client_id --client-secret=$client_secret "$@"
''
);
2024-11-20 20:39:05 +07:00
in
{
config = mkIf cfg.enable {
sops.secrets =
let
sopsFile = ../../../secrets/gcalcli.yaml;
in
{
"gcalcli/client/id" = {
inherit sopsFile;
};
"gcalcli/client/secret" = {
inherit sopsFile;
};
};
home.packages = with pkgs; [
eww
ags
bun
typescript
(symlinkJoin {
name = "gcalcli";
paths = [
gcalcliExec
gcalcli
];
})
2024-11-20 20:39:05 +07:00
];
home.file.".config/gcalcli/config.toml".source = (pkgs.formats.toml { }).generate "config.toml" {
calendars = {
default-calendars = [
"tigor.hutasuhut@bareksa.com"
"Holidays in Indonesia"
"Engineering Team"
];
};
output = {
week-start = "monday";
};
};
};
}