From 92689e0687144fb75b28cb4680faca87735874f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Sun, 18 Jun 2023 14:55:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(neodymium/home)=20split?= =?UTF-8?q?=20shell=20configs=20into=20seperate=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/neodymium/home/shell/atuin.nix | 7 ++ hosts/neodymium/home/shell/bat.nix | 23 ++++++ hosts/neodymium/home/shell/default.nix | 106 +------------------------ hosts/neodymium/home/shell/direnv.nix | 7 ++ hosts/neodymium/home/shell/exa.nix | 8 ++ hosts/neodymium/home/shell/git.nix | 13 +++ hosts/neodymium/home/shell/zsh.nix | 37 +++++++++ 7 files changed, 98 insertions(+), 103 deletions(-) create mode 100644 hosts/neodymium/home/shell/atuin.nix create mode 100644 hosts/neodymium/home/shell/bat.nix create mode 100644 hosts/neodymium/home/shell/direnv.nix create mode 100644 hosts/neodymium/home/shell/exa.nix create mode 100644 hosts/neodymium/home/shell/git.nix create mode 100644 hosts/neodymium/home/shell/zsh.nix diff --git a/hosts/neodymium/home/shell/atuin.nix b/hosts/neodymium/home/shell/atuin.nix new file mode 100644 index 0000000..0f5b659 --- /dev/null +++ b/hosts/neodymium/home/shell/atuin.nix @@ -0,0 +1,7 @@ +{ ... }: { + programs.atuin = { + enable = true; + enableZshIntegration = true; + settings = { sync_address = "https://atuin.fainsin.bzh"; }; + }; +} diff --git a/hosts/neodymium/home/shell/bat.nix b/hosts/neodymium/home/shell/bat.nix new file mode 100644 index 0000000..729e5f5 --- /dev/null +++ b/hosts/neodymium/home/shell/bat.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +let + catppuccin-bat = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; + sha256 = "1g2r6j33f4zys853i1c5gnwcdbwb6xv5w6pazfdslxf69904lrg9"; + }; +in { + programs.bat = { + enable = true; + themes = { + catppuccin = + builtins.readFile "${catppuccin-bat}/Catppuccin-mocha.tmTheme"; + }; + config.theme = "catppuccin"; + extraPackages = with pkgs.bat-extras; [ batman ]; + }; + programs.zsh.shellAliases = { + cat = "bat"; + man = "batman"; + }; +} diff --git a/hosts/neodymium/home/shell/default.nix b/hosts/neodymium/home/shell/default.nix index 8c4989a..2b4558e 100644 --- a/hosts/neodymium/home/shell/default.nix +++ b/hosts/neodymium/home/shell/default.nix @@ -1,104 +1,4 @@ -{ pkgs, lib, ... }: -let - catppuccin-bat = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; - sha256 = "1g2r6j33f4zys853i1c5gnwcdbwb6xv5w6pazfdslxf69904lrg9"; - }; -in { - - programs.bat = { - enable = true; - themes = { - catppuccin = - builtins.readFile "${catppuccin-bat}/Catppuccin-mocha.tmTheme"; - }; - config.theme = "catppuccin"; - extraPackages = with pkgs.bat-extras; [ batman ]; - }; - programs.zsh.shellAliases = { - cat = "bat"; - man = "batman"; - }; - - programs.exa = { enable = true; }; - programs.zsh.shellAliases = { - l = - "exa -lahg --icons --git --time-style=long-iso --group-directories-first --color=always"; - ll = "l --grid"; - }; - - programs.git = { - enable = true; - lfs.enable = true; - userName = "Laureηt"; - userEmail = "laurent@fainsin.bzh"; - signing = { - signByDefault = true; - key = - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvwXCT99s1EwOCeGQ28jyCAH/RBoLZza9k5I7wWdEu laurent@neodymium"; - }; - }; - - programs.direnv = { - enable = true; - enableZshIntegration = true; - nix-direnv.enable = true; - }; - - programs.atuin = { - enable = true; - enableZshIntegration = true; - settings = { sync_address = "https://atuin.fainsin.bzh"; }; - }; - - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableSyntaxHighlighting = true; - enableCompletion = true; - sessionVariables = { - VISUAL = "micro"; - EDITOR = "micro"; - WORDCHARS = "*?_-.[]~=&;!#$%^(){}<>"; - }; - history = { - size = 1000000000; - path = "$HOME/.zsh_history"; - extended = true; - }; - initExtra = '' - bindkey -e - bindkey "^[[1;5C" forward-word - bindkey "^[[1;5D" backward-word - bindkey "^[[1;3C" forward-word - bindkey "^[[1;3D" backward-word - bindkey '^H' backward-kill-word - bindkey '5~' kill-word - ''; - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - { - name = "powerlevel10k-config"; - src = lib.cleanSource ./.; - file = ".p10k.zsh"; - } - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "227d284ab2dc2f5153826974e0094a1990b1b5b9"; - sha256 = "11mkq58ssafvkq8sq27v0dl19mi2myi392nhxgi1q2q9q0gazcaa"; - }; - } - ]; - }; - +{ ... }: { + imports = + [ ./atuin.nix ./bat.nix ./direnv.nix ./exa.nix ./git.nix ./zsh.nix ]; } diff --git a/hosts/neodymium/home/shell/direnv.nix b/hosts/neodymium/home/shell/direnv.nix new file mode 100644 index 0000000..355dcf7 --- /dev/null +++ b/hosts/neodymium/home/shell/direnv.nix @@ -0,0 +1,7 @@ +{ ... }: { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; +} diff --git a/hosts/neodymium/home/shell/exa.nix b/hosts/neodymium/home/shell/exa.nix new file mode 100644 index 0000000..9b1e6c9 --- /dev/null +++ b/hosts/neodymium/home/shell/exa.nix @@ -0,0 +1,8 @@ +{ ... }: { + programs.exa.enable = true; + programs.zsh.shellAliases = { + l = + "exa -lahg --icons --git --time-style=long-iso --group-directories-first --color=always"; + ll = "l --grid"; + }; +} diff --git a/hosts/neodymium/home/shell/git.nix b/hosts/neodymium/home/shell/git.nix new file mode 100644 index 0000000..f85a8c7 --- /dev/null +++ b/hosts/neodymium/home/shell/git.nix @@ -0,0 +1,13 @@ +{ ... }: { + programs.git = { + enable = true; + lfs.enable = true; + userName = "Laureηt"; + userEmail = "laurent@fainsin.bzh"; + signing = { + signByDefault = true; + key = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTvwXCT99s1EwOCeGQ28jyCAH/RBoLZza9k5I7wWdEu laurent@neodymium"; + }; + }; +} diff --git a/hosts/neodymium/home/shell/zsh.nix b/hosts/neodymium/home/shell/zsh.nix new file mode 100644 index 0000000..d6f73af --- /dev/null +++ b/hosts/neodymium/home/shell/zsh.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: { + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableSyntaxHighlighting = true; + enableCompletion = true; + sessionVariables = { + VISUAL = "micro"; + EDITOR = "micro"; + WORDCHARS = "*?_-.[]~=&;!#$%^(){}<>"; + }; + history = { + size = 1000000000; + path = "$HOME/.zsh_history"; + extended = true; + }; + initExtra = '' + bindkey -e + bindkey "^[[1;5C" forward-word + bindkey "^[[1;5D" backward-word + bindkey "^[[1;3C" forward-word + bindkey "^[[1;3D" backward-word + bindkey '^H' backward-kill-word + bindkey '5~' kill-word + ''; + plugins = [{ + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "227d284ab2dc2f5153826974e0094a1990b1b5b9"; + sha256 = "11mkq58ssafvkq8sq27v0dl19mi2myi392nhxgi1q2q9q0gazcaa"; + }; + }]; + }; +}