Skip to content

Commit

Permalink
Added nixfmt formatter and added it to conform (auto formatter)
Browse files Browse the repository at this point in the history
Added options to nil lsp setup in lua config

Added neovim plugin file for telescope
  • Loading branch information
jwyuen committed Oct 29, 2024
1 parent 82673c6 commit 095de70
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 43 deletions.
80 changes: 45 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,53 @@
};
};

outputs = inputs@{ nixpkgs, home-manager, lanzaboote, ... }:
let
system = "x86_64-linux";
host = "nix-deskstar";
inherit (import ./nix-config/hosts/${host}/options.nix) username hostname;
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
outputs =
inputs@{
nixpkgs,
home-manager,
lanzaboote,
...
}:
let
system = "x86_64-linux";
host = "nix-deskstar";
inherit (import ./nix-config/hosts/${host}/options.nix) username hostname;
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
};
in {
nixosConfigurations = {
# default config
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit system; inherit inputs;
inherit username; inherit hostname;
inherit host;
in
{
nixosConfigurations = {
# default config
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit system;
inherit inputs;
inherit username;
inherit hostname;
inherit host;
};
modules = [
./system.nix
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
inherit host;
inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = import ./home.nix;
}
];
};
modules = [
./system.nix
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
inherit host;
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = import ./home.nix;
}
];
};
};
};
}
13 changes: 7 additions & 6 deletions nix-config/home/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
yaml-language-server
# formatters
beautysh
nixfmt-rfc-style
stylelint
stylua
];
Expand All @@ -47,21 +48,21 @@
# large colletion of code snippets (use w/ snippet plugin like luasnip)
friendly-snippets
# fast git decorations - can integrate with vim-fugitive and trouble.nvim
gitsigns-nvim
gitsigns-nvim
# vertical guide lines for indentation levels
indent-blankline-nvim
# configures lua LSP for editing neovim config by lazily updating workspace libs
lazydev-nvim
# adds vscode-like pictograms to neovim built-in lsp
lspkind-nvim
# renders lsp diagnostic info using virtual lines on top of real code
lsp_lines-nvim
lsp_lines-nvim
# fast status line
lualine-nvim
# snippet engine
luasnip
# replaces UI for messages, cmdline, and popupmenu
noice-nvim
noice-nvim
# dep for noice-nvim
nui-nvim
# completion
Expand Down Expand Up @@ -93,7 +94,7 @@
# async display colors in a file (e.g. show what color a hex or rgb code is)
vim-hexokinase
# support for writing nix expressions in vim
vim-nix
vim-nix
# file manager
mini-files
# auto pairs like parentheses, etc.
Expand All @@ -105,8 +106,7 @@
# check keybinds easily
which-key-nvim
];
extraConfig = ''
'';
extraConfig = '''';
extraLuaConfig = ''
${builtins.readFile ./nvim/keymaps.lua}
${builtins.readFile ./nvim/options.lua}
Expand All @@ -115,6 +115,7 @@
${builtins.readFile ./nvim/plugins/lsp.lua}
${builtins.readFile ./nvim/plugins/lualine.lua}
${builtins.readFile ./nvim/plugins/misc.lua}
${builtins.readFile ./nvim/plugins/telescope.lua}
vim.diagnostic.config({
virtual_text = false,
})
Expand Down
1 change: 1 addition & 0 deletions nix-config/home/nvim/plugins/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require("conform").setup({
javascriptreact = { "biome", "prettier", stop_after_first = true },
json = { "biome" },
lua = { "stylua" },
nix = { "nixfmt" },
typescript = { "biome", "prettier", stop_after_first = true },
typescriptreact = { "biome", "prettier", stop_after_first = true },
},
Expand Down
13 changes: 11 additions & 2 deletions nix-config/home/nvim/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ local lspconfig = require("lspconfig")
require("lspconfig").bashls.setup({})
require("lspconfig").biome.setup({})
require("lspconfig").marksman.setup({})
require("lspconfig").nil_ls.setup({})
require("lspconfig").nil_ls.setup({
autostart = true,
capabilities = caps,
settings = {
["nil"] = {
nix = {
autoEvalInputs = true,
},
},
},
})
require("lspconfig").stylelint_lsp.setup({})
-- require("lspconfig").pyright.setup({})
require("lspconfig").ts_ls.setup({})
require("lspconfig").yamlls.setup({})
12 changes: 12 additions & 0 deletions nix-config/home/nvim/plugins/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require("telescope").setup({
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"
-- the default case_mode is "smart_case"
},
},
})
require("telescope").load_extension("fzf")

0 comments on commit 095de70

Please sign in to comment.