✨ configure noti and tea timer in i3 bar to use pushover
This commit is contained in:
parent
229dc7f23f
commit
72ec35cb69
3 changed files with 35 additions and 23 deletions
|
@ -17,7 +17,7 @@ with lib;
|
||||||
./cups.nix
|
./cups.nix
|
||||||
./home-manager
|
./home-manager
|
||||||
./kmonad.nix
|
./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
|
./pass.nix
|
||||||
./steam.nix
|
./steam.nix
|
||||||
./suspend.nix
|
./suspend.nix
|
||||||
|
|
|
@ -16,29 +16,41 @@ with lib;
|
||||||
# todo : put this in `/homes`
|
# todo : put this in `/homes`
|
||||||
config = mkIf (config.components.gui.noti.enable) {
|
config = mkIf (config.components.gui.noti.enable) {
|
||||||
|
|
||||||
sops.secrets.pushover_user_key = { };
|
clan.core.facts.services.noti = {
|
||||||
sops.secrets.pushover_api_key = { };
|
secret."noti.yaml" = { };
|
||||||
sops.templates."noti.yaml".owner = config.users.users.mainUser.name;
|
generator = {
|
||||||
sops.templates."noti.yaml".group = config.users.users.mainUser.group;
|
prompt = "noti.yaml";
|
||||||
sops.templates."noti.yaml".content = ''
|
path = with pkgs; [ coreutils ];
|
||||||
pushover:
|
script = ''
|
||||||
userKey: ${config.sops.placeholder.pushover_user_key}
|
echo "$prompt_value" > "$secrets"/noti.yaml
|
||||||
apiToken: ${config.sops.placeholder.pushover_api_key}
|
'';
|
||||||
'';
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
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-manager.users.mainUser = {
|
||||||
home.packages = [
|
programs.noti.enable = true;
|
||||||
(pkgs.writers.writeBashBin "noti" ''
|
# xdg.configFile."noti/noti.yaml".target = "/run/facts/mainUser.noti.yaml";
|
||||||
${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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ in
|
||||||
{
|
{
|
||||||
block = "tea_timer";
|
block = "tea_timer";
|
||||||
format = " $icon {$minutes:$seconds |}";
|
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'";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue