OSShells, refactor shells to single option
This commit is contained in:
parent
db7f132f6e
commit
55bfb8a4fb
7 changed files with 54 additions and 57 deletions
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
13
nixosModules/apps/shells/zsh/shell.nix
Normal file
13
nixosModules/apps/shells/zsh/shell.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue