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";
};
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 =
[
{

View file

@ -5,15 +5,16 @@ let
in
{
options.elkowar.generalConfig = with lib; {
shellAliases = lib.mkOption {
shellAbbrs = lib.mkOption {
type = types.attrsOf types.str;
default = {};
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 = {
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)
);
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 = ''
function man() {
env \
@ -104,8 +95,14 @@ in
{
options.elkowar.programs.zsh = {
enable = lib.mkEnableOption "ZSH configuration";
abbrs = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
description = "Shell abbreviations";
default = {};
};
};
config = {
home.packages = [ pkgs.zsh-completions ];
programs.zsh = {
enable = true;
@ -113,7 +110,6 @@ in
enableAutosuggestions = true;
enableCompletion = true;
dotDir = ".config/zsh";
#defaultKeymap = "viins";
history = {
save = 10000;
share = false;
@ -166,7 +162,7 @@ in
${fzf-tab-stuff}
${fixedKeybinds}
${abbrs}
${makeAbbrs cfg.abbrs}
${manFunction}
${builtins.readFile ./prompt.zsh}

View file

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

View file

@ -7,17 +7,26 @@ in
{
options.profiles.base = {
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 ];
config = lib.mkIf cfg.enable {
elkowar.programs.tmux.enable = true;
elkowar.programs.zsh.enable = true;
elkowar.programs.fish.enable = true;
elkowar.generalConfig.shellAliases = {
gc = "git commit";
elkowar.programs.zsh.enable = cfg.enableZsh;
elkowar.programs.fish.enable = cfg.enableFish;
elkowar.generalConfig.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";
};
home.packages = with pkgs; [
@ -29,7 +38,6 @@ in
websocat
niv
exa
zsh-completions
trash-cli
mdcat
github-cli
@ -47,8 +55,8 @@ in
fzf = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
enableFishIntegration = cfg.enableFish;
enableZshIntegration = cfg.enableZsh;
defaultCommand = "rg --files";
fileWidgetCommand = "fd --type f";
changeDirWidgetCommand = "rg --files --null | xargs -0 dirname | sort -u";
@ -56,8 +64,8 @@ in
direnv = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
enableFishIntegration = cfg.enableFish;
enableZshIntegration = cfg.enableZsh;
enableNixDirenvIntegration = true;
};
};