gcalcli: now uses symlinkJoin to symlink gcalcli and gcalcliExec

This commit is contained in:
Tigor Hutasuhut 2024-11-21 22:45:21 +07:00
parent 95b7149a58
commit ba4b1b2c30

View file

@ -7,6 +7,13 @@
let let
cfg = config.profile.hyprland; cfg = config.profile.hyprland;
inherit (lib) mkIf; 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 "$@"
''
);
in in
{ {
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -25,11 +32,16 @@ in
home.packages = with pkgs; [ home.packages = with pkgs; [
eww eww
(writeShellScriptBin "gcalcli" '' ags
client_id=$(cat ${config.sops.secrets."gcalcli/client/id".path}) bun
client_secret=$(cat ${config.sops.secrets."gcalcli/client/secret".path}) typescript
${gcalcli}/bin/gcalcli --client-id=$client_id --client-secret=$client_secret "$@" (symlinkJoin {
'') name = "gcalcli";
paths = [
gcalcliExec
gcalcli
];
})
]; ];
home.file.".config/gcalcli/config.toml".source = (pkgs.formats.toml { }).generate "config.toml" { home.file.".config/gcalcli/config.toml".source = (pkgs.formats.toml { }).generate "config.toml" {