feat: add zsh + git features, redesign shell

This commit is contained in:
2026-04-12 21:27:51 +00:00
parent 6770bc76a2
commit 898751576d
6 changed files with 107 additions and 54 deletions

42
features/zsh.nix Normal file
View File

@@ -0,0 +1,42 @@
{
nixos =
{ config, lib, pkgs, user, ... }:
let
cfg = config.features.zsh;
in
{
options.features.zsh = {
enable = lib.mkEnableOption "zsh";
loginShell.enable = lib.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
programs.zsh.enable = true;
environment.etc."zshenv".text = ''
export ZDOTDIR=$HOME/.config/zsh
'';
}
(lib.mkIf cfg.loginShell.enable {
users.users.${user}.shell = pkgs.zsh;
})
]);
};
home =
{ pkgs, lib, osConfig, ... }:
let
cfg = osConfig.features.zsh;
in
{
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.starship ];
};
};
}