From 95b7149a58fb3398803d5d13b1ee7b341ddfbec8 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 20 Nov 2024 20:39:05 +0700 Subject: [PATCH] gcalcli: added gcalcli to hyprland --- home/modules/hyprland/default.nix | 7 +---- home/modules/hyprland/eww.nix | 49 +++++++++++++++++++++++++++++++ secrets/gcalcli.yaml | 24 +++++++++++++++ 3 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 home/modules/hyprland/eww.nix create mode 100644 secrets/gcalcli.yaml diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index dcbc4a5..d2346fc 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -9,21 +9,16 @@ let in { imports = [ - # ./dunst.nix ./bitwarden.nix ./hypridle.nix ./hyprland.nix ./hyprlock.nix - # ./hyprshot.nix - # hyprpaper seems to be broken with out of memory and failure to swap wallpapers correctly. - # Use swww for now until the application is stable. - # ./hyprpaper.nix ./pyprland.nix ./rofi.nix ./waybar.nix ./wlogout.nix ./grimblast.nix - # ./swappy.nix + ./eww.nix ./alacritty.nix ./swayosd.nix ./swaync.nix diff --git a/home/modules/hyprland/eww.nix b/home/modules/hyprland/eww.nix new file mode 100644 index 0000000..1f3a306 --- /dev/null +++ b/home/modules/hyprland/eww.nix @@ -0,0 +1,49 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.profile.hyprland; + inherit (lib) mkIf; +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 + (writeShellScriptBin "gcalcli" '' + client_id=$(cat ${config.sops.secrets."gcalcli/client/id".path}) + client_secret=$(cat ${config.sops.secrets."gcalcli/client/secret".path}) + ${gcalcli}/bin/gcalcli --client-id=$client_id --client-secret=$client_secret "$@" + '') + ]; + + 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"; + }; + }; + }; +} diff --git a/secrets/gcalcli.yaml b/secrets/gcalcli.yaml new file mode 100644 index 0000000..d9997b9 --- /dev/null +++ b/secrets/gcalcli.yaml @@ -0,0 +1,24 @@ +gcalcli: + client: + id: ENC[AES256_GCM,data:ywRDXNYa93uI3QL5ETPspShX6ye/7p9a48l3wpdsQjRmOQr+xZ+UpitbRVh4VXrLIadiKiyhe//wC2FcHmeRXStn8FpTfk0E,iv:bbM3a2Sfzmq6Lxa8tKjKIUwxNjQNE4g7cUKJluSuIiI=,tag:KV2BPKucCldEWQpn//mX8w==,type:str] + secret: ENC[AES256_GCM,data:nA3YL7t4p/iNEUtnQfmEB8GLq6pibzjW/yMYWpz50co0zg8=,iv:ZVO60kMSAh/jeOjH/jxus8FtBSZ+qu90cYUc3WR5mpk=,tag:7CwEKgiWpNvfB1z0lpW/aA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1kruum2varzua7w5n6n52vhwyek2arc685rhcwt0u7k2jf5mecsjslkl9ll + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIQ3ZPSVpFMUpsbjljd1pp + Y3FPTXlSWmExZ2QxZTFnU2hWcWtDc3JzbTJJClBmeGtyMlV1WVd4T3NnMTB5WUo3 + MVNJdjYxSjBNbjYvMFp1cHlSUlh1N2sKLS0tIHlhQXhDUHBxeW14T2FGbWhpeTRP + Wm8rUktjY21EY0RodUpzc0I3NHIrN0kKTn8Jzlgp3nPQdVl8VQYPwQvGjXpAq9vP + 09PzQmOfabD1h3rY2exg4D2oLhtTNzVvGu2exPNwmRlHVqbGB4SPJA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-11-20T12:57:09Z" + mac: ENC[AES256_GCM,data:BiyRdcYvb4CjGEafN7M0sgXJ8k6vdxiiJOvIYyr1ENExfxNuoDinlHOuSAGG9GtQj8icVAzDZ1AZ2rzn4uVD+KLG744M3u6Z3yAAo/eDxz3PzOiUfl/Wf7ivG/WtGT1rPVX8iZcmxnb6rRym3ZuyD41B68x1zB3DvfRSVryvdco=,iv:eIAfyBLEUv8GcZLxYu+cQVWVoHj3qgLddjoCwny/ris=,tag:UsSKGIJuzNXak9X5FtIoqw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.1