nixos/roles/home/zsh.nix

31 lines
610 B
Nix
Raw Normal View History

2023-03-27 16:48:21 +01:00
{ config, pkgs, lib, ... }:
2023-03-19 19:23:48 +00:00
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
2023-03-19 19:23:48 +00:00
exec ${pkgs.zsh}/bin/zsh
'';
in
{
2021-06-25 12:55:23 +01:00
programs.zsh = {
enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" "docker" "docker-compose" "adb" "systemd" ];
theme = "bira";
};
};
2023-03-19 19:23:48 +00:00
home.file.".bashrc".text = ''
${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"}
'';
2021-06-25 12:55:23 +01:00
}