diff --git a/files/.config/htop/htoprc b/files/.config/htop/htoprc index 3c98eb4..283a854 120000 --- a/files/.config/htop/htoprc +++ b/files/.config/htop/htoprc @@ -1 +1 @@ -/nix/store/spsy6k9bx1rvrfqwmd848r2j6pw1w3bi-home-manager-files/.config/htop/htoprc \ No newline at end of file +/nix/store/v0n44jjhbc1jh715dysni16gyskaf3g4-home-manager-files/.config/htop/htoprc \ No newline at end of file diff --git a/files/nix-stuff/nixpkgs/config/generalConfig.nix b/files/nix-stuff/nixpkgs/config/generalConfig.nix new file mode 100644 index 0000000..850ef77 --- /dev/null +++ b/files/nix-stuff/nixpkgs/config/generalConfig.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.elkowar.generalConfig; + myConf = import ../myConfig.nix; +in +{ + options.elkowar.generalConfig = with lib; { + shellAliases = lib.mkOption { + type = types.attrsOf types.str; + default = {}; + description = '' + A map of aliases that will get applied to zsh and fish configuration. + ''; + }; + }; + config = { + programs.zsh.shellAliases = cfg.shellAliases; + }; +} diff --git a/files/nix-stuff/nixpkgs/config/tmux.nix b/files/nix-stuff/nixpkgs/config/tmux.nix index 47aa747..8de91fe 100644 --- a/files/nix-stuff/nixpkgs/config/tmux.nix +++ b/files/nix-stuff/nixpkgs/config/tmux.nix @@ -1,42 +1,54 @@ -{ myConf, pkgs ? import }: +{ config, lib, pkgs, ... }: +let + cfg = config.elkowar.programs.tmux; + myConf = import ../myConfig.nix; +in { - enable = true; - clock24 = true; - historyLimit = 10000; - keyMode = "vi"; - shortcut = "y"; - terminal = "tmux-256color"; - customPaneNavigationAndResize = true; - extraConfig = '' - bind v split-window -h -c "#{pane_current_oath}" - bind b split-window -v -c "#{pane_current_oath}" - bind c new-window -c "#{pane_current_path}" - unbind '"' - unbind % - set -g mouse on + options.elkowar.programs.tmux = { + enable = lib.mkEnableOption "Enable the tmux configuration"; + }; - bind-key -T copy-mode-vi v send-keys -X begin-selection - bind-key -T copy-mode-vi y send-keys -X copy-selection - bind-key -T copy-mode-vi r send-keys -X rectangle-toggle - unbind [ - bind < copy-mode - unbind p - bind > paste-buffer - bind-key C-a set -g status off - bind-key C-s set -g status on - bind -T copy-mode-vi MouseDragEnd1Pane send-keys -M -X copy-pipe 'xclip -in -selection clipboard' + config = lib.mkIf cfg.enable { + programs.tmux = { + enable = true; + clock24 = true; + historyLimit = 10000; + keyMode = "vi"; + shortcut = "y"; + terminal = "tmux-256color"; + customPaneNavigationAndResize = true; + extraConfig = '' + bind v split-window -h -c "#{pane_current_oath}" + bind b split-window -v -c "#{pane_current_oath}" + bind c new-window -c "#{pane_current_path}" + unbind '"' + unbind % + set -g mouse on - set-option -g visual-activity off - set-option -g visual-bell off - set-option -g visual-silence off - set-window-option -g monitor-activity off - set-option -g bell-action none - ''; + bind-key -T copy-mode-vi v send-keys -X begin-selection + bind-key -T copy-mode-vi y send-keys -X copy-selection + bind-key -T copy-mode-vi r send-keys -X rectangle-toggle + unbind [ + bind < copy-mode + unbind p + bind > paste-buffer + bind-key C-a set -g status off + bind-key C-s set -g status on + bind -T copy-mode-vi MouseDragEnd1Pane send-keys -M -X copy-pipe 'xclip -in -selection clipboard' - plugins = with pkgs.tmuxPlugins; [ - { - plugin = prefix-highlight; - } + set-option -g visual-activity off + set-option -g visual-bell off + set-option -g visual-silence off + set-window-option -g monitor-activity off + set-option -g bell-action none + ''; - ]; + plugins = with pkgs.tmuxPlugins; [ + { + plugin = prefix-highlight; + } + + ]; + }; + }; } diff --git a/files/nix-stuff/nixpkgs/config/zsh.nix b/files/nix-stuff/nixpkgs/config/zsh.nix index 4c9aa32..8531b76 100644 --- a/files/nix-stuff/nixpkgs/config/zsh.nix +++ b/files/nix-stuff/nixpkgs/config/zsh.nix @@ -1,5 +1,11 @@ -{ myConf, pkgs ? import }: +{ config, lib, pkgs, ... }: let + cfg = config.elkowar.programs.zsh; + myConf = import ../myConfig.nix; + + + + makeAbbrs = with builtins; abbrs: concatStringsSep "\n" ( attrValues @@ -96,31 +102,36 @@ let in { - enable = true; - - - enableAutosuggestions = true; - enableCompletion = true; - dotDir = ".config/zsh"; - #defaultKeymap = "viins"; - history = { - save = 10000; - share = false; - extended = true; - ignoreDups = true; - ignoreSpace = true; + options.elkowar.programs.zsh = { + enable = lib.mkEnableOption "ZSH configuration"; }; + config = { + programs.zsh = { + enable = true; - localVariables = { - #ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "bg=${myConf.colors.accentDark}"; # why does this not work D: - ZSH_AUTOSUGGEST_USE_ASYNC = 1; - }; - shellAliases = { - ls = "exa --icons"; - }; + enableAutosuggestions = true; + enableCompletion = true; + dotDir = ".config/zsh"; + #defaultKeymap = "viins"; + history = { + save = 10000; + share = false; + extended = true; + ignoreDups = true; + ignoreSpace = true; + }; - initExtraBeforeCompInit = '' + localVariables = { + #ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "bg=${myConf.colors.accentDark}"; # why does this not work D: + ZSH_AUTOSUGGEST_USE_ASYNC = 1; + }; + + shellAliases = { + ls = "exa --icons"; + }; + + initExtraBeforeCompInit = '' zstyle ':completion:*' menu select zstyle ':completion::complete:*' gain-privileges 1 @@ -131,44 +142,46 @@ in fpath+=( /usr/share/zsh/site-functions/ ) ''; - initExtra = '' - export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=2" +"set statusline=\ %t"' - export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"' + initExtra = '' + export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=2" +"set statusline=\ %t"' + export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"' - setopt nobeep + setopt nobeep - setopt HIST_IGNORE_ALL_DUPS - autoload -Uz colors && colors - autoload -Uz promptinit && promptinit + setopt HIST_IGNORE_ALL_DUPS + autoload -Uz colors && colors + autoload -Uz promptinit && promptinit - #_comp_options+=(globdots) + #_comp_options+=(globdots) - # enable cdr command - autoload -Uz chpwd_recent_dirs cdr add-zsh-hook - add-zsh-hook chpwd chpwd_recent_dirs + # enable cdr command + autoload -Uz chpwd_recent_dirs cdr add-zsh-hook + add-zsh-hook chpwd chpwd_recent_dirs - # deer is a ranger-style file manager directly in the shell that doesn't fully context-switch - #source ~/nixpkgs/config/deer.zsh - #zle -N deer - #bindkey '\ek' deer + # deer is a ranger-style file manager directly in the shell that doesn't fully context-switch + #source ~/nixpkgs/config/deer.zsh + #zle -N deer + #bindkey '\ek' deer - ${fzf-tab-stuff} - ${fixedKeybinds} - ${abbrs} - ${manFunction} + ${fzf-tab-stuff} + ${fixedKeybinds} + ${abbrs} + ${manFunction} - ${builtins.readFile ./prompt.zsh} - ''; + ${builtins.readFile ./prompt.zsh} + ''; - plugins = let - sources = import ./zsh/nix/sources.nix; - in - [ - { name = "fzf-tab"; src = sources.fzf-tab; } - { name = "zsh-autosuggestions"; src = sources.zsh-autosuggestions; } - { name = "history-substring-search"; src = sources.zsh-history-substring-search; } - { name = "zsh-abbr"; src = sources.zsh-abbr; } - { name = "fast-syntax-highlighting"; src = sources.fast-syntax-highlighting; } - ]; + plugins = let + sources = import ./zsh/nix/sources.nix; + in + [ + { name = "fzf-tab"; src = sources.fzf-tab; } + { name = "zsh-autosuggestions"; src = sources.zsh-autosuggestions; } + { name = "history-substring-search"; src = sources.zsh-history-substring-search; } + { name = "zsh-abbr"; src = sources.zsh-abbr; } + { name = "fast-syntax-highlighting"; src = sources.fast-syntax-highlighting; } + ]; + }; + }; } diff --git a/files/nix-stuff/nixpkgs/home.nix b/files/nix-stuff/nixpkgs/home.nix index eb9d002..f277c36 100644 --- a/files/nix-stuff/nixpkgs/home.nix +++ b/files/nix-stuff/nixpkgs/home.nix @@ -31,10 +31,6 @@ in desktop.enable = true; }; - gtk = import ./config/gtk.nix { inherit pkgs; inherit myConf; }; - - - imports = [ ./profiles/base.nix ./profiles/desktop.nix ]; } diff --git a/files/nix-stuff/nixpkgs/profiles/base.nix b/files/nix-stuff/nixpkgs/profiles/base.nix index 09455b6..d3f5ee7 100644 --- a/files/nix-stuff/nixpkgs/profiles/base.nix +++ b/files/nix-stuff/nixpkgs/profiles/base.nix @@ -10,7 +10,15 @@ in #useZsh = lib.mkEnableOption }; + imports = [ ../config/tmux.nix ../config/generalConfig.nix ../config/zsh.nix ]; + config = lib.mkIf cfg.enable { + elkowar.programs.tmux.enable = true; + elkowar.programs.zsh.enable = true; + elkowar.generalConfig.shellAliases = { + gc = "git commit"; + }; + home.packages = with pkgs; [ direnv rnix-lsp @@ -29,15 +37,13 @@ in fd jq - (import (fetchTarball https://github.com/lf-/nix-doc/archive/main.tar.gz) {}) + #(import (fetchTarball https://github.com/lf-/nix-doc/archive/main.tar.gz) {}) ]; programs = { home-manager.enable = true; htop.enable = true; - zsh = import ../config/zsh.nix { inherit pkgs; inherit myConf; }; - tmux = import ../config/tmux.nix { inherit pkgs; inherit myConf; }; fzf = { enable = true; enableFishIntegration = true; diff --git a/files/nix-stuff/nixpkgs/profiles/desktop.nix b/files/nix-stuff/nixpkgs/profiles/desktop.nix index a3e9236..7292a41 100644 --- a/files/nix-stuff/nixpkgs/profiles/desktop.nix +++ b/files/nix-stuff/nixpkgs/profiles/desktop.nix @@ -11,6 +11,8 @@ in config = lib.mkIf cfg.enable { + gtk = import ../config/gtk.nix { inherit pkgs; inherit myConf; }; + home.packages = with pkgs; [ elkowar_local.bashtop elkowar_local.liquidctl