configure noti and tea timer in i3 bar to use pushover

This commit is contained in:
Ingolf Wagner 2025-01-08 17:04:31 +13:00
parent 229dc7f23f
commit 72ec35cb69
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 35 additions and 23 deletions
components/gui
homes/palo

View file

@ -17,7 +17,7 @@ with lib;
./cups.nix
./home-manager
./kmonad.nix
#./noti.nix # todo: make this different (use password store and such)
./noti.nix # todo: make this different (use password store and such)
./pass.nix
./steam.nix
./suspend.nix

View file

@ -16,29 +16,41 @@ with lib;
# todo : put this in `/homes`
config = mkIf (config.components.gui.noti.enable) {
sops.secrets.pushover_user_key = { };
sops.secrets.pushover_api_key = { };
sops.templates."noti.yaml".owner = config.users.users.mainUser.name;
sops.templates."noti.yaml".group = config.users.users.mainUser.group;
sops.templates."noti.yaml".content = ''
pushover:
userKey: ${config.sops.placeholder.pushover_user_key}
apiToken: ${config.sops.placeholder.pushover_api_key}
clan.core.facts.services.noti = {
secret."noti.yaml" = { };
generator = {
prompt = "noti.yaml";
path = with pkgs; [ coreutils ];
script = ''
echo "$prompt_value" > "$secrets"/noti.yaml
'';
};
};
systemd.tmpfiles.settings.noti = {
# don't like to use a non tmpfs here, but does not work another way
"${config.users.users.mainUser.home}/.config/noti/noti.yaml"."C+" = {
user = config.users.users.mainUser.name;
group = config.users.users.mainUser.group;
mode = "400";
argument = config.clan.core.facts.services.noti.secret."noti.yaml".path;
};
};
# sops.secrets.pushover_user_key = { };
# sops.secrets.pushover_api_key = { };
# sops.templates."noti.yaml".owner = config.users.users.mainUser.name;
# sops.templates."noti.yaml".group = config.users.users.mainUser.group;
# sops.templates."noti.yaml".content = ''
# pushover:
# userKey: ${config.sops.placeholder.pushover_user_key}
# apiToken: ${config.sops.placeholder.pushover_api_key}
# '';
home-manager.users.mainUser = {
home.packages = [
(pkgs.writers.writeBashBin "noti" ''
${pkgs.noti}/bin/noti --file ${config.sops.templates."noti.yaml".path} "$@"
'')
(pkgs.writers.writeBashBin "noti-pushover" ''
${pkgs.noti}/bin/noti --pushover --file ${config.sops.templates."noti.yaml".path} "$@"
'')
];
## not working :(
#programs.noti.enable = true;
#xdg.configFile."noti/noti.yaml".source = toString config.sops.templates."noti.yaml".path;
programs.noti.enable = true;
# xdg.configFile."noti/noti.yaml".target = "/run/facts/mainUser.noti.yaml";
};
};
}

View file

@ -125,7 +125,7 @@ in
{
block = "tea_timer";
format = " $icon {$minutes:$seconds |}";
done_cmd = "${pkgs.noti}/bin/noti -t 'Timer Finished'";
done_cmd = "${pkgs.noti}/bin/noti -o -t 'Timer Finished' || ${pkgs.noti}/bin/noti -t 'Timer Finished'";
}
];
};