From 5990c5d258640db49f973c3779759575ac0972d9 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Wed, 29 May 2024 23:34:10 -0700 Subject: [PATCH] cleanup --- home/modules/alacritty.nix | 1 + home/modules/default.nix | 1 + home/modules/fish.nix | 2 ++ home/modules/git.nix | 8 ++++++++ home/modules/neovim.nix | 12 +++++++++--- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/home/modules/alacritty.nix b/home/modules/alacritty.nix index 966317c..7a5c48e 100644 --- a/home/modules/alacritty.nix +++ b/home/modules/alacritty.nix @@ -1,4 +1,5 @@ { pkgs, lib, config, ... }: + let cfg = config.snowhawk.alacritty; in diff --git a/home/modules/default.nix b/home/modules/default.nix index 8b84cee..a2cbf6b 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -1,4 +1,5 @@ { lib, ... }: + { imports = [ ./neovim.nix diff --git a/home/modules/fish.nix b/home/modules/fish.nix index e259060..82e9514 100644 --- a/home/modules/fish.nix +++ b/home/modules/fish.nix @@ -1,4 +1,5 @@ { pkgs, inputs, config, lib, ... }: + let cfg = config.snowhawk.fish; in @@ -6,6 +7,7 @@ in options.snowhawk.fish = { enable = lib.mkEnableOption "fish"; }; + config = lib.mkIf cfg.enable { programs.bash = { enable = true; diff --git a/home/modules/git.nix b/home/modules/git.nix index 0c8d561..ed76f9d 100644 --- a/home/modules/git.nix +++ b/home/modules/git.nix @@ -1,4 +1,5 @@ { lib, config, ... }: + let cfg = config.snowhawk.git; in @@ -6,14 +7,17 @@ in options.snowhawk.git = { enable = lib.mkEnableOption "git"; }; + config = lib.mkIf cfg.enable { programs.git = { enable = true; userName = "Zynh Ludwig"; userEmail = "zynh0722@gmail.com"; + ignores = [ "Session.vim" ]; + aliases = { co = "checkout"; ci = "commit"; @@ -24,18 +28,22 @@ in dump = "cat-file -p"; graph = "log --graph --decorate --pretty=oneline --abbrev-commit"; }; + extraConfig = { init.defaultBranch = "main"; + core = { editor = "nvim"; autocrlf = "input"; safecrlf = true; }; + credential = { helper = [ "cache --timeout 7200" "oauth" ]; + "https://git.zynh.me" = { oauthClientId = "13d5b95d-565d-4264-8961-c45cc38eaa8a"; oauthScopes = "read_repository write_repository"; diff --git a/home/modules/neovim.nix b/home/modules/neovim.nix index e990592..ec2a939 100644 --- a/home/modules/neovim.nix +++ b/home/modules/neovim.nix @@ -1,10 +1,12 @@ { pkgs, lib, config, ... }: + let cfg = config.snowhawk.neovim; in { options.snowhawk.neovim = { enable = lib.mkEnableOption "neovim"; + package = lib.mkPackageOption pkgs "neovim" { default = [ "neovim-unwrapped" ]; }; @@ -33,6 +35,11 @@ in enable = true; coc.enable = false; package = cfg.package; + withNodeJs = true; + withPython3 = true; + withRuby = true; + + # TODO: nvim config nix import extraLuaConfig = '' -- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") @@ -41,18 +48,17 @@ in vim.opt.runtimepath:append ("${treesitter-parsers}") ''; + plugins = [ treesitterWithGrammars ]; + extraPackages = with pkgs; [ nil nixpkgs-fmt rustup lua-language-server ]; - withNodeJs = true; - withPython3 = true; - withRuby = true; }; }; }