nixos/roles/home/zsh.nix

34 lines
963 B
Nix
Raw Normal View History

{ pkgs, ... }:
2023-03-19 19:23:48 +00:00
2024-11-14 11:17:26 +00:00
let
commitFunctions = pkgs.writeTextDir "bin/commits.sh" (builtins.readFile ./scripts/commits.sh);
2024-11-14 11:17:26 +00:00
in
2023-03-19 19:23:48 +00:00
{
home.packages = with pkgs; [ any-nix-shell ];
2021-06-25 12:55:23 +01:00
programs.zsh = {
enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" "docker" "docker-compose" "systemd" ];
2021-06-25 12:55:23 +01:00
theme = "bira";
};
2024-06-01 11:41:26 +01:00
autosuggestion.enable = false;
dotDir = ".config/zsh";
initExtra = ''
# avoid macOS updates to destroy nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
any-nix-shell zsh --info-right | source /dev/stdin
2023-06-01 20:09:04 +01:00
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
2025-01-14 12:15:13 +00:00
${if pkgs.stdenv.isDarwin then "export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:/opt/homebrew/sbin:$PATH" else ""}
2024-11-14 11:17:26 +00:00
source ${commitFunctions}/bin/commits.sh
'';
};
2021-06-25 12:55:23 +01:00
}
2023-06-01 20:09:04 +01:00