aboutsummaryrefslogtreecommitdiffstats
path: root/users/sils/zsh/default.nix
diff options
context:
space:
mode:
authorsils <sils@sils.li>2023-05-05 19:02:50 +0200
committersils <sils@sils.li>2023-05-05 19:02:50 +0200
commit1f6007ac1c5401a24bd9fd2f2fb9cb695b522f45 (patch)
treeea699bd038fe21b991692fad21eaa3b19774596a /users/sils/zsh/default.nix
parentChore(flake): Update (diff)
downloadnix-config-1f6007ac1c5401a24bd9fd2f2fb9cb695b522f45.zip
Feat(zsh): Move zsh config to users.
Diffstat (limited to 'users/sils/zsh/default.nix')
-rw-r--r--users/sils/zsh/default.nix75
1 files changed, 75 insertions, 0 deletions
diff --git a/users/sils/zsh/default.nix b/users/sils/zsh/default.nix
new file mode 100644
index 0000000..e2e8ca4
--- /dev/null
+++ b/users/sils/zsh/default.nix
@@ -0,0 +1,75 @@
+{
+ config,
+ pkgs,
+ ...
+}: {
+ programs.zsh = {
+ enable = true;
+
+ enableSyntaxHighlighting = true;
+ enableAutosuggestions = true;
+ enableCompletion = true;
+
+ autocd = true;
+ dotDir = ".config/zsh";
+
+ history = {
+ path = "${config.xdg.stateHome}/zsh/zsh_history";
+ ignoreSpace = false;
+ save = 90000;
+ size = 90000;
+ };
+
+ historySubstringSearch.enable = true;
+
+ shellAliases = {
+ vim = "nvim";
+ ls = "lsd";
+ l = "ls -l";
+ la = "ls -a";
+ lla = "ls -la";
+ lt = "ls --tree";
+ rebackup = "restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd backup";
+ repreconf = "restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd";
+ 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-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-
+ file ~/srv/.restic_pswd check";
+ zconf = "nvim ~/.config/zsh/.zshrc";
+ zenv = "nvim ~/.config/zsh/.zshenv";
+ o = "xdg-open";
+ wget = "wget --hsts-file=${config.xdg.dataHome}/wget-hsts";
+ };
+
+ initExtraFirst =
+ builtins.readFile ./config/instant-prompt.zsh
+ + "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
+ # +
+ initExtra =
+ ''
+ export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/
+ export fpath=("$XDG_DATA_HOME/zsh/site-functions" $fpath)
+ HISTFILE="$XDG_STATE_HOME/zsh/history"
+
+ plugins=(git)
+
+
+
+ source $ZSH/oh-my-zsh.sh
+ ''
+ + builtins.readFile ./config/p10k.zsh;
+ };
+}