summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorsils <sils@sils.li>2023-08-02 13:02:40 +0200
committersils <sils@sils.li>2023-08-02 13:02:40 +0200
commit8879a70f4008a7fcd9d4ef20c2d0a4bda6d0ff6e (patch)
tree3422ce242b693a9ea5c41557a4aa0544e130107e
parentRefactor(flake): Declare defaultModules (diff)
downloadnix-config-8879a70f4008a7fcd9d4ef20c2d0a4bda6d0ff6e.tar.gz
nix-config-8879a70f4008a7fcd9d4ef20c2d0a4bda6d0ff6e.zip
Fix(u/sils/zsh): Add sys-update function
-rw-r--r--users/sils/zsh/config/functions.zsh3
-rw-r--r--users/sils/zsh/default.nix20
2 files changed, 14 insertions, 9 deletions
diff --git a/users/sils/zsh/config/functions.zsh b/users/sils/zsh/config/functions.zsh
new file mode 100644
index 0000000..30dbbec
--- /dev/null
+++ b/users/sils/zsh/config/functions.zsh
@@ -0,0 +1,3 @@
+sys-update() {
+	sudo nixos-rebuild $1 --flake /home/sils/repos/nix-config#
+}
diff --git a/users/sils/zsh/default.nix b/users/sils/zsh/default.nix
index d7b1b02..5181b11 100644
--- a/users/sils/zsh/default.nix
+++ b/users/sils/zsh/default.nix
@@ -38,14 +38,15 @@
       b-del = "sudo btrfs subv delet /srv/snapshots/home";
       b-shot = "sudo btrfs subvolume snapshot -r /home /srv/snapshots/home";
       b-home = ''[ -d /srv/snapshots/home ] && sudo btrfs subvolume delete /srv/snapshots/home; sudo btrfs subvolume snapshot -r /home /srv/snapshots/home; sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache backup /srv/snapshots/home;'';
-      r-clean = ''sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-
-      dir /srv/.restic-cache forget \
-                                      --keep-weekly  7  \
-                                      --keep-daily   7  \
-                                      --keep-monthly 6  \
-                                      --keep-yearly  10 \
-                                      --keep-hourly  5  \
-                                      --keep-tag prs'';
+      r-clean = ''
+        sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache forget \
+                                           --keep-weekly  7  \
+                                           --keep-daily   7  \
+                                           --keep-monthly 6  \
+                                           --keep-yearly  10 \
+                                           --keep-hourly  5  \
+                                           --keep-tag prs
+      '';
       r-prune = "sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-
     dir /srv/.restic-cache prune";
       r-check = "sudo restic -r /mnt/storage/backups --cache-dir /srv/.restic-cache --password-
@@ -72,6 +73,7 @@
 
           source $ZSH/oh-my-zsh.sh
       ''
-      + builtins.readFile ./config/p10k.zsh;
+      + builtins.readFile ./config/p10k.zsh
+      + builtins.readFile ./config/functions.zsh;
   };
 }