mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
oh-my-zsh: add module
This commit is contained in:
parent
cde8e02bf2
commit
55b0d30b6e
2 changed files with 64 additions and 0 deletions
|
@ -24,6 +24,7 @@ let
|
|||
./programs/htop.nix
|
||||
./programs/info.nix
|
||||
./programs/lesspipe.nix
|
||||
./programs/oh-my-zsh.nix
|
||||
./programs/ssh.nix
|
||||
./programs/texlive.nix
|
||||
./programs/zsh.nix
|
||||
|
|
63
modules/programs/oh-my-zsh.nix
Normal file
63
modules/programs/oh-my-zsh.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.zsh.oh-my-zsh;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.zsh.oh-my-zsh = {
|
||||
enable = mkEnableOption "oh-my-zsh";
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
example = [ "git" "sudo" ];
|
||||
type = types.listOf(types.str);
|
||||
description = ''
|
||||
List of oh-my-zsh plugins
|
||||
'';
|
||||
};
|
||||
|
||||
custom = mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
example = "$HOME/my_customizations";
|
||||
description = ''
|
||||
Path to a custom oh-my-zsh package to override config of oh-my-zsh.
|
||||
See: https://github.com/robbyrussell/oh-my-zsh/wiki/Customization
|
||||
'';
|
||||
};
|
||||
|
||||
theme = mkOption {
|
||||
default = "";
|
||||
example = "robbyrussell";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Name of the theme to be used by oh-my-zsh.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.oh-my-zsh ];
|
||||
programs.zsh.initExtra = with pkgs; ''
|
||||
# oh-my-zsh configuration generated by NixOS
|
||||
export ZSH=${oh-my-zsh}/share/oh-my-zsh
|
||||
${optionalString (cfg.plugins != [])
|
||||
"plugins=(${concatStringsSep " " cfg.plugins})"
|
||||
}
|
||||
${optionalString (cfg.custom != "")
|
||||
"ZSH_CUSTOM=\"${cfg.custom}\""
|
||||
}
|
||||
${optionalString (cfg.theme != "")
|
||||
"ZSH_THEME=\"${cfg.theme}\""
|
||||
}
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue