From a31c5a79b6a1aa3482ca39b52c0487be5faca903 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Sat, 3 Feb 2024 23:20:11 +1300 Subject: [PATCH] nixvim aditions --- flake.lock | 20 ++------- .../nvim/{keymappings.nix => keymapping.nix} | 2 +- .../console/editor/nvim/plugins/default.nix | 28 +++++++++++++ .../console/editor/nvim/plugins/indent.nix | 13 ++++++ .../console/editor/nvim/plugins/lualine.nix | 2 +- .../console/editor/nvim/plugins/telescope.nix | 41 +++++++++++++++++++ home/user/ooks/ookst480s/default.nix | 9 +++- 7 files changed, 95 insertions(+), 20 deletions(-) rename home/modules/console/editor/nvim/{keymappings.nix => keymapping.nix} (95%) create mode 100644 home/modules/console/editor/nvim/plugins/default.nix create mode 100644 home/modules/console/editor/nvim/plugins/telescope.nix diff --git a/flake.lock b/flake.lock index c0eacb4..05cef24 100644 --- a/flake.lock +++ b/flake.lock @@ -591,28 +591,14 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1706191920, - "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts_2", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_5", + "nixpkgs": [ + "nixpkgs" + ], "pre-commit-hooks": "pre-commit-hooks" }, "locked": { diff --git a/home/modules/console/editor/nvim/keymappings.nix b/home/modules/console/editor/nvim/keymapping.nix similarity index 95% rename from home/modules/console/editor/nvim/keymappings.nix rename to home/modules/console/editor/nvim/keymapping.nix index 0798e28..fd8e36c 100644 --- a/home/modules/console/editor/nvim/keymappings.nix +++ b/home/modules/console/editor/nvim/keymapping.nix @@ -1,7 +1,7 @@ { config, lib, ... }: let - cfg = config.desktop.console.editor.nvim; + cfg = config.homeModules.console.editor.nvim; in { diff --git a/home/modules/console/editor/nvim/plugins/default.nix b/home/modules/console/editor/nvim/plugins/default.nix new file mode 100644 index 0000000..6252beb --- /dev/null +++ b/home/modules/console/editor/nvim/plugins/default.nix @@ -0,0 +1,28 @@ +{ lib, ... }: + +{ + imports = [ + ./indent.nix + ./telescope.nix + ./lualine.nix + ]; + + options.homeModules.console.editor.nvim.plugins = { + indentBlankline = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable indent-blankline nvim plugin module"; + }; + lualine = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable lualine nvim plugin module"; + }; + telescope = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable telescope nvim plugin module"; + }; + }; + +} diff --git a/home/modules/console/editor/nvim/plugins/indent.nix b/home/modules/console/editor/nvim/plugins/indent.nix index e69de29..2530645 100644 --- a/home/modules/console/editor/nvim/plugins/indent.nix +++ b/home/modules/console/editor/nvim/plugins/indent.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: + +let + cfg = config.homeModules.console.editor.nvim.plugins; +in + +{ + config = lib.mkIf cfg.indentBlankline { + programs.nixvim.plugins.indent-blankline = { + enable = true; + }; + }; +} diff --git a/home/modules/console/editor/nvim/plugins/lualine.nix b/home/modules/console/editor/nvim/plugins/lualine.nix index 29de202..8dd26e6 100644 --- a/home/modules/console/editor/nvim/plugins/lualine.nix +++ b/home/modules/console/editor/nvim/plugins/lualine.nix @@ -5,7 +5,7 @@ let in { - config = lib.mkif cfg.lualine { + config = lib.mkIf cfg.lualine { programs.nixvim.plugins.lualine = { enable = true; theme = "base16"; diff --git a/home/modules/console/editor/nvim/plugins/telescope.nix b/home/modules/console/editor/nvim/plugins/telescope.nix new file mode 100644 index 0000000..16f82f0 --- /dev/null +++ b/home/modules/console/editor/nvim/plugins/telescope.nix @@ -0,0 +1,41 @@ +{ config, lib, ... }: + +let + cfg = config.homeModules.console.editor.nvim.plugins; +in + +{ + config = lib.mkIf cfg.telescope { + programs.nixvim = { + plugins.telescope = { + enable = true; + extensions = { + fzf-native.enable = true; + frecency.enable = true; + }; + + keymaps = { + "ff" = "find_files"; + "fg" = "live_grep"; + "b" = "buffers"; + "fh" = "help_tags"; + "fd" = "diagnostics"; + + "" = "git_files"; + "p" = "oldfiles"; + "" = "live_grep"; + }; + + keymapsSilent = true; + + defaults = { + file_ignore_patterns = [ + "^.git/" + "^data/" + ]; + set_env.COLORTERM = "truecolor"; + }; + }; + }; + }; +} diff --git a/home/user/ooks/ookst480s/default.nix b/home/user/ooks/ookst480s/default.nix index f65a45c..1993b10 100644 --- a/home/user/ooks/ookst480s/default.nix +++ b/home/user/ooks/ookst480s/default.nix @@ -7,7 +7,14 @@ activeProfiles = ["base" "hyprland"]; - homeModules.console.editor.nvim.enable = true; + homeModules.console.editor.nvim = { + enable = true; + plugins = { + lualine = true; + telescope = true; + indentBlankline = true; + }; + }; monitors = [{ name = "eDP-1";