init by ai
This commit is contained in:
28
nixos/modules/shell.nix
Normal file
28
nixos/modules/shell.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ 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
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user