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] 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 + ]; +}