From 7b79203f54853733d4fae88943829d0e24e6e49f Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 7 Jan 2024 12:00:08 -0500 Subject: massive overhaul --- modules/shell/default.nix | 3 --- modules/shell/git.nix | 20 ++++++++++++++++ modules/shell/zsh.nix | 56 +++++++++++++++++++++++++++++++++++++++++++ modules/shell/zsh/default.nix | 32 ------------------------- 4 files changed, 76 insertions(+), 35 deletions(-) delete mode 100644 modules/shell/default.nix create mode 100644 modules/shell/git.nix create mode 100644 modules/shell/zsh.nix delete mode 100644 modules/shell/zsh/default.nix (limited to 'modules/shell') diff --git a/modules/shell/default.nix b/modules/shell/default.nix deleted file mode 100644 index 03028ee..0000000 --- a/modules/shell/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -[ - ./zsh -] diff --git a/modules/shell/git.nix b/modules/shell/git.nix new file mode 100644 index 0000000..d0835f5 --- /dev/null +++ b/modules/shell/git.nix @@ -0,0 +1,20 @@ +{ + config, + options, + lib, + pkgs, + ... +}: let + gitConfig = config.modules.shell.git; +in { + options.modules.shell.git = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; + }; + + config = lib.mkIf (gitConfig.enable) { + programs.git.enable = true; + }; +} diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix new file mode 100644 index 0000000..c39ec7a --- /dev/null +++ b/modules/shell/zsh.nix @@ -0,0 +1,56 @@ +{ + config, + options, + lib, + pkgs, + ... +}: let + zshConfig = config.modules.shell.zsh; +in { + options.modules.shell.zsh = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; + }; + + config = lib.mkIf (zshConfig.enable) { + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + environment.sessionVariables.SHELL = "${pkgs.zsh}/bin/zsh"; + environment.pathsToLink = ["/share/zsh"]; + + home.packages = [ + pkgs.zsh-autocomplete + pkgs.pure-prompt + + pkgs.wget + pkgs.curl + + pkgs.htop + pkgs.btop + ]; + + home.manager.programs = { + direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + autocd = true; + defaultKeymap = "viins"; + dotDir = ".config/zsh"; + + history = { + size = 10000; + ignoreDups = true; + }; + }; + }; + }; +} diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix deleted file mode 100644 index 471bc57..0000000 --- a/modules/shell/zsh/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, pkgs, user, ... }: -{ - config = { - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - }; - - config.home-manager.users.${user} = { - home.packages = with pkgs; [ - inotify-tools - ]; - - programs.zsh = { - enable = true; - shellAliases = { - ll = "ls -l"; - unixos = "sudo nixos-rebuild switch --flake /etc/nixos"; - }; - history = { - size = 10000; - ignoreDups = true; - }; - - oh-my-zsh = { - enable = true; - plugins = [ "git" "thefuck" "pass" ]; - theme = "dst"; - }; - syntaxHighlighting.enable = true; - }; - }; -} -- cgit v1.2.1