From 6a297b12620020d74bb6f2449d6ca062e0f6b4f0 Mon Sep 17 00:00:00 2001 From: YouSiki Date: Fri, 16 Feb 2024 09:53:21 +0800 Subject: [PATCH] Add shell configurations via Home-manager --- src/darwinConfigurations/sakamoto/default.nix | 1 + src/homeProfiles/shell.nix | 196 ++++++++++++++++++ src/homeProfiles/stylix.nix | 9 +- 3 files changed, 203 insertions(+), 3 deletions(-) create mode 100644 src/homeProfiles/shell.nix diff --git a/src/darwinConfigurations/sakamoto/default.nix b/src/darwinConfigurations/sakamoto/default.nix index 0c061a0..3723d3a 100644 --- a/src/darwinConfigurations/sakamoto/default.nix +++ b/src/darwinConfigurations/sakamoto/default.nix @@ -20,6 +20,7 @@ imports = with homeProfiles; [ base lang.complete + shell stylix ]; }; diff --git a/src/homeProfiles/shell.nix b/src/homeProfiles/shell.nix new file mode 100644 index 0000000..a9410e7 --- /dev/null +++ b/src/homeProfiles/shell.nix @@ -0,0 +1,196 @@ +# Shell configurations via Home-manager. +{globals, ...}: { + config, + lib, + pkgs, + ... +}: +with builtins // lib; { + programs = { + # bash + bash = { + enable = true; + enableCompletion = true; + }; + + # bat + bat = { + enable = true; + extraPackages = with pkgs.bat-extras; [ + batdiff + batgrep + batman + batpipe + batwatch + prettybat + ]; + }; + + # bottom + bottom = { + enable = true; + }; + + # btop + btop = { + enable = true; + }; + + # eza (exa) + eza = { + enable = true; + enableAliases = true; + icons = true; + git = true; + }; + + # fzf + fzf = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + tmux.enableShellIntegration = true; + }; + + # gh (github-cli) + gh = { + enable = true; + gitCredentialHelper.enable = true; + extensions = with pkgs; [ + gh-actions-cache + gh-cal + gh-dash + gh-eco + gh-markdown-preview + ]; + }; + + # git + git = { + enable = true; + lfs.enable = true; + delta.enable = true; + userName = "yousiki"; + userEmail = "you.siki@outlook.com"; + extraConfig = { + pull.rebase = false; + push.followTags = true; + }; + }; + + # gitui + gitui = { + enable = true; + }; + + # helix (hx) + helix = { + enable = true; + languages = { + # the language-server option currently requires helix from the master branch at https://github.com/helix-editor/helix/ + language-server.typescript-language-server = with pkgs.nodePackages; { + command = "''${typescript-language-server}/bin/typescript-language-server"; + args = ["--stdio" "--tsserver-path=''${typescript}/lib/node_modules/typescript/lib"]; + }; + language = + map + (name: { + name = name; + auto-format = true; + }) ["rust" "python" "nix"]; + }; + settings = { + editor = { + line-number = "relative"; + lsp.display-messages = true; + }; + }; + }; + + # mcfly + mcfly = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + fuzzySearchFactor = 3; + }; + + # starship + starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + enableIonIntegration = true; + enableNushellIntegration = true; + enableTransience = true; + }; + + # tmux + tmux = { + enable = true; + }; + + # zellij + zellij = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + + # zoxide + zoxide = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + enableNushellIntegration = true; + }; + + # zsh + zsh = { + enable = true; + enableCompletion = true; + autocd = true; + enableAutosuggestions = true; + historySubstringSearch.enable = true; + syntaxHighlighting.enable = true; + oh-my-zsh = { + enable = true; + theme = "robbyrussell"; + plugins = [ + "copyfile" + "copypath" + "docker" + "fzf" + "git" + "gitignore" + "history" + "python" + "rust" + "thefuck" + "zsh-interactive-cd" + ]; + }; + initExtra = '' + bindkey "\e[1;3D" backward-word # ⌥← + bindkey "\e[1;3C" forward-word # ⌥→ + ''; + }; + }; + + home.packages = with pkgs; [ + cachix + du-dust + fd + gdu + home-manager + mc + rclone + rsync + statix + thefuck + ]; +} diff --git a/src/homeProfiles/stylix.nix b/src/homeProfiles/stylix.nix index 9a4420b..3864ffd 100644 --- a/src/homeProfiles/stylix.nix +++ b/src/homeProfiles/stylix.nix @@ -1,4 +1,4 @@ -# Basic configurations for Home-manager. +# Stylix configuration via Home-manager. {globals, ...}: { config, lib, @@ -10,6 +10,9 @@ with builtins // lib; { globals.inputs.stylix.homeManagerModules.stylix ]; - stylix.image = "${globals.root}/static/images/AyanamiRei_2.png"; - stylix.base16Scheme = "${globals.inputs.schemes}/base16/catppuccin-mocha.yaml"; + stylix = { + image = "${globals.root}/static/images/AyanamiRei_2.png"; + + base16Scheme = "${globals.inputs.schemes}/base16/catppuccin-mocha.yaml"; + }; }