From 48e49a93b6a911aa2ba9a8ce9c97b378f7f6a561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czy=C5=BC?= Date: Tue, 16 Apr 2024 22:15:44 +0200 Subject: [PATCH] partial modularization --- home-manager/features/cli/bash.nix | 4 ++ home-manager/features/cli/default.nix | 8 +++ home-manager/features/cli/git.nix | 26 +++++++ home-manager/features/cli/zsh.nix | 35 ++++++++++ home-manager/features/kitty.nix | 9 +++ home-manager/features/neovim.nix | 10 +++ home-manager/home.nix | 97 ++------------------------- 7 files changed, 97 insertions(+), 92 deletions(-) create mode 100644 home-manager/features/cli/bash.nix create mode 100644 home-manager/features/cli/default.nix create mode 100644 home-manager/features/cli/git.nix create mode 100644 home-manager/features/cli/zsh.nix create mode 100644 home-manager/features/kitty.nix create mode 100644 home-manager/features/neovim.nix diff --git a/home-manager/features/cli/bash.nix b/home-manager/features/cli/bash.nix new file mode 100644 index 0000000..e5d7825 --- /dev/null +++ b/home-manager/features/cli/bash.nix @@ -0,0 +1,4 @@ +programs.bash = { + enable = true; + shellAliases = myAliases; +}; diff --git a/home-manager/features/cli/default.nix b/home-manager/features/cli/default.nix new file mode 100644 index 0000000..beac002 --- /dev/null +++ b/home-manager/features/cli/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + imports = [ + ./bash.nix + ./git.nix + ./zsh.nix + ]; + # home.packages = with pkgs; []; +} diff --git a/home-manager/features/cli/git.nix b/home-manager/features/cli/git.nix new file mode 100644 index 0000000..e37c92a --- /dev/null +++ b/home-manager/features/cli/git.nix @@ -0,0 +1,26 @@ +programs.git = { + enable = true; + userName = "Michał Czyż"; + userEmail = "mike@c2yz.com"; + signing = { + key = "78D4829A477DAB25"; + signByDefault = true; + }; + extraConfig = { + push = { + default = "simple"; + }; + rerere = { + enable = true; + }; + column = { + ui = "auto"; + }; + branch = { + sort = "-committerdate"; + }; + init = { + defaultBranch = "main"; + }; + }; +}; diff --git a/home-manager/features/cli/zsh.nix b/home-manager/features/cli/zsh.nix new file mode 100644 index 0000000..575f335 --- /dev/null +++ b/home-manager/features/cli/zsh.nix @@ -0,0 +1,35 @@ +programs.zsh = { + enable = true; + enableCompletion = true; + + history.size = 10000000; + history.path = "${config.xdg.dataHome}/zsh/history"; + + shellAliases = myAliases; + + initExtra = '' + [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} + eval "$(zoxide init zsh)" + ''; + plugins = [ + { + name = "powerlevel10k"; + src = pkgs.zsh-powerlevel10k; + file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + } + ]; + + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + # { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + + oh-my-zsh = { + enable = true; + plugins = [ "git" ]; + }; + +}; diff --git a/home-manager/features/kitty.nix b/home-manager/features/kitty.nix new file mode 100644 index 0000000..3df0f47 --- /dev/null +++ b/home-manager/features/kitty.nix @@ -0,0 +1,9 @@ +programs.kitty = { + enable = true; + font = { + name = "FiraCode Nerd Font"; + size = 12; + }; + + theme = "Gruvbox Dark"; +}; diff --git a/home-manager/features/neovim.nix b/home-manager/features/neovim.nix new file mode 100644 index 0000000..e26f8f6 --- /dev/null +++ b/home-manager/features/neovim.nix @@ -0,0 +1,10 @@ +programs.neovim = { + enable = true; + package = pkgs.unstable.neovim-unwrapped; + + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + + defaultEditor = true; +}; diff --git a/home-manager/home.nix b/home-manager/home.nix index 28cd055..9fad36d 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -57,6 +57,9 @@ in { # You can also split up your configuration and import pieces of it here: # ./nvim.nix + ./features/cli + ./features/kitty.nix + ./features/neovim.nix ]; nixpkgs = { @@ -140,6 +143,7 @@ in { unzip gnome.gnome-keyring gnome.adwaita-icon-theme + R # > media < spotify @@ -152,7 +156,7 @@ in { discord telegram-desktop libreoffice-fresh - # vscodium + vscodium vscode neovide lunarvim @@ -182,97 +186,6 @@ in { EDITOR = "nvim"; }; - programs.kitty = { - enable = true; - font = { - name = "FiraCode Nerd Font"; - size = 12; - }; - - theme = "Gruvbox Dark"; - #Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha - # See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json - }; - - programs.neovim = { - enable = true; - package = pkgs.unstable.neovim-unwrapped; - - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - - defaultEditor = true; - }; - - programs.bash = { - enable = true; - shellAliases = myAliases; - }; - - programs.zsh = { - enable = true; - enableCompletion = true; - - history.size = 10000000; - history.path = "${config.xdg.dataHome}/zsh/history"; - - shellAliases = myAliases; - - initExtra = '' - [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} - eval "$(zoxide init zsh)" - ''; - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - ]; - - zplug = { - enable = true; - plugins = [ - { name = "zsh-users/zsh-autosuggestions"; } - # { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } - ]; - }; - - oh-my-zsh = { - enable = true; - plugins = [ "git" ]; - }; - - }; - - programs.git = { - enable = true; - userName = "Michał Czyż"; - userEmail = "mike@c2yz.com"; - signing = { - key = "78D4829A477DAB25"; - signByDefault = true; - }; - extraConfig = { - push = { - default = "simple"; - }; - rerere = { - enable = true; - }; - column = { - ui = "auto"; - }; - branch = { - sort = "-committerdate"; - }; - init = { - defaultBranch = "main"; - }; - }; - }; - # Let Home Manager install and manage itself. programs.home-manager.enable = true;