zsh: Added any-nix-shell. Removed bashrc handling

This commit is contained in:
Giulio De Pasquale 2023-04-10 20:17:08 +02:00
parent 3eea13b718
commit 2893674f45

View File

@ -1,19 +1,8 @@
{ config, pkgs, lib, ... }:
let
inherit (pkgs.lib) optionalString;
# not having the attribute users means
# we cannot change the default shell (e.g. this is not a NixOS host)
exec_zsh = ''
# if [ -f "$HOME/.bashrc" ]; then
# . "$HOME/.bashrc"
# fi
exec ${pkgs.zsh}/bin/zsh
'';
in
{
home.packages = with pkgs; [ any-nix-shell ];
programs.zsh = {
enable = true;
@ -22,9 +11,9 @@ in
plugins = [ "git" "sudo" "docker" "docker-compose" "adb" "systemd" ];
theme = "bira";
};
};
home.file.".bashrc".text = ''
${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"}
initExtra = ''
any-nix-shell zsh --info-right | source /dev/stdin
'';
};
}