diff --git a/hosts/atlas/default.nix b/hosts/atlas/default.nix index 0a626fd..03d688b 100644 --- a/hosts/atlas/default.nix +++ b/hosts/atlas/default.nix @@ -45,9 +45,6 @@ repoPath = "ssh://uzu2y5b1@uzu2y5b1.repo.borgbase.com/./repo"; }; }; - shell = { - zsh.enable = true; - }; }; system.stateVersion = "22.11"; diff --git a/hosts/eos/default.nix b/hosts/eos/default.nix index 37c3f03..c870818 100644 --- a/hosts/eos/default.nix +++ b/hosts/eos/default.nix @@ -33,9 +33,6 @@ pass.enable = true; qbittorrent.enable = true; }; - shell = { - zsh.enable = true; - }; }; system.stateVersion = "22.11"; diff --git a/hosts/helios/default.nix b/hosts/helios/default.nix index a27e97b..364ccc5 100644 --- a/hosts/helios/default.nix +++ b/hosts/helios/default.nix @@ -43,9 +43,6 @@ repoPath = "ssh://b9cjl9hq@b9cjl9hq.repo.borgbase.com/./repo"; }; }; - shell = { - zsh.enable = true; - }; }; system.stateVersion = "22.11"; diff --git a/hosts/hypnos/default.nix b/hosts/hypnos/default.nix index ad0e308..066f307 100644 --- a/hosts/hypnos/default.nix +++ b/hosts/hypnos/default.nix @@ -59,9 +59,6 @@ audio.enable = true; }; }; - shell = { - zsh.enable = true; - }; }; system.stateVersion = "22.11"; diff --git a/hosts/library/default.nix b/hosts/library/default.nix index 09faf2c..d79c0ca 100644 --- a/hosts/library/default.nix +++ b/hosts/library/default.nix @@ -185,9 +185,6 @@ programs = { gpg.enable = true; }; - shell = { - zsh.enable = true; - }; services = { borgmatic = { enable = true; diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index 308e723..b44f244 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -95,9 +95,6 @@ repoPath = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo"; }; }; - shell = { - zsh.enable = true; - }; system.desktop.gnome.enable = lib.mkForce false; system.desktop.hyprland.enable = true; }; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 91b4191..513c4f6 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -19,6 +19,5 @@ ./programs/thunderbird.nix ./programs/vscode.nix ./programs/zoom.nix - ./shell/zsh ]; } diff --git a/modules/home-manager/shell/zsh/default.nix b/modules/home-manager/shell/zsh/default.nix deleted file mode 100644 index d7a9ebd..0000000 --- a/modules/home-manager/shell/zsh/default.nix +++ /dev/null @@ -1,193 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - cfg = config.modules.shell.zsh; -in -{ - options.modules.shell.zsh = { - enable = lib.mkOption { - default = false; - example = true; - }; - }; - - config = lib.mkIf cfg.enable { - users.defaultUserShell = pkgs.zsh; - - home.programs = { - zsh = { - enable = true; - autocd = true; - autosuggestion = { - enable = true; - strategy = [ "completion" ]; - }; - defaultKeymap = "viins"; - dotDir = ".config/zsh"; - enableCompletion = true; - enableVteIntegration = true; - - history = { - append = true; - extended = true; - ignoreAllDups = true; - ignoreDups = true; - ignoreSpace = true; - save = 1000000; - size = 1000000; - }; - - initExtra = '' - ## Colors - autoload -U colors && colors - - ## Directories - setopt AUTO_PUSHD - setopt CDABLE_VARS - setopt PUSHD_IGNORE_DUPS - setopt PUSHD_SILENT - setopt PUSHD_TO_HOME - - ## Expansion and globbing - setopt EXTENDED_GLOB - unsetopt GLOB_DOTS - unsetopt NOMATCH - - ## History - setopt BANG_HIST - setopt HIST_VERIFY - setopt INC_APPEND_HISTORY_TIME - - ## I/O - setopt INTERACTIVE_COMMENTS - setopt MULTIOS - unsetopt CLOBBER - - ## Jobs - setopt LONG_LIST_JOBS - setopt AUTO_RESUME - unsetopt BG_NICE - unsetopt NOTIFY - unsetopt HUP - unsetopt CHECK_JOBS - - ## Shell emulation - setopt APPEND_CREATE - - ## Prompt - PS1="%B%{$fg[magenta]%}%~%{$reset_color%} $%b " - - ## Vi mode - export KEYTIMEOUT=1 - - ## Zsh line editor - unsetopt BEEP - ''; - - initExtraBeforeCompInit = '' - setopt HASH_LIST_ALL - ''; - - localVariables = { - # Prevent zsh-vi-mode overriding other keybinds - ZVM_INIT_MODE = "sourcing"; - }; - - plugins = with pkgs; [ - { - name = "zsh-vi-mode"; - src = zsh-vi-mode; - file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; - } - { - name = "fast-syntax-highlighting"; - src = zsh-fast-syntax-highlighting; - file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh"; - } - { - name = "jq-zsh-plugin"; - src = jq-zsh-plugin; - file = "share/jq-zsh-plugin/jq.plugin.zsh"; - } - { - name = "zsh-autopair"; - src = zsh-autopair; - file = "share/zsh/zsh-autopair/autopair.zsh"; - } - { - name = "zsh-forgit"; - src = zsh-forgit; - file = "share/zsh/zsh-forgit/forgit.plugin.zsh"; - } - { - name = "zsh-fzf-tab"; - src = zsh-fzf-tab; - file = "share/fzf-tab/fzf-tab.plugin.zsh"; - } - ]; - - sessionVariables = { - MODE_INDICATOR = ""; - MODE_CURSOR_VIINS = "#b77ee0 blinking bar"; - MODE_CURSOR_REPLACE = "$MODE_CURSOR_VIINS #ff3334"; - MODE_CURSOR_VICMD = "#b77ee0 block"; - MODE_CURSOR_SEARCH = "#e7c547 steady underline"; - MODE_CURSOR_VISUAL = "$MODE_CURSOR_VICMD steady bar"; - MODE_CURSOR_VLINE = "$MODE_CURSOR_VISUAL #54ced6"; - ZVM_LINE_INIT_MODE = "i"; - }; - - shellAliases = { - # Verbose file operations - cp = "cp -iv"; - mv = "mv -iv"; - rm = "rm -v"; - mkdir = "mkdir -v"; - - # Colorize commands - ls = "ls -h --color=auto --group-directories-first"; - - # Abbreviations - e = "$EDITOR"; - f = "$FILE"; - g = "git"; - m = "neomutt"; - n = "$FILE"; - v = "$EDITOR"; - }; - }; - - broot.enable = true; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - fzf = { - enable = true; - enableZshIntegration = true; - package = pkgs.unstable.fzf; - }; - - mcfly.enable = true; - navi.enable = true; - nix-index.enable = true; - }; - - user.packages = with pkgs; [ - bat - btop - fd - jq - nix-zsh-completions - nnn - ripgrep - ]; - }; -} diff --git a/users/jordan/default.nix b/users/jordan/default.nix new file mode 100644 index 0000000..38fb121 --- /dev/null +++ b/users/jordan/default.nix @@ -0,0 +1,41 @@ +{ + config, + pkgs, + self, + ... +}: +let + name = "jordan"; +in +{ + age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age"; + + users.users.${name} = { + description = "Jordan Holt"; + extraGroups = [ + "audio" + "docker" + "lxd" + "networkmanager" + "wheel" + ]; + group = "users"; + hashedPasswordFile = config.age.secrets."passwords/users/jordan".path; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com" + ]; + shell = pkgs.zsh; + uid = 1000; + }; + + home-manager.users.${name} = { + imports = [ + ./shell.nix + ]; + + home = { + username = name; + }; + }; +} diff --git a/users/jordan/shell.nix b/users/jordan/shell.nix new file mode 100644 index 0000000..5e51ae7 --- /dev/null +++ b/users/jordan/shell.nix @@ -0,0 +1,176 @@ +{ + pkgs, + ... +}: + +{ + home.programs = { + zsh = { + enable = true; + autocd = true; + autosuggestion = { + enable = true; + strategy = [ "completion" ]; + }; + defaultKeymap = "viins"; + dotDir = ".config/zsh"; + enableCompletion = true; + enableVteIntegration = true; + + history = { + append = true; + extended = true; + ignoreAllDups = true; + ignoreDups = true; + ignoreSpace = true; + save = 1000000; + size = 1000000; + }; + + initExtra = '' + ## Colors + autoload -U colors && colors + + ## Directories + setopt AUTO_PUSHD + setopt CDABLE_VARS + setopt PUSHD_IGNORE_DUPS + setopt PUSHD_SILENT + setopt PUSHD_TO_HOME + + ## Expansion and globbing + setopt EXTENDED_GLOB + unsetopt GLOB_DOTS + unsetopt NOMATCH + + ## History + setopt BANG_HIST + setopt HIST_VERIFY + setopt INC_APPEND_HISTORY_TIME + + ## I/O + setopt INTERACTIVE_COMMENTS + setopt MULTIOS + unsetopt CLOBBER + + ## Jobs + setopt LONG_LIST_JOBS + setopt AUTO_RESUME + unsetopt BG_NICE + unsetopt NOTIFY + unsetopt HUP + unsetopt CHECK_JOBS + + ## Shell emulation + setopt APPEND_CREATE + + ## Prompt + PS1="%B%{$fg[magenta]%}%~%{$reset_color%} $%b " + + ## Vi mode + export KEYTIMEOUT=1 + + ## Zsh line editor + unsetopt BEEP + ''; + + initExtraBeforeCompInit = '' + setopt HASH_LIST_ALL + ''; + + localVariables = { + # Prevent zsh-vi-mode overriding other keybinds + ZVM_INIT_MODE = "sourcing"; + }; + + plugins = with pkgs; [ + { + name = "zsh-vi-mode"; + src = zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"; + } + { + name = "fast-syntax-highlighting"; + src = zsh-fast-syntax-highlighting; + file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh"; + } + { + name = "jq-zsh-plugin"; + src = jq-zsh-plugin; + file = "share/jq-zsh-plugin/jq.plugin.zsh"; + } + { + name = "zsh-autopair"; + src = zsh-autopair; + file = "share/zsh/zsh-autopair/autopair.zsh"; + } + { + name = "zsh-forgit"; + src = zsh-forgit; + file = "share/zsh/zsh-forgit/forgit.plugin.zsh"; + } + { + name = "zsh-fzf-tab"; + src = zsh-fzf-tab; + file = "share/fzf-tab/fzf-tab.plugin.zsh"; + } + ]; + + sessionVariables = { + MODE_INDICATOR = ""; + MODE_CURSOR_VIINS = "#b77ee0 blinking bar"; + MODE_CURSOR_REPLACE = "$MODE_CURSOR_VIINS #ff3334"; + MODE_CURSOR_VICMD = "#b77ee0 block"; + MODE_CURSOR_SEARCH = "#e7c547 steady underline"; + MODE_CURSOR_VISUAL = "$MODE_CURSOR_VICMD steady bar"; + MODE_CURSOR_VLINE = "$MODE_CURSOR_VISUAL #54ced6"; + ZVM_LINE_INIT_MODE = "i"; + }; + + shellAliases = { + # Verbose file operations + cp = "cp -iv"; + mv = "mv -iv"; + rm = "rm -v"; + mkdir = "mkdir -v"; + + # Colorize commands + ls = "ls -h --color=auto --group-directories-first"; + + # Abbreviations + e = "$EDITOR"; + f = "$FILE"; + g = "git"; + m = "neomutt"; + n = "$FILE"; + v = "$EDITOR"; + }; + }; + broot.enable = true; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + fzf = { + enable = true; + enableZshIntegration = true; + package = pkgs.unstable.fzf; + }; + + mcfly.enable = true; + navi.enable = true; + nix-index.enable = true; + }; + + home.packages = with pkgs; [ + bat + btop + fd + jq + nix-zsh-completions + nnn + ripgrep + ]; +}