From b764efaafc9cf85eabb6aea5222fc8d9f4a8eaf2 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Thu, 10 Oct 2024 14:42:44 +0200 Subject: [PATCH] telescope --- home.nix | 692 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 352 insertions(+), 340 deletions(-) diff --git a/home.nix b/home.nix index c23be31..c9f215b 100644 --- a/home.nix +++ b/home.nix @@ -1,369 +1,381 @@ { config, pkgs, ... }: { - home.username = "fredrikr"; - home.homeDirectory = "/home/fredrikr"; + home.username = "fredrikr"; + home.homeDirectory = "/home/fredrikr"; - home.stateVersion = "24.05"; # Please read the comment before changing. + home.stateVersion = "24.05"; # Please read the comment before changing. - home.packages = with pkgs; [ - htop - dmenu - alacritty - # discord - # firefox - scrot - brightnessctl - zathura - python3 - sage - quickemu - maven - vscode-fhs - anki-bin - tldr - ]; + home.packages = with pkgs; [ + htop + dmenu + alacritty +# discord +# firefox + scrot + brightnessctl + zathura + python3 + sage + quickemu + maven + vscode-fhs + anki-bin + tldr + ripgrep + ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; +# Home Manager is pretty good at managing dotfiles. The primary way to manage +# plain files is through 'home.file'. + home.file = { +# # Building this configuration will create a copy of 'dotfiles/screenrc' in +# # the Nix store. Activating the configuration will then make '~/.screenrc' a +# # symlink to the Nix store copy. +# ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - home.sessionVariables = { - EDITOR = "nvim"; - }; - - programs.home-manager.enable = true; - - programs.nixvim = { - enable = true; - defaultEditor = true; - - keymaps = [ - { - key = "jk"; - action = ""; - mode = [ "i" ]; - options = { - noremap = true; - }; - } - - { - key = "pv"; - action = ":Ex"; - mode = [ "n" ]; - } - - { - key = "n"; - action = "nzzzv"; - mode = [ "n" ]; - } - - { - key = "N"; - action = "Nzzzv"; - mode = [ "n" ]; - } - - { - key = "u"; - action = ":UndotreeToggle"; - mode = [ "n" ]; - } - ]; - - colorschemes.nord = { - enable = true; - settings = { - disable_background = true; - }; +# # You can also set the file content immediately. +# ".gradle/gradle.properties".text = '' +# org.gradle.console=verbose +# org.gradle.daemon.idletimeout=3600000 +# ''; }; - viAlias = true; - vimAlias = true; - - globals = { - mapleader = " "; + home.sessionVariables = { + EDITOR = "nvim"; }; - opts = { - termguicolors = true; + programs.home-manager.enable = true; - number = true; - - tabstop = 4; - softtabstop = 4; - shiftwidth = 4; - expandtab = true; - smartindent = true; - - swapfile = false; - backup = false; - undofile = true; - - hlsearch = false; - incsearch = true; - - scrolloff = 8; - - signcolumn = "yes"; - - updatetime = 50; - - colorcolumn = "80"; - - ignorecase = true; - smartcase = true; - }; - - plugins = { - coq-nvim.enable = true; - - cmp = { + programs.nixvim = { enable = true; - settings = { - autoEnableSources = true; - experimental = {ghost_text = true;}; - performance = { - debounce = 60; - fetchingTimeout = 200; - maxViewEntries = 30; - }; - snippet = {expand = "luasnip";}; - formatting = {fields = ["kind" "abbr" "menu"];}; - sources = [ - {name = "git";} - {name = "nvim_lsp";} - {name = "emoji";} - { - name = "buffer"; # text within current buffer - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - keywordLength = 3; - } - { - name = "path"; # file system paths - keywordLength = 3; - } - { - name = "luasnip"; # snippets - keywordLength = 3; - } - ]; + defaultEditor = true; - window = { - completion = { - winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; - scrollbar = false; - sidePadding = 0; - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + keymaps = [ + { + key = "jk"; + action = ""; + mode = [ "i" ]; + options = { + noremap = true; }; - - settings.documentation = { - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; - winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; - }; - }; + } - mapping = { - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; - }; + { + key = "pv"; + action = ":Ex"; + mode = [ "n" ]; + } + + { + key = "n"; + action = "nzzzv"; + mode = [ "n" ]; + } + + { + key = "N"; + action = "Nzzzv"; + mode = [ "n" ]; + } + + { + key = "u"; + action = ":UndotreeToggle"; + mode = [ "n" ]; + } + ]; + + colorschemes.nord = { + enable = true; + settings = { + disable_background = true; + }; }; - }; - cmp-nvim-lsp = {enable = true;}; # lsp - cmp-buffer = {enable = true;}; - cmp-path = {enable = true;}; # file system paths - cmp_luasnip = {enable = true;}; # snippets - cmp-cmdline = {enable = true;}; # autocomplete for cmdline + viAlias = true; + vimAlias = true; - - lsp = { + globals = { + mapleader = " "; + }; + + opts = { + termguicolors = true; + + number = true; + + tabstop = 4; + softtabstop = 4; + shiftwidth = 4; + expandtab = true; + smartindent = true; + + swapfile = false; + backup = false; + undofile = true; + + hlsearch = false; + incsearch = true; + + scrolloff = 8; + + signcolumn = "yes"; + + updatetime = 50; + + colorcolumn = "80"; + + ignorecase = true; + smartcase = true; + }; + + plugins = { + coq-nvim.enable = true; + + cmp = { + enable = true; + settings = { + autoEnableSources = true; + experimental = {ghost_text = true;}; + performance = { + debounce = 60; + fetchingTimeout = 200; + maxViewEntries = 30; + }; + snippet = {expand = "luasnip";}; + formatting = {fields = ["kind" "abbr" "menu"];}; + sources = [ + {name = "git";} + {name = "nvim_lsp";} + {name = "emoji";} + { + name = "buffer"; # text within current buffer + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + keywordLength = 3; + } + { + name = "path"; # file system paths + keywordLength = 3; + } + { + name = "luasnip"; # snippets + keywordLength = 3; + } + ]; + + window = { + completion = { + winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + scrollbar = false; + sidePadding = 0; + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + }; + + settings.documentation = { + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + }; + }; + + mapping = { + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.abort()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; + }; + }; + }; + + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = true;}; # autocomplete for cmdline + + + lsp = { + enable = true; + keymaps = { + silent = true; + diagnostic = { + "j" = "goto_next"; + "k" = "goto_prev"; + "e" = "open_float"; + }; + lspBuf = { + gd = { + action = "definition"; + desc = "Goto Definition"; + }; + gr = { + action = "references"; + desc = "Goto References"; + }; + gD = { + action = "declaration"; + desc = "Goto Declaration"; + }; + gI = { + action = "implementation"; + desc = "Goto Implementation"; + }; + gT = { + action = "type_definition"; + desc = "Type Definition"; + }; + K = { + action = "hover"; + desc = "Hover"; + }; + "cw" = { + action = "workspace_symbol"; + desc = "Workspace Symbol"; + }; + "cr" = { + action = "rename"; + desc = "Rename"; + }; + "ca" = { + action = "code_action"; + desc = "code action"; + }; + }; + }; + servers = { + pylsp.enable = true; + nil-ls.enable = true; + lua-ls.enable = true; + hls.enable = true; + }; + }; + + friendly-snippets.enable = true; + luasnip.enable = true; + + harpoon = { + enable = true; + keymaps = { + navFile = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + }; + addFile = "ha"; + toggleQuickMenu = "hl"; + }; + }; + + treesitter.enable = true; + + undotree.enable = true; + + comment.enable = true; + surround.enable = true; + + presence-nvim.enable = true; + + which-key.enable = true; + + nvim-jdtls = { + enable = true; + data = "/home/fredrikr/.cache/jdtls/workspace"; + }; + + telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "fg" = "live_grep"; + "fb" = "buffers"; + "fh" = "help_tags"; + }; + }; + }; + extraConfigLua = '' + luasnip = require("luasnip") + + kind_icons = { + Text = "󰊄", + Method = "", + Function = "󰡱", + Constructor = "", + Field = "", + Variable = "󱀍", + Class = "", + Interface = "", + Module = "󰕳", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } + ''; + }; + + programs.zsh = { enable = true; - keymaps = { - silent = true; - diagnostic = { - "j" = "goto_next"; - "k" = "goto_prev"; - "e" = "open_float"; - }; - lspBuf = { - gd = { - action = "definition"; - desc = "Goto Definition"; - }; - gr = { - action = "references"; - desc = "Goto References"; - }; - gD = { - action = "declaration"; - desc = "Goto Declaration"; - }; - gI = { - action = "implementation"; - desc = "Goto Implementation"; - }; - gT = { - action = "type_definition"; - desc = "Type Definition"; - }; - K = { - action = "hover"; - desc = "Hover"; - }; - "cw" = { - action = "workspace_symbol"; - desc = "Workspace Symbol"; - }; - "cr" = { - action = "rename"; - desc = "Rename"; - }; - "ca" = { - action = "code_action"; - desc = "code action"; - }; - }; - }; - servers = { - pylsp.enable = true; - nil-ls.enable = true; - lua-ls.enable = true; - hls.enable = true; - }; - }; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + autocd = true; - friendly-snippets.enable = true; - luasnip.enable = true; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; - harpoon = { + oh-my-zsh = { + enable = true; + plugins = [ "git" "shrink-path" ]; + theme = "arrow"; + }; + + shellAliases = { + hibernate = "systemctl hibernate"; + suspend = "systemctl suspend"; + logout = "sudo pkill -u fredrikr"; + lock = "/home/fredrikr/.logout.sh"; + }; + + defaultKeymap = "viins"; + initExtra = '' + bindkey -v + bindkey -M viins 'jk' vi-cmd-mode + ''; + + zsh-abbr.enable = true; + }; + + programs.git = { enable = true; - keymaps = { - navFile = { - "1" = ""; - "2" = ""; - "3" = ""; - "4" = ""; - }; - addFile = "ha"; - toggleQuickMenu = "hl"; - }; - }; - - treesitter.enable = true; - - undotree.enable = true; - - comment.enable = true; - surround.enable = true; - - presence-nvim.enable = true; - - which-key.enable = true; - - nvim-jdtls = { - enable = true; - data = "/home/fredrikr/.cache/jdtls/workspace"; - }; - - }; - extraConfigLua = '' - luasnip = require("luasnip") - - kind_icons = { - Text = "󰊄", - Method = "", - Function = "󰡱", - Constructor = "", - Field = "", - Variable = "󱀍", - Class = "", - Interface = "", - Module = "󰕳", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - } - ''; - }; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - autocd = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; + userName = "fredrikr79"; + userEmail = "fredrikrobertsen7@gmail.com"; }; - oh-my-zsh = { - enable = true; - plugins = [ "git" "shrink-path" ]; - theme = "arrow"; + programs.java = { + enable = true; + package = (pkgs.jdk21.override { enableJavaFX = true; }); +# package = pkgs.jdk21; }; - shellAliases = { - hibernate = "systemctl hibernate"; - suspend = "systemctl suspend"; - logout = "sudo pkill -u fredrikr"; - lock = "/home/fredrikr/.logout.sh"; - }; - defaultKeymap = "viins"; - initExtra = '' - bindkey -v - bindkey -M viins 'jk' vi-cmd-mode - ''; - - zsh-abbr.enable = true; - }; - - programs.git = { - enable = true; - userName = "fredrikr79"; - userEmail = "fredrikrobertsen7@gmail.com"; - }; - - programs.java = { - enable = true; - package = (pkgs.jdk21.override { enableJavaFX = true; }); - # package = pkgs.jdk21; - }; }