29 lines
622 B
Nix
29 lines
622 B
Nix
|
|
{ config, lib, pkgs, ... }:
|
||
|
|
|
||
|
|
{
|
||
|
|
options.custom.shell = {
|
||
|
|
enable = lib.mkEnableOption "Shell configuration" // { default = true; };
|
||
|
|
defaultShell = lib.mkOption {
|
||
|
|
type = lib.types.str;
|
||
|
|
default = "zsh";
|
||
|
|
description = "Default shell (bash, zsh, fish)";
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
config = let
|
||
|
|
cfg = config.custom.shell;
|
||
|
|
in lib.mkIf cfg.enable {
|
||
|
|
|
||
|
|
programs.zsh.enable = cfg.defaultShell == "zsh";
|
||
|
|
programs.bash.enable = true;
|
||
|
|
programs.fish.enable = cfg.defaultShell == "fish";
|
||
|
|
|
||
|
|
# Common shell packages
|
||
|
|
environment.systemPackages = with pkgs; [
|
||
|
|
starship
|
||
|
|
direnv
|
||
|
|
];
|
||
|
|
|
||
|
|
};
|
||
|
|
}
|