From 2107d232091c8f59b476c537b36a6b1ceddb6c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Fri, 24 Jul 2026 17:40:27 +0200 Subject: [PATCH 1/7] notewrapper: use kdrive directly --- modules/applications/notewrapper.nix | 35 +++++++++++++++++++++++++--- modules/hosts/desktop.nix | 2 +- modules/hosts/laptop.nix | 2 +- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/modules/applications/notewrapper.nix b/modules/applications/notewrapper.nix index 764504e..5cd7524 100644 --- a/modules/applications/notewrapper.nix +++ b/modules/applications/notewrapper.nix @@ -1,5 +1,5 @@ {inputs, ...}: { - flake.homeModules.notewrapper = {pkgs, ...}: { + flake.homeModules.laptop-notewrapper = {pkgs, ...}: { home.packages = [ inputs.notewrapper.packages.${pkgs.system}.default ]; @@ -8,7 +8,7 @@ force = true; text = '' { - "directory": ["~/Documents/Notes/", "~/test/"], + "directory": ["~/kdrive/Notes/"], "render": true, "jumpToEndOfFileOnLaunch": true, "editor": "neovim", @@ -16,7 +16,36 @@ "dateEntry": "# %Y %m %d %a", "newLineOnOpening": true, "backup": { - "enable": true, + "enable": false, + "directory": { + "~/Documents/Notes/": "~/kdrive/Notes/", + "~/test/": "~/backupTest/" + }, + "interval": "daily", + "rsyncArgs": ["-Lqah", "--update"] + } + } + ''; + }; + }; + flake.homeModules.desktop-notewrapper = {pkgs, ...}: { + home.packages = [ + inputs.notewrapper.packages.${pkgs.system}.default + ]; + home.file.".config/notewrapper/config.json" = { + enable = true; + force = true; + text = '' + { + "directory": ["~/hdd/kdrive/Notes/"], + "render": true, + "jumpToEndOfFileOnLaunch": true, + "editor": "neovim", + "journalRegex": ".*journal.*", + "dateEntry": "# %Y %m %d %a", + "newLineOnOpening": true, + "backup": { + "enable": false, "directory": { "~/Documents/Notes/": "~/kdrive/Notes/", "~/test/": "~/backupTest/" diff --git a/modules/hosts/desktop.nix b/modules/hosts/desktop.nix index be7b85e..7b4bc3f 100644 --- a/modules/hosts/desktop.nix +++ b/modules/hosts/desktop.nix @@ -71,7 +71,7 @@ mullvad neovim nix-git-cherry-picker-desktop - notewrapper + desktop-notewrapper oh-my-zsh ripgrep rofi diff --git a/modules/hosts/laptop.nix b/modules/hosts/laptop.nix index 989e0dd..275fae7 100644 --- a/modules/hosts/laptop.nix +++ b/modules/hosts/laptop.nix @@ -72,7 +72,7 @@ mullvad neovim nix-git-cherry-picker-laptop - notewrapper + laptop-notewrapper oh-my-zsh ripgrep rofi From 5db8135dd5dd95fc05810e4ec5c1462b06132f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 15:48:54 +0200 Subject: [PATCH 2/7] setup agenix and migrate from matrix-commander-rs to ntfy for phone notifications --- modules/applications/hyprland.nix | 1 - modules/applications/kdrive.nix | 13 +++-- modules/utilities/autoCleanup.nix | 56 ++++++++++++++----- modules/utilities/autoUpdate.nix | 37 ++++++++---- .../communicationAndNotification.nix | 33 +++-------- modules/utilities/gitBackup.nix | 21 +++++-- 6 files changed, 99 insertions(+), 62 deletions(-) diff --git a/modules/applications/hyprland.nix b/modules/applications/hyprland.nix index 99685ed..851eb07 100644 --- a/modules/applications/hyprland.nix +++ b/modules/applications/hyprland.nix @@ -289,7 +289,6 @@ "custom-checkKdrive && custom-mountkdrive" # checks if the remote works and mount it #"waybar" "custom-gitnotify" - "custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff #"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/) #"QS-notifycache" # builds the cache that will be used for the notification history "sleep 4 & caelestia-shell" #works better if it sleeps a bit before diff --git a/modules/applications/kdrive.nix b/modules/applications/kdrive.nix index f34b115..be4487a 100644 --- a/modules/applications/kdrive.nix +++ b/modules/applications/kdrive.nix @@ -48,11 +48,12 @@ name = "custom-checkKdrive"; runtimeInputs = with pkgs; [ rclone - matrix-commander-rs + curl libnotify ]; text = '' - + # shellcheck disable=SC1091 + source /run/agenix/ntfy # waits for an internet connection. It pings both Google DNS and Cloudfare dns in case one of them is down until ping -c1 -W1 1.1.1.1 >/dev/null 2>&1 || \ ping -c1 -W1 8.8.8.8 >/dev/null 2>&1 @@ -72,9 +73,11 @@ else echo "kdrive rclone failed with error: $output" notify-send "rclone kdrive failed" "$output" - matrix-commander-rs --verbose -m "rclone kdrive failed.
Error:
$output

@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Rclone couldnt access kdrive (rclone lsd kdrive). Error: $output" \ + -H "Title: Rclone kdrive" \ + "$NTFY_SERVER/Alerts" fi ''; }; diff --git a/modules/utilities/autoCleanup.nix b/modules/utilities/autoCleanup.nix index 4cd52a7..94d3751 100644 --- a/modules/utilities/autoCleanup.nix +++ b/modules/utilities/autoCleanup.nix @@ -2,8 +2,12 @@ flake.nixosModules.autoCleanup-laptop = { pkgs, pkgs-unstable, + config, ... }: { + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + }; # Ensure your script is available system-wide environment.systemPackages = [ self.packages.${pkgs.system}.custom-cleanNix-laptop @@ -17,6 +21,9 @@ description = "NixOS configuration auto cleanup"; serviceConfig = { + Environment = [ + "NTFY_SECRET=${config.age.secrets.ntfy.path}" + ]; Type = "oneshot"; ExecStart = "/run/current-system/sw/bin/custom-cleanNix"; @@ -54,8 +61,12 @@ flake.nixosModules.autoCleanup-desktop = { pkgs, pkgs-unstable, + config, ... }: { + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + }; # Ensure your script is available system-wide environment.systemPackages = [ self.packages.${pkgs.system}.custom-cleanNix-desktop @@ -69,6 +80,9 @@ description = "NixOS configuration auto cleanup"; serviceConfig = { + Environment = [ + "NTFY_SECRET=${config.age.secrets.ntfy.path}" + ]; Type = "oneshot"; ExecStart = "/run/current-system/sw/bin/custom-cleanNix"; @@ -108,7 +122,7 @@ runtimeInputs = with pkgs; [ git nixos-rebuild - matrix-commander-rs + curl libnotify alejandra deadnix @@ -117,6 +131,9 @@ text = '' set -e + # shellcheck disable=SC1090 + source "$NTFY_SECRET" + FLAKE_DIR="/home/tomasr/nixos" FLAKE="$FLAKE_DIR#laptop" TIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ") @@ -148,9 +165,11 @@ notify-send "Nix auto cleanup" "Everything OK" - matrix-commander-rs --verbose -m "Nix auto cleanup. Everything OK.
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Everything OK" \ + -H "Title: Laptop Nix auto cleanup" \ + "$NTFY_SERVER/Alerts" else notify-send "Nix auto cleanup" "No changes" git -C "$FLAKE_DIR" push @@ -161,9 +180,11 @@ notify-send -u critical "Nix auto cleanup" "FAILED" - matrix-commander-rs --verbose -m "Nix auto cleanup failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Nix auto cleanup failed. Error: $ERROR_MSG" \ + -H "Title: Laptop Nix auto cleanup" \ + "$NTFY_SERVER/Alerts" git -C "$FLAKE_DIR" reset --hard "pre-cleanup-$TIME" fi @@ -178,7 +199,7 @@ runtimeInputs = with pkgs; [ git nixos-rebuild - matrix-commander-rs + curl libnotify alejandra deadnix @@ -187,6 +208,9 @@ text = '' set -e + # shellcheck disable=SC1090 + source "$NTFY_SECRET" + FLAKE_DIR="/home/tomasr/nixos" FLAKE="$FLAKE_DIR#desktop" TIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ") @@ -218,9 +242,11 @@ notify-send "Nix auto cleanup" "Everything OK" - matrix-commander-rs --verbose -m "Nix auto cleanup. Everything OK.
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Everything OK" \ + -H "Title: Desktop Nix auto cleanup" \ + "$NTFY_SERVER/Alerts" else notify-send "Nix auto cleanup" "No changes" git -C "$FLAKE_DIR" push @@ -231,9 +257,11 @@ notify-send -u critical "Nix auto cleanup" "FAILED" - matrix-commander-rs --verbose -m "Nix auto cleanup failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Nix auto cleanup failed. Error: $ERROR_MSG" \ + -H "Title: Desktop Nix auto cleanup" \ + "$NTFY_SERVER/Alerts" git -C "$FLAKE_DIR" reset --hard "pre-cleanup-$TIME" fi diff --git a/modules/utilities/autoUpdate.nix b/modules/utilities/autoUpdate.nix index 3c4fa78..1746382 100644 --- a/modules/utilities/autoUpdate.nix +++ b/modules/utilities/autoUpdate.nix @@ -103,6 +103,8 @@ ]; text = '' + # shellcheck disable=SC1090 + source "$NTFY_SECRET" set -e FLAKE_DIR="/home/tomasr/nixos" @@ -128,9 +130,11 @@ notify-send "Flake autoupdate" "Rebuild OK" - matrix-commander-rs --verbose -m "Flake rebuild succesfull.
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Laptop Flake rebuild successful" \ + -H "Title: Flake autoupdate" \ + "$NTFY_SERVER/Alerts" else notify-send "Flake autoupdate" "No changes" git -C "$FLAKE_DIR" push @@ -141,9 +145,12 @@ notify-send -u critical "Flake autoupdate" "FAILED" - matrix-commander-rs --verbose -m "Flake rebuild failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Laptop Flake rebuild failed. Error: $ERROR_MSG" \ + -H "Title: Flake autoupdate FAILED" \ + -H "Priority: urgent" \ + "$NTFY_SERVER/Alerts" git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME" fi @@ -189,9 +196,12 @@ notify-send "Flake autoupdate" "Rebuild OK" - matrix-commander-rs --verbose -m "Flake rebuild succesfull.
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Flake rebuild successful" \ + -H "Title: Desktop Flake autoupdate" \ + "$NTFY_SERVER/Alerts" + else notify-send "Flake autoupdate" "No changes" git -C "$FLAKE_DIR" push @@ -202,9 +212,12 @@ notify-send -u critical "Flake autoupdate" "FAILED" - matrix-commander-rs --verbose -m "Flake rebuild failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Flake rebuild failed. Error: $ERROR_MSG" \ + -H "Title: Desktop Flake autoupdate FAILED" \ + -H "Priority: urgent" \ + "$NTFY_SERVER/Alerts" git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME" fi diff --git a/modules/utilities/communicationAndNotification.nix b/modules/utilities/communicationAndNotification.nix index 21506e4..cdffca9 100644 --- a/modules/utilities/communicationAndNotification.nix +++ b/modules/utilities/communicationAndNotification.nix @@ -3,44 +3,26 @@ 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 awww to change wallpapers dinamically) - matrix-commander-rs # matrix client used to send notifications from scripts to my phone # battery notifications self.packages.${pkgs.system}.custom-batterynotify self.packages.${pkgs.system}.custom-batterywarning - # checks if matrix-commander-rs is installed and logged in - self.packages.${pkgs.system}.custom-checkMatrix self.packages.${pkgs.system}.custom-gitnotify # checks if git is set up self.packages.${pkgs.system}.custom-checkKdrive # check if kdrive is set up with rclone zoom-us ]; }; 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 + curl ]; text = '' + # shellcheck disable=SC1091 + source /run/agenix/ntfy + # Check if git is installed if ! command -v git >/dev/null 2>&1; then exit 0 @@ -53,9 +35,10 @@ 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.
Set your identify or remove this warning by removing the custom-gitnotify in ~/nixos/modules/applications/hyprland.nix
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Git not configured" \ + "$NTFY_SERVER/Alerts" fi ''; }; diff --git a/modules/utilities/gitBackup.nix b/modules/utilities/gitBackup.nix index 09561be..9ef9e09 100644 --- a/modules/utilities/gitBackup.nix +++ b/modules/utilities/gitBackup.nix @@ -1,5 +1,8 @@ {self, ...}: { - flake.nixosModules.gitBackup = {pkgs, ...}: { + flake.nixosModules.gitBackup = {pkgs, config, ...}: { + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + }; environment.systemPackages = [ self.packages.${pkgs.system}.custom-gitBackup ]; @@ -9,6 +12,9 @@ serviceConfig = { Type = "oneshot"; + Environment = [ + "NTFY_SECRET=${config.age.secrets.ntfy.path}" + ]; ExecStart = "/run/current-system/sw/bin/custom-gitBackup"; @@ -41,11 +47,14 @@ name = "custom-gitBackup"; runtimeInputs = with pkgs; [ rsync - matrix-commander-rs + curl libnotify self.packages.${pkgs.system}.custom-checkKdrive ]; text = '' + # shellcheck disable=SC1090 + source "$NTFY_SECRET" + # checks if kdrive is available custom-checkKdrive @@ -69,9 +78,11 @@ notify_error() { local message="$1" notify-send "Git Backup Failed" "$message" - matrix-commander-rs --verbose -m "Git Backup Failed: $message
@notificationbot_0000" \ - --html \ - -r "\!BXRRokBmEdNOyYdfOF:matrix.org" + curl \ + -u ":$NTFY_TOKEN" \ + -d "Git backup failed. Error: $message" \ + -H "Title: Git Backup" \ + "$NTFY_SERVER/Alerts" } From fb7be79e8682521acaf98b1a60aa9cf20a0c1a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 15:57:11 +0200 Subject: [PATCH 3/7] snapshot pre-cleanup-2026-07-26T13-57-11Z --- modules/utilities/autoCleanup.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/utilities/autoCleanup.nix b/modules/utilities/autoCleanup.nix index 94d3751..faeceec 100644 --- a/modules/utilities/autoCleanup.nix +++ b/modules/utilities/autoCleanup.nix @@ -156,7 +156,7 @@ alejandra "$FLAKE_DIR" # formats the config echo "--------------------------------------------------------------" - if sudo /run/current-system/sw/bin/nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then # use /run/.../bin/ uses the sudoless rule + if /run/wrappers/bin/sudo /run/current-system/sw/bin/nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then # use /run/.../bin/ uses the sudoless rule if ! git -C "$FLAKE_DIR" diff --quiet HEAD; then git -C "$FLAKE_DIR" add -A @@ -233,7 +233,7 @@ alejandra "$FLAKE_DIR" # formats the config echo "--------------------------------------------------------------" - if sudo /run/current-system/sw/bin/nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then # use /run/.../bin/ uses the sudoless rule + if /run/wrappers/bin/sudo /run/current-system/sw/bin/nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then # use /run/.../bin/ uses the sudoless rule if ! git -C "$FLAKE_DIR" diff --quiet HEAD; then git -C "$FLAKE_DIR" add -A From 00300344182d87ffb21014f0bf0fe3ea0d2163d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 15:59:06 +0200 Subject: [PATCH 4/7] snapshot pre-cleanup-2026-07-26T13-59-06Z --- modules/utilities/autoCleanup.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/utilities/autoCleanup.nix b/modules/utilities/autoCleanup.nix index faeceec..3d8918d 100644 --- a/modules/utilities/autoCleanup.nix +++ b/modules/utilities/autoCleanup.nix @@ -129,7 +129,7 @@ ]; text = '' - set -e + set -ex # shellcheck disable=SC1090 source "$NTFY_SECRET" @@ -206,7 +206,7 @@ ]; text = '' - set -e + set -ex # shellcheck disable=SC1090 source "$NTFY_SECRET" From 324d54683c29897323511921879feaca67b19195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 16:02:17 +0200 Subject: [PATCH 5/7] snapshot pre-cleanup-2026-07-26T14-02-17Z --- modules/utilities/autoCleanup.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/utilities/autoCleanup.nix b/modules/utilities/autoCleanup.nix index 3d8918d..a175ae3 100644 --- a/modules/utilities/autoCleanup.nix +++ b/modules/utilities/autoCleanup.nix @@ -126,6 +126,7 @@ libnotify alejandra deadnix + statix ]; text = '' @@ -203,6 +204,7 @@ libnotify alejandra deadnix + statix ]; text = '' From 19fd3ec35d119f2f86fe3d72da4b36d26a87ad61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 16:02:39 +0200 Subject: [PATCH 6/7] Auto: cleanup-2026-07-26T14-02-17Z --- flake.nix | 3 ++- modules/applications/hyprland.nix | 13 ++++++------- modules/applications/kdrive.nix | 4 ++-- modules/applications/zsh.nix | 2 +- modules/hardware/battery.nix | 6 ++++-- modules/utilities/agenix.nix | 17 +++++++++++++++++ modules/utilities/autoUpdate.nix | 18 ++++++++++++++++-- modules/utilities/gitBackup.nix | 8 ++++++-- secrets/secrets.nix | 9 +++++++++ 9 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 modules/utilities/agenix.nix create mode 100644 secrets/secrets.nix diff --git a/flake.nix b/flake.nix index c5f4cb0..769abca 100644 --- a/flake.nix +++ b/flake.nix @@ -70,7 +70,8 @@ "steam" "steam-unwrapped" "cheatsheet.nvim" - "zoom-us" "zoom" + "zoom-us" + "zoom" ]; mkUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs; diff --git a/modules/applications/hyprland.nix b/modules/applications/hyprland.nix index 851eb07..fb5d469 100644 --- a/modules/applications/hyprland.nix +++ b/modules/applications/hyprland.nix @@ -57,14 +57,13 @@ "if [ -e \"/home/tomasr/icloudSync.sh\" ]; then /home/tomasr/icloudSync.sh; else notify-send \"icloudSync.sh doesn't exist\" \"See ~/nixos/modules/applications/hyprland.nix for more information\"; fi" # my icloud account uses an email that I don't want to make public. So the script isnt pushed to github. The script looks like: /* - #!/etc/profiles/per-user/tomasr/bin/zsh - if ! icloudpd --auth-only --username tomas.rivera_2009@icloud.com --dry-run; then - notify-send "icloudpd is not logged in" "Please run icloudpd icloudpd --username my@email.address --password my_password --auth-only" - exit 1 - fi - icloudpd --directory ~/hdd/kdrive/Photo/IPhone/icloudpd-backup --username tomas.rivera_2009@icloud.com --watch-with-interval 3600 --no-progress-bar + #!/etc/profiles/per-user/tomasr/bin/zsh + if ! icloudpd --auth-only --username tomas.rivera_2009@icloud.com --dry-run; then + notify-send "icloudpd is not logged in" "Please run icloudpd icloudpd --username my@email.address --password my_password --auth-only" + exit 1 + fi + icloudpd --directory ~/hdd/kdrive/Photo/IPhone/icloudpd-backup --username tomas.rivera_2009@icloud.com --watch-with-interval 3600 --no-progress-bar */ - ]; }; }; diff --git a/modules/applications/kdrive.nix b/modules/applications/kdrive.nix index be4487a..ac84598 100644 --- a/modules/applications/kdrive.nix +++ b/modules/applications/kdrive.nix @@ -35,8 +35,8 @@ CPUWeight = 1; # minimum relative CPU share }; }; - systemd.user.timers.kdrive-sync = { - wantedBy = [ "timers.target" ]; + systemd.user.timers.kdrive-sync = { + wantedBy = ["timers.target"]; timerConfig = { OnBootSec = "10m"; OnUnitActiveSec = "1h"; diff --git a/modules/applications/zsh.nix b/modules/applications/zsh.nix index cc40343..0c8014c 100644 --- a/modules/applications/zsh.nix +++ b/modules/applications/zsh.nix @@ -50,7 +50,7 @@ _: { command cat "$@" fi } - + custom-eza() { # behaves differently if we just call it or if we pipe initContent if [[ -t 1 ]]; then eza -hlF -aa --color=always --hyperlink --group-directories-first --show-symlinks --icons=always --git --no-permissions "$@" diff --git a/modules/hardware/battery.nix b/modules/hardware/battery.nix index 096d37d..daa3e64 100644 --- a/modules/hardware/battery.nix +++ b/modules/hardware/battery.nix @@ -36,7 +36,8 @@ services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!! services.thermald.enable = false; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs) services.power-profiles-daemon.enable = true; # ppd is recommended over tlp for framework 16 - /*services.tlp = { + /* + services.tlp = { enable = true; # Enable TLP (better than gnomes internal power manager) settings = { CPU_BOOST_ON_AC = 1; @@ -51,7 +52,8 @@ PLATFORM_PROFILE_ON_BAT = "powersave"; STOP_CHARGE_THRESH_BAT1 = 80; }; - };*/ + }; + */ environment.systemPackages = [ self.packages.${pkgs.system}.custom-performance ]; diff --git a/modules/utilities/agenix.nix b/modules/utilities/agenix.nix new file mode 100644 index 0000000..0e32703 --- /dev/null +++ b/modules/utilities/agenix.nix @@ -0,0 +1,17 @@ +{inputs, ...}: { + flake.nixosModules.agenix = {pkgs, ...}: { + environment.systemPackages = [ + inputs.agenix.packages.${pkgs.system}.default + pkgs.age + ]; + age.identityPaths = [ + "/etc/ssh/ssh_host_ed25519_key" + ]; + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + owner = "tomasr"; + group = "users"; + mode = "0400"; + }; + }; +} diff --git a/modules/utilities/autoUpdate.nix b/modules/utilities/autoUpdate.nix index 1746382..bff8c24 100644 --- a/modules/utilities/autoUpdate.nix +++ b/modules/utilities/autoUpdate.nix @@ -1,5 +1,12 @@ {self, ...}: { - flake.nixosModules.autoUpdate-laptop = {pkgs, ...}: { + flake.nixosModules.autoUpdate-laptop = { + pkgs, + config, + ... + }: { + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + }; # Ensure your script is available system-wide environment.systemPackages = [ self.packages.${pkgs.system}.custom-autoupdate-laptop @@ -46,7 +53,14 @@ }; ## desktop - flake.nixosModules.autoUpdate-desktop = {pkgs, ...}: { + flake.nixosModules.autoUpdate-desktop = { + pkgs, + config, + ... + }: { + age.secrets.ntfy = { + file = ../../secrets/ntfy.age; + }; # Ensure your script is available system-wide environment.systemPackages = [ self.packages.${pkgs.system}.custom-autoupdate-desktop diff --git a/modules/utilities/gitBackup.nix b/modules/utilities/gitBackup.nix index 9ef9e09..e469833 100644 --- a/modules/utilities/gitBackup.nix +++ b/modules/utilities/gitBackup.nix @@ -1,5 +1,9 @@ {self, ...}: { - flake.nixosModules.gitBackup = {pkgs, config, ...}: { + flake.nixosModules.gitBackup = { + pkgs, + config, + ... + }: { age.secrets.ntfy = { file = ../../secrets/ntfy.age; }; @@ -54,7 +58,7 @@ text = '' # shellcheck disable=SC1090 source "$NTFY_SECRET" - + # checks if kdrive is available custom-checkKdrive diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..852d9e9 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,9 @@ +let + backupAgeKey = "age1y4lhpk7awhjyu42p46ulg5q2c49r2lnwu8tyyk4ejj6jztd64uksfhd670"; + laptopHostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJCsewl8ZXXMjRyO20cBIiuW2gA4mGoMkxQ0dcMyNidR root@nixos"; +in { + "ntfy.age".publicKeys = [ + backupAgeKey + laptopHostKey + ]; +} From 6b282b534472913cd91cc126e4ca3d4375a9efd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Sun, 26 Jul 2026 16:08:36 +0200 Subject: [PATCH 7/7] somehow this file disappeared --- secrets/ntfy.age | Bin 0 -> 455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 secrets/ntfy.age diff --git a/secrets/ntfy.age b/secrets/ntfy.age new file mode 100644 index 0000000000000000000000000000000000000000..41bd45f2a37b1600a3157c3089135acbb2c9c778 GIT binary patch literal 455 zcmXBN!EVw37y#g1rb!byndreRcr)oL6zC`y6G|C~wNOesN=!^kOX8!Cu7W# zZDt;>x=Hc^^MN)ZiC^8~!ZefR^% d!3%l?&u-%tTnu2ogm2+1m%nq}AH2Fn`~xZ^yMq7# literal 0 HcmV?d00001