trying this

This commit is contained in:
Bryan Ramos 2023-06-06 13:30:16 -04:00
parent 8374f7de3e
commit 8abda55ac9
10 changed files with 132 additions and 22 deletions

View file

@ -34,7 +34,7 @@
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.bryan = import ./homeConfig/home.nix; home-manager.users.bryan = import ./homeConfig/home.nix { inherit pkgs; };
} }
]; ];
}; };

View file

@ -1,8 +1,8 @@
{ pkgs, config, ... }: { pkgs, ... }:
{ {
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = ./modules/default.nix; imports = [ ./modules/default.nix ];
home.stateVersion = "22.11"; home.stateVersion = "22.11";
home.username = "bryan"; home.username = "bryan";

View file

@ -7,7 +7,7 @@ let
in in
{ options.modules.alacritty = { enable = mkEnableOption "alacritty"; }; { options.modules.alacritty = { enable = mkEnableOption "alacritty"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.alacritty = import ./config/alacritty.nix { inherit pkgs; }; programs.alacritty = import ./config/alacritty.nix { inherit pkgs lib; };
home.packages = with pkgs; [ home.packages = with pkgs; [
terminus-nerdfont terminus-nerdfont

View file

@ -1,9 +1,9 @@
{ config, ... }: { pkgs, ... }:
{ {
isDefault = true; isDefault = true;
search.default = "Startpage"; search.default = "Startpage";
extensions = with config.nur.repos.rycee.firefox-addons; [ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin ublock-origin
darkreader darkreader
keepassxc-browser keepassxc-browser

View file

@ -8,8 +8,8 @@ in
{ options.modules.browsers = { enable = mkEnableOption "browsers"; }; { options.modules.browsers = { enable = mkEnableOption "browsers"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.firefox = { programs.firefox = {
enabled = true; enable = true;
profiles.bryan = import config/bryan.nix { inherit config; }; profiles.bryan = import config/bryan.nix { inherit pkgs; };
}; };
home.packages = [ home.packages = [

View file

@ -2,7 +2,7 @@
enable = true; enable = true;
userName = "Bryan Ramos"; userName = "Bryan Ramos";
userEmail = "bryan@ramos.codes"; userEmail = "bryan@ramos.codes";
signingKey = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D"; signing.key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
extraConfig = { extraConfig = {
init = { defaultBranch = "main"; }; init = { defaultBranch = "main"; };

View file

@ -7,8 +7,8 @@ let
in in
{ options.modules.gui = { enable = mkEnableOption "gui"; }; { options.modules.gui = { enable = mkEnableOption "gui"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
wayland.windowmanager.sway = import ./config/sway.nix { inherit pkgs; }; wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
programs.rofi = import ./config/rofi.nix { inherit pkgs; }; programs.rofi = import ./config/rofi.nix { inherit pkgs lib; };
gtk = { gtk = {
enable = true; enable = true;

View file

@ -13,5 +13,114 @@ lua << EOF
vim.cmd([[ vim.cmd([[
au BufRead,BufNewFile *.purs set filetype=purescript au BufRead,BufNewFile *.purs set filetype=purescript
]]) ]])
require("config.lazy")
local lsp = require("lsp-zero").preset({})
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
lsp.setup_servers({
"tsserver",
"eslint",
"hls",
"pyright",
"nil_ls",
"cssls",
"html",
"jsonls",
"diagnosticls",
"lua_ls",
"marksman",
"purescriptls",
"tailwindcss",
"bashls",
})
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
lsp.setup()
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
},
})
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
cmp.setup({
enabled = function()
-- disable completion in comments
local context = require("cmp.config.context")
-- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == "c" then
return true
else
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
end
end,
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
["<CR>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
},
})
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
-- Disable virtual_text
virtual_text = false,
})
require("notify").setup({
background_colour = "#000000",
})
EOF EOF
'' ''

View file

@ -13,7 +13,7 @@ in
vimAlias = true; vimAlias = true;
extraLuaConfig = import ./config/init.nix; extraLuaConfig = import ./config/init.nix;
generatedConfigs = {lua = import ./config/config.nix;}; # generatedConfigs = {lua = import ./config/config.nix;};
plugins = import ./config/plugins.nix { inherit pkgs; }; plugins = import ./config/plugins.nix { inherit pkgs; };
extraPackages = import ./config/lsp.nix { inherit pkgs; }; extraPackages = import ./config/lsp.nix { inherit pkgs; };
}; };

View file

@ -5,6 +5,7 @@
# Nix # Nix
nix = { nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes"; extraOptions = "experimental-features = nix-command flakes";
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;