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 = ''
|
2023-03-27 17:03:14 +01:00
|
|
|
# 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-02-20 18:14:49 +00:00
|
|
|
|
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
|
|
|
}
|