OSShells, refactor shells to single option

This commit is contained in:
Julia Lange 2024-11-29 01:53:13 -08:00
parent db7f132f6e
commit 55bfb8a4fb
Signed by: Julia
SSH key fingerprint: SHA256:KI8YxpkPRbnDRkXPgCuQCVz181++Vy7NAvmQj8alOhM
7 changed files with 54 additions and 57 deletions

View file

@ -1,20 +0,0 @@
{ config, pkgs, lib, ... }:
{
options = {
zsh.enable = lib.mkEnableOption "Enables zsh";
zsh.setDefault = lib.mkEnableOption "Sets zsh as the default user's shell";
};
config = lib.mkIf config.zsh.enable {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
histFile = "$HOME/.config/zsh/history";
histSize = 2000;
};
users.defaultUserShell = lib.mkIf config.zsh.setDefault pkgs.zsh;
environment.shells = with pkgs; [ zsh ];
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
{
config = lib.mkIf (config.shell.defaultShell == "zsh") {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
histFile = "$HOME/.config/zsh/history";
histSize = 2000;
};
};
}