mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Auto: cleanup-2026-05-24T10-18-36Z
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{ self, ...}: {
|
||||
flake.nixosModules.notifications = { pkgs, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.notifications = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
libnotify # Library that sends desktop notifications to a notification daemon
|
||||
socat # Utility for bidirectional data transfer between two independent data channels (used to communicate between hyprland and swww to change wallpapers dinamically)
|
||||
@@ -13,49 +13,50 @@
|
||||
self.packages.${pkgs.system}.custom-checkKdrive # check if kdrive is set up with rclone
|
||||
];
|
||||
};
|
||||
perSystem = { pkgs, ...}: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-checkMatrix = pkgs.writeShellApplication {
|
||||
name = "custom-checkMatrix";
|
||||
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
matrix-commander-rs
|
||||
libnotify
|
||||
];
|
||||
|
||||
|
||||
text = ''
|
||||
expected="@totorile1:unredacted.org"
|
||||
|
||||
|
||||
current="$(matrix-commander-rs --whoami | tr -d '\n')"
|
||||
|
||||
|
||||
if [ "$current" != "$expected" ]; then
|
||||
notify-send "matrix-commander-rs" \
|
||||
"You are not logged in as @totorile1:unredacted.org\nLog:\n$current"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
packages.custom-gitnotify = pkgs.writeShellApplication {
|
||||
name = "custom-gitnotify";
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
# Check if git is installed
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NAME=$(git config --global user.name)
|
||||
EMAIL=$(git config --global user.email)
|
||||
|
||||
if [[ -z "$NAME" || -z "$EMAIL" ]]; then
|
||||
notify-send \
|
||||
"Git not configured" \
|
||||
"Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/applications/hyprland.nix"
|
||||
matrix-commander-rs --verbose -m "Git not configured.<br>Set your identify or remove this warning by removing the custom-gitnotify in ~/nixos/modules/applications/hyprland.nix<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||
--html \
|
||||
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
packages.custom-gitnotify = pkgs.writeShellApplication {
|
||||
name = "custom-gitnotify";
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
# Check if git is installed
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NAME=$(git config --global user.name)
|
||||
EMAIL=$(git config --global user.email)
|
||||
|
||||
if [[ -z "$NAME" || -z "$EMAIL" ]]; then
|
||||
notify-send \
|
||||
"Git not configured" \
|
||||
"Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/applications/hyprland.nix"
|
||||
matrix-commander-rs --verbose -m "Git not configured.<br>Set your identify or remove this warning by removing the custom-gitnotify in ~/nixos/modules/applications/hyprland.nix<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||
--html \
|
||||
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user