cleanupp nix

This commit is contained in:
elkowar 2020-08-11 17:56:16 +02:00
parent 4893da9523
commit 1f2cb125b5
6 changed files with 35 additions and 38 deletions

View file

@ -1 +1 @@
/nix/store/mq1kmcv74gnyvvjsp5djgsd5p8hqsqx1-home-manager-files/.config/htop/htoprc /nix/store/nb0lqjygfrf2v2qaifc79xw87zb2xk37-home-manager-files/.config/htop/htoprc

View file

@ -20,18 +20,6 @@ in
ls = "exa --icons"; ls = "exa --icons";
}; };
shellAbbrs = {
vim = "nvim";
tsh = "trash";
cxmonad = "nvim /home/leon/.xmonad/lib/Config.hs";
cnix = "cd ~/nixpkgs/ && nvim home.nix && cd -";
gaa = "git add --all";
gc = "git commit -m ";
gp = "git push";
gs = "git status";
};
plugins = plugins =
[ [
{ {

View file

@ -5,15 +5,16 @@ let
in in
{ {
options.elkowar.generalConfig = with lib; { options.elkowar.generalConfig = with lib; {
shellAliases = lib.mkOption { shellAbbrs = lib.mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = {};
description = '' description = ''
A map of aliases that will get applied to zsh and fish configuration. A map of abbreviations that will get applied to zsh and fish configuration.
''; '';
}; };
}; };
config = { config = {
programs.zsh.shellAliases = cfg.shellAliases; elkowar.programs.zsh.abbrs = cfg.shellAbbrs;
programs.fish.shellAbbrs = cfg.shellAbbrs;
}; };
} }

View file

@ -12,15 +12,6 @@ let
(mapAttrs (k: v: ''abbr --session ${k}="${v}" >/dev/null 2>&1'') abbrs) (mapAttrs (k: v: ''abbr --session ${k}="${v}" >/dev/null 2>&1'') abbrs)
); );
abbrs = makeAbbrs {
gc = "git commit -m";
gp = "git push";
gaa = "git add --all";
gs = "git status";
cxmonad = "cd ~/.xmonad && nvim ~/.xmonad/lib/Config.hs && cd -";
cnix = "cd ~/nixpkgs/ && nvim home.nix && cd -";
};
manFunction = '' manFunction = ''
function man() { function man() {
env \ env \
@ -104,8 +95,14 @@ in
{ {
options.elkowar.programs.zsh = { options.elkowar.programs.zsh = {
enable = lib.mkEnableOption "ZSH configuration"; enable = lib.mkEnableOption "ZSH configuration";
abbrs = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
description = "Shell abbreviations";
default = {};
};
}; };
config = { config = {
home.packages = [ pkgs.zsh-completions ];
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -113,7 +110,6 @@ in
enableAutosuggestions = true; enableAutosuggestions = true;
enableCompletion = true; enableCompletion = true;
dotDir = ".config/zsh"; dotDir = ".config/zsh";
#defaultKeymap = "viins";
history = { history = {
save = 10000; save = 10000;
share = false; share = false;
@ -166,7 +162,7 @@ in
${fzf-tab-stuff} ${fzf-tab-stuff}
${fixedKeybinds} ${fixedKeybinds}
${abbrs} ${makeAbbrs cfg.abbrs}
${manFunction} ${manFunction}
${builtins.readFile ./prompt.zsh} ${builtins.readFile ./prompt.zsh}

View file

@ -27,7 +27,11 @@ in
}; };
profiles = { profiles = {
base.enable = true; base = {
enable = true;
enableFish = true;
enableZsh = true;
};
desktop.enable = true; desktop.enable = true;
}; };

View file

@ -7,17 +7,26 @@ in
{ {
options.profiles.base = { options.profiles.base = {
enable = lib.mkEnableOption "Basic profile enabled"; enable = lib.mkEnableOption "Basic profile enabled";
#useZsh = lib.mkEnableOption enableFish = lib.mkEnableOption "Fish shell";
enableZsh = lib.mkEnableOption "Zsh shell";
}; };
imports = [ ../config/tmux.nix ../config/generalConfig.nix ../config/zsh.nix ../config/fish.nix ]; imports = [ ../config/tmux.nix ../config/generalConfig.nix ../config/zsh.nix ../config/fish.nix ];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
elkowar.programs.tmux.enable = true; elkowar.programs.tmux.enable = true;
elkowar.programs.zsh.enable = true; elkowar.programs.zsh.enable = cfg.enableZsh;
elkowar.programs.fish.enable = true; elkowar.programs.fish.enable = cfg.enableFish;
elkowar.generalConfig.shellAliases = { elkowar.generalConfig.shellAbbrs = {
gc = "git commit"; vim = "nvim";
tsh = "trash";
cxmonad = "nvim /home/leon/.xmonad/lib/Config.hs";
cnix = "cd ~/nixpkgs/ && nvim home.nix && cd -";
gaa = "git add --all";
gc = "git commit -m ";
gp = "git push";
gs = "git status";
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -29,7 +38,6 @@ in
websocat websocat
niv niv
exa exa
zsh-completions
trash-cli trash-cli
mdcat mdcat
github-cli github-cli
@ -47,8 +55,8 @@ in
fzf = { fzf = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = cfg.enableFish;
enableZshIntegration = true; enableZshIntegration = cfg.enableZsh;
defaultCommand = "rg --files"; defaultCommand = "rg --files";
fileWidgetCommand = "fd --type f"; fileWidgetCommand = "fd --type f";
changeDirWidgetCommand = "rg --files --null | xargs -0 dirname | sort -u"; changeDirWidgetCommand = "rg --files --null | xargs -0 dirname | sort -u";
@ -56,8 +64,8 @@ in
direnv = { direnv = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = cfg.enableFish;
enableZshIntegration = true; enableZshIntegration = cfg.enableZsh;
enableNixDirenvIntegration = true; enableNixDirenvIntegration = true;
}; };
}; };