[feat] Add goread module and config
This commit is contained in:
32
common/goread.nix
Normal file
32
common/goread.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ pkgs, ... }: {
|
||||
imports = [ ../modules/goread.nix ];
|
||||
programs.goread = {
|
||||
enable = true;
|
||||
config = {
|
||||
urls = {
|
||||
categories = [{
|
||||
name = "Rust";
|
||||
desc = "Stuff related to the rust programming language";
|
||||
subscriptions = [
|
||||
{
|
||||
name = "r/rust";
|
||||
desc = "The rust subreddit";
|
||||
url = "https://www.reddit.com/r/rust/.rss";
|
||||
}
|
||||
{
|
||||
name = "thesquareplanet";
|
||||
desc = "jonhoo's blog";
|
||||
url = "https://thesquareplanet.com/feed.xml";
|
||||
}
|
||||
{
|
||||
name = "Jon Gjengset's Youtube";
|
||||
desc = "jonhoo's youtube channel";
|
||||
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
|
||||
}
|
||||
];
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
./tmux.nix
|
||||
./wezterm.nix
|
||||
./nvim.nix
|
||||
./goread.nix
|
||||
] ++ lib.optionals device.isLinux [ ../linux ];
|
||||
|
||||
home.packages = with pkgs;
|
||||
@@ -11,7 +12,6 @@
|
||||
pandoc
|
||||
gnupg
|
||||
gpg-tui
|
||||
ngrok
|
||||
slack
|
||||
yarn
|
||||
spotify-player
|
||||
@@ -40,6 +40,7 @@
|
||||
nil
|
||||
pkg-config
|
||||
lua-language-server
|
||||
codelldb
|
||||
(nerdfonts.override { fonts = [ "Hasklig" ]; })
|
||||
pfetch-rs
|
||||
] ++ lib.optionals device.isLinux [
|
||||
@@ -67,18 +68,12 @@
|
||||
})
|
||||
usbutils
|
||||
handlr-regex
|
||||
handlr-xdg
|
||||
webcord-vencord
|
||||
spotify
|
||||
lsof
|
||||
wl-clipboard
|
||||
ncpamixer
|
||||
(pkgs.writeShellApplication {
|
||||
name = "xdg-open";
|
||||
runtimeInputs = [ handlr-regex ];
|
||||
text = ''
|
||||
handlr open "$@"
|
||||
'';
|
||||
})
|
||||
] ++ lib.optionals device.isMac [ ];
|
||||
|
||||
xdg.enable = true;
|
||||
@@ -171,9 +166,18 @@
|
||||
settings =
|
||||
let flavour = "mocha"; # Replace with your preferred palette
|
||||
in {
|
||||
# Other config here
|
||||
format = "$all"; # Remove this line to disable the default prompt format
|
||||
# Check https://starship.rs/config/#prompt
|
||||
format = "$all$character";
|
||||
palette = "catppuccin_${flavour}";
|
||||
character = {
|
||||
success_symbol = "[[OK](bold green) ❯](maroon)";
|
||||
error_symbol = "[❯](red)";
|
||||
vimcmd_symbol = "[❮](green)";
|
||||
};
|
||||
directory = {
|
||||
truncation_length = 4;
|
||||
style = "bold lavender";
|
||||
};
|
||||
} // builtins.fromTOML (builtins.readFile
|
||||
(pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml));
|
||||
};
|
||||
@@ -219,6 +223,18 @@
|
||||
if device.isMac then pkgs.pinentry_mac else pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
|
||||
# Only for checking markdown previews
|
||||
vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
shd101wyy.markdown-preview-enhanced
|
||||
asvetliakov.vscode-neovim
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
home-manager = { enable = true; };
|
||||
};
|
||||
|
||||
@@ -249,3 +265,4 @@
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
315
common/nvim.nix
315
common/nvim.nix
@@ -1,4 +1,4 @@
|
||||
{ pkgs, config, inputs, ... }: {
|
||||
{ pkgs, config, inputs, device, ... }: {
|
||||
imports = [ inputs.nixneovim.nixosModules.default ];
|
||||
programs.nixneovim = {
|
||||
enable = true;
|
||||
@@ -122,6 +122,7 @@
|
||||
mappings = {
|
||||
normal = {
|
||||
"<leader>ff" = "require'telescope.builtin'.find_files";
|
||||
"<leader>fb" = "require'telescope'.extensions.file_browser.file_browser";
|
||||
"<leader>gg" = "require'telescope.builtin'.live_grep";
|
||||
"<leader>;" = "require'telescope.builtin'.buffers";
|
||||
"<leader>o" = "[[<cmd>TroubleToggle<cr>]]";
|
||||
@@ -141,7 +142,7 @@
|
||||
"<C-w>%" = "[[<cmd>vsplit<cr>]]";
|
||||
|
||||
"<leader>bb" = "require'dap'.toggle_breakpoint";
|
||||
"<leader>dd" = "require'dapui'.toggle";
|
||||
"<leader>du" = "require'dapui'.toggle";
|
||||
"<leader>dr" = "[[<cmd>RustLsp debuggables<cr>]]";
|
||||
|
||||
"<C-l>" = "[[<cmd>Outline<cr>]]";
|
||||
@@ -202,153 +203,185 @@
|
||||
|
||||
pkgs.tree-sitter-grammars.tree-sitter-just
|
||||
|
||||
# Testing
|
||||
neotest
|
||||
# neotest-rust
|
||||
|
||||
];
|
||||
extraConfigLua = /* lua */ ''
|
||||
require('rest-nvim').setup()
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
initial_mode = 'insert',
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
}
|
||||
extraConfigLua =
|
||||
let
|
||||
codelldb = pkgs.codelldb;
|
||||
liblldb =
|
||||
if device.isLinux then
|
||||
"${codelldb}/lldb/lib/liblldb.so"
|
||||
else if device.isMac then
|
||||
"${codelldb}/lldb/lib/liblldb.dylib"
|
||||
else null
|
||||
;
|
||||
in
|
||||
/* lua */
|
||||
''
|
||||
require'neotest'.setup({
|
||||
adapters = {
|
||||
-- require('neotest-rust') {
|
||||
-- args = { "--no-capture" },
|
||||
-- }
|
||||
require('rustaceanvim.neotest'),
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require('telescope').load_extension("ui-select")
|
||||
require('telescope').load_extension("dap")
|
||||
require('telescope').load_extension("fzf")
|
||||
require('telescope').load_extension("file_browser")
|
||||
require('telescope').load_extension("rest")
|
||||
require('rest-nvim').setup()
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
initial_mode = 'insert',
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
enable_clippy = false,
|
||||
},
|
||||
server = {
|
||||
capabilities = require 'lsp-zero'.get_capabilities(),
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||
end
|
||||
end,
|
||||
},
|
||||
dap = {
|
||||
autoload_configurations = false
|
||||
},
|
||||
}
|
||||
require('telescope').load_extension("ui-select")
|
||||
require('telescope').load_extension("dap")
|
||||
require('telescope').load_extension("fzf")
|
||||
require('telescope').load_extension("file_browser")
|
||||
require('telescope').load_extension("rest")
|
||||
|
||||
require("copilot").setup({
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<C-l>",
|
||||
}
|
||||
},
|
||||
panel = { enabled = true },
|
||||
})
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
enable_clippy = false,
|
||||
},
|
||||
server = {
|
||||
capabilities = require 'lsp-zero'.get_capabilities(),
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||
end
|
||||
end,
|
||||
settings = function(project_root)
|
||||
local ra = require('rustaceanvim.config.server')
|
||||
return ra.load_rust_analyzer_settings(project_root, {
|
||||
settings_file_pattern = 'rust-analyzer.json'
|
||||
})
|
||||
end
|
||||
},
|
||||
dap = {
|
||||
autoload_configurations = false,
|
||||
adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${codelldb}/lldb/lib/liblldb.so")
|
||||
},
|
||||
}
|
||||
|
||||
require 'fidget'.setup()
|
||||
-- =======================================================================
|
||||
-- nvim-cmp
|
||||
-- =======================================================================
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
view = {
|
||||
entries = { name = 'custom', selection_order = 'near_cursor' }
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "copilot", },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'treesitter' },
|
||||
{ name = 'path' },
|
||||
{ name = 'git' },
|
||||
{ name = 'tmux' }
|
||||
}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm(),
|
||||
['<C-y>'] = cmp.mapping.complete(),
|
||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-n>'] = cmp.config.next,
|
||||
['<C-p>'] = cmp.config.prev,
|
||||
})
|
||||
})
|
||||
require("copilot").setup({
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<C-l>",
|
||||
}
|
||||
},
|
||||
panel = { enabled = true },
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline {
|
||||
-- ['<C-n>'] = cmp.config.disable,
|
||||
-- ['<C-p>'] = cmp.config.disable,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline {
|
||||
-- ['<C-n>'] = cmp.config.disable,
|
||||
-- ['<C-p>'] = cmp.config.disable,
|
||||
},
|
||||
-- mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require('crates').setup()
|
||||
require('outline').setup()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = false, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = true, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
require 'fidget'.setup()
|
||||
-- =======================================================================
|
||||
-- nvim-cmp
|
||||
-- =======================================================================
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
view = {
|
||||
entries = { name = 'custom', selection_order = 'near_cursor' }
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "copilot", },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'treesitter' },
|
||||
{ name = 'path' },
|
||||
{ name = 'git' },
|
||||
{ name = 'tmux' }
|
||||
}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm(),
|
||||
['<C-y>'] = cmp.mapping.complete(),
|
||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-n>'] = cmp.config.next,
|
||||
['<C-p>'] = cmp.config.prev,
|
||||
})
|
||||
})
|
||||
|
||||
require 'FTerm'.setup({
|
||||
border = 'double',
|
||||
dimensions = {
|
||||
height = 0.95,
|
||||
width = 0.95,
|
||||
},
|
||||
cmd = "fish",
|
||||
blend = 10,
|
||||
})
|
||||
'';
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline {
|
||||
-- ['<C-n>'] = cmp.config.disable,
|
||||
-- ['<C-p>'] = cmp.config.disable,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline {
|
||||
-- ['<C-n>'] = cmp.config.disable,
|
||||
-- ['<C-p>'] = cmp.config.disable,
|
||||
},
|
||||
-- mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require('crates').setup()
|
||||
require('outline').setup()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = false, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = true, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
|
||||
require 'FTerm'.setup({
|
||||
border = 'double',
|
||||
dimensions = {
|
||||
height = 0.95,
|
||||
width = 0.95,
|
||||
},
|
||||
cmd = "fish",
|
||||
blend = 10,
|
||||
})
|
||||
'';
|
||||
# builtins.readFile ./extraConfig.lua;
|
||||
package = pkgs.neovim-nightly;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user