Compare commits
3 commits
ecf7796f1b
...
c472114b41
Author | SHA1 | Date | |
---|---|---|---|
c472114b41 | |||
c3a94b2ed9 | |||
d4c3b197fa |
2 changed files with 35 additions and 142 deletions
156
flake.nix
156
flake.nix
|
@ -25,19 +25,8 @@
|
||||||
url = "github:2kabhishek/nerdy.nvim";
|
url = "github:2kabhishek/nerdy.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# see :help nixCats.flake.inputs
|
|
||||||
# If you want your plugin to be loaded by the standard overlay,
|
|
||||||
# i.e. if it wasnt on nixpkgs, but doesnt have an extra build step.
|
|
||||||
# Then you should name it "plugins-something"
|
|
||||||
# If you wish to define a custom build step not handled by nixpkgs,
|
|
||||||
# then you should name it in a different format, and deal with that in the
|
|
||||||
# overlay defined for custom builds in the overlays directory.
|
|
||||||
# for specific tags, branches and commits, see:
|
|
||||||
# https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# see :help nixCats.flake.outputs
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
@ -47,51 +36,15 @@
|
||||||
inherit (nixCats) utils;
|
inherit (nixCats) utils;
|
||||||
luaPath = "${./.}";
|
luaPath = "${./.}";
|
||||||
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
|
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
|
||||||
# the following extra_pkg_config contains any values
|
|
||||||
# which you want to pass to the config set of nixpkgs
|
|
||||||
# import nixpkgs { config = extra_pkg_config; inherit system; }
|
# import nixpkgs { config = extra_pkg_config; inherit system; }
|
||||||
# will not apply to module imports
|
|
||||||
# as that will have your system values
|
|
||||||
extra_pkg_config = {
|
extra_pkg_config = {
|
||||||
# allowUnfree = true;
|
# allowUnfree = true;
|
||||||
};
|
};
|
||||||
# management of the system variable is one of the harder parts of using flakes.
|
dependencyOverlays = [
|
||||||
|
|
||||||
# so I have done it here in an interesting way to keep it out of the way.
|
|
||||||
# It gets resolved within the builder itself, and then passed to your
|
|
||||||
# categoryDefinitions and packageDefinitions.
|
|
||||||
|
|
||||||
# this allows you to use ${pkgs.system} whenever you want in those sections
|
|
||||||
# without fear.
|
|
||||||
|
|
||||||
# sometimes our overlays require a ${system} to access the overlay.
|
|
||||||
# Your dependencyOverlays can either be lists
|
|
||||||
# in a set of ${system}, or simply a list.
|
|
||||||
# the nixCats builder function will accept either.
|
|
||||||
# see :help nixCats.flake.outputs.overlays
|
|
||||||
dependencyOverlays =
|
|
||||||
/*
|
|
||||||
(import ./overlays inputs) ++
|
|
||||||
*/
|
|
||||||
[
|
|
||||||
# This overlay grabs all the inputs named in the format
|
|
||||||
# `plugins-<pluginName>`
|
|
||||||
# Once we add this overlay to our nixpkgs, we are able to
|
|
||||||
# use `pkgs.neovimPlugins`, which is a set of our plugins.
|
|
||||||
(utils.sanitizedPluginOverlay inputs)
|
(utils.sanitizedPluginOverlay inputs)
|
||||||
# add any other flake overlays here.
|
|
||||||
|
|
||||||
# when other people mess up their overlays by wrapping them with system,
|
|
||||||
# you may instead call this function on their overlay.
|
|
||||||
# it will check if it has the system in the set, and if so return the desired overlay
|
|
||||||
# (utils.fixSystemizedOverlay inputs.codeium.overlays
|
|
||||||
# (system: inputs.codeium.overlays.${system}.default)
|
|
||||||
# )
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# see :help nixCats.flake.outputs.categories
|
|
||||||
# and
|
|
||||||
# :help nixCats.flake.outputs.categoryDefinitions.scheme
|
|
||||||
categoryDefinitions = {
|
categoryDefinitions = {
|
||||||
pkgs,
|
pkgs,
|
||||||
settings,
|
settings,
|
||||||
|
@ -101,15 +54,6 @@
|
||||||
mkNvimPlugin,
|
mkNvimPlugin,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# to define and use a new category, simply add a new list to a set here,
|
|
||||||
# and later, you will include categoryname = true; in the set you
|
|
||||||
# provide when you build the package using this builder function.
|
|
||||||
# see :help nixCats.flake.outputs.packageDefinitions for info on that section.
|
|
||||||
|
|
||||||
# lspsAndRuntimeDeps:
|
|
||||||
# this section is for dependencies that should be available
|
|
||||||
# at RUN TIME for plugins. Will be available to PATH within neovim terminal
|
|
||||||
# this includes LSPs
|
|
||||||
lspsAndRuntimeDeps = with pkgs; let
|
lspsAndRuntimeDeps = with pkgs; let
|
||||||
npm-modules = (import ./packages/npm-modules) {
|
npm-modules = (import ./packages/npm-modules) {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
@ -155,6 +99,7 @@
|
||||||
sqlfluff
|
sqlfluff
|
||||||
stdenv.cc.cc
|
stdenv.cc.cc
|
||||||
stylelint
|
stylelint
|
||||||
|
stylelint-lsp
|
||||||
stylua
|
stylua
|
||||||
tailwindcss-language-server
|
tailwindcss-language-server
|
||||||
taplo
|
taplo
|
||||||
|
@ -169,9 +114,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: lazy doesnt care if these are in startupPlugins or optionalPlugins
|
|
||||||
# also you dont have to download everything via nix if you dont want.
|
|
||||||
# but you have the option, and that is demonstrated here.
|
|
||||||
startupPlugins = with pkgs.vimPlugins;
|
startupPlugins = with pkgs.vimPlugins;
|
||||||
with pkgs.neovimPlugins; {
|
with pkgs.neovimPlugins; {
|
||||||
general = [
|
general = [
|
||||||
|
@ -350,98 +292,50 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# not loaded automatically at startup.
|
|
||||||
# use with packadd and an autocommand in config to achieve lazy loading
|
|
||||||
# NOTE: this template is using lazy.nvim so, which list you put them in is irrelevant.
|
|
||||||
# startupPlugins or optionalPlugins, it doesnt matter, lazy.nvim does the loading.
|
|
||||||
# I just put them all in startupPlugins. I could have put them all in here instead.
|
|
||||||
optionalPlugins = {};
|
optionalPlugins = {};
|
||||||
|
|
||||||
# shared libraries to be added to LD_LIBRARY_PATH
|
# shared libraries to be added to LD_LIBRARY_PATH variable available to
|
||||||
# variable available to nvim runtime
|
# nvim runtime
|
||||||
sharedLibraries = {
|
sharedLibraries = {
|
||||||
# general = with pkgs; [
|
# general = with pkgs; [
|
||||||
# libgit2
|
# libgit2
|
||||||
# ];
|
# ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# environmentVariables:
|
|
||||||
# this section is for environmentVariables that should be available
|
|
||||||
# at RUN TIME for plugins. Will be available to path within neovim terminal
|
|
||||||
environmentVariables = {
|
environmentVariables = {
|
||||||
test = {
|
# test = {
|
||||||
CATTESTVAR = "It worked!";
|
# CATTESTVAR = "It worked!";
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
# If you know what these are, you can provide custom ones by category here.
|
|
||||||
# If you dont, check this link out:
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh
|
|
||||||
extraWrapperArgs = {
|
extraWrapperArgs = {
|
||||||
test = [
|
# test = [
|
||||||
''--set CATTESTVAR2 "It worked again!"''
|
# ''--set CATTESTVAR2 "It worked again!"''
|
||||||
];
|
# ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# lists of the functions you would have passed to
|
|
||||||
# python.withPackages or lua.withPackages
|
|
||||||
|
|
||||||
# get the path to this python environment
|
|
||||||
# in your lua config via
|
|
||||||
# vim.g.python3_host_prog
|
|
||||||
# or run from nvim terminal via :!<packagename>-python3
|
|
||||||
extraPython3Packages = {
|
extraPython3Packages = {
|
||||||
test = [(_: [])];
|
test = [(_: [])];
|
||||||
};
|
};
|
||||||
|
|
||||||
# populates $LUA_PATH and $LUA_CPATH
|
# populates $LUA_PATH and $LUA_CPATH
|
||||||
extraLuaPackages = {
|
extraLuaPackages = {
|
||||||
test = [(_: [])];
|
test = [(_: [])];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# And then build a package with specific categories from above here:
|
|
||||||
# All categories you wish to include must be marked true,
|
|
||||||
# but false may be omitted.
|
|
||||||
# This entire set is also passed to nixCats for querying within the lua.
|
|
||||||
|
|
||||||
# see :help nixCats.flake.outputs.packageDefinitions
|
|
||||||
packageDefinitions = {
|
packageDefinitions = {
|
||||||
# These are the names of your packages
|
|
||||||
# you can include as many as you wish.
|
|
||||||
nvim = {
|
nvim = {
|
||||||
pkgs,
|
pkgs,
|
||||||
mkNvimPlugin,
|
mkNvimPlugin,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# they contain a settings set defined above
|
|
||||||
# see :help nixCats.flake.outputs.settings
|
|
||||||
settings = {
|
settings = {
|
||||||
wrapRc = true;
|
wrapRc = true;
|
||||||
# IMPORTANT:
|
|
||||||
# your alias may not conflict with your other packages.
|
|
||||||
# aliases = [ "vim" ];
|
# aliases = [ "vim" ];
|
||||||
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
|
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
|
||||||
};
|
};
|
||||||
# and a set of categories that you want
|
|
||||||
# (and other information to pass to lua)
|
|
||||||
categories = {
|
|
||||||
general = true;
|
|
||||||
test = false;
|
|
||||||
};
|
|
||||||
extra = {};
|
|
||||||
};
|
|
||||||
# an extra test package with normal lua reload for fast edits
|
|
||||||
# nix doesnt provide the config in this package, allowing you free reign to edit it.
|
|
||||||
# then you can swap back to the normal pure package when done.
|
|
||||||
testnvim = {
|
|
||||||
pkgs,
|
|
||||||
mkNvimPlugin,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
settings = {
|
|
||||||
wrapRc = false;
|
|
||||||
unwrappedCfgPath = "/absolute/path/to/config";
|
|
||||||
};
|
|
||||||
categories = {
|
categories = {
|
||||||
general = true;
|
general = true;
|
||||||
test = false;
|
test = false;
|
||||||
|
@ -449,11 +343,9 @@
|
||||||
extra = {};
|
extra = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# In this section, the main thing you will need to do is change the default package name
|
|
||||||
# to the name of the packageDefinitions entry you wish to use as the default.
|
|
||||||
defaultPackageName = "nvim";
|
defaultPackageName = "nvim";
|
||||||
in
|
in
|
||||||
# see :help nixCats.flake.outputs.exports
|
|
||||||
forEachSystem (system: let
|
forEachSystem (system: let
|
||||||
# the builder function that makes it all work
|
# the builder function that makes it all work
|
||||||
nixCatsBuilder =
|
nixCatsBuilder =
|
||||||
|
@ -462,20 +354,13 @@
|
||||||
}
|
}
|
||||||
categoryDefinitions
|
categoryDefinitions
|
||||||
packageDefinitions;
|
packageDefinitions;
|
||||||
|
|
||||||
defaultPackage = nixCatsBuilder defaultPackageName;
|
defaultPackage = nixCatsBuilder defaultPackageName;
|
||||||
# this is just for using utils such as pkgs.mkShell
|
|
||||||
# The one used to build neovim is resolved inside the builder
|
|
||||||
# and is passed to our categoryDefinitions and packageDefinitions
|
|
||||||
pkgs = import nixpkgs {inherit system;};
|
pkgs = import nixpkgs {inherit system;};
|
||||||
in {
|
in {
|
||||||
# these outputs will be wrapped with ${system} by utils.eachSystem
|
|
||||||
|
|
||||||
# this will make a package out of each of the packageDefinitions defined above
|
|
||||||
# and set the default package to the one passed in here.
|
|
||||||
packages = utils.mkAllWithDefault defaultPackage;
|
packages = utils.mkAllWithDefault defaultPackage;
|
||||||
|
|
||||||
# choose your package for devShell
|
# Choose your package for devShell and add whatever else you want in it.
|
||||||
# and add whatever else you want in it.
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
name = defaultPackageName;
|
name = defaultPackageName;
|
||||||
|
@ -487,7 +372,8 @@
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
// (let
|
// (let
|
||||||
# we also export a nixos module to allow reconfiguration from configuration.nix
|
# We also export a nixos module to allow reconfiguration from
|
||||||
|
# configuration.nix.
|
||||||
nixosModule = utils.mkNixosModules {
|
nixosModule = utils.mkNixosModules {
|
||||||
moduleNamespace = [defaultPackageName];
|
moduleNamespace = [defaultPackageName];
|
||||||
inherit
|
inherit
|
||||||
|
@ -500,7 +386,7 @@
|
||||||
nixpkgs
|
nixpkgs
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
# and the same for home manager
|
# And the same for home manager.
|
||||||
homeModule = utils.mkHomeModules {
|
homeModule = utils.mkHomeModules {
|
||||||
moduleNamespace = [defaultPackageName];
|
moduleNamespace = [defaultPackageName];
|
||||||
inherit
|
inherit
|
||||||
|
@ -514,10 +400,6 @@
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
# these outputs will be NOT wrapped with ${system}
|
|
||||||
|
|
||||||
# this will make an overlay out of each of the packageDefinitions defined above
|
|
||||||
# and set the default overlay to the one named here.
|
|
||||||
overlays =
|
overlays =
|
||||||
utils.makeOverlays luaPath {
|
utils.makeOverlays luaPath {
|
||||||
inherit nixpkgs dependencyOverlays extra_pkg_config;
|
inherit nixpkgs dependencyOverlays extra_pkg_config;
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
|
-- For cssls.
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
|
cssls = {
|
||||||
|
capabilities = capabilities,
|
||||||
|
},
|
||||||
|
|
||||||
|
html = {
|
||||||
|
filetypes = { 'html', 'liquid' },
|
||||||
|
},
|
||||||
|
|
||||||
nil_ls = {
|
nil_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
['nil'] = {
|
['nil'] = {
|
||||||
|
@ -13,9 +25,8 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
html = {
|
|
||||||
filetypes = { 'html', 'liquid' },
|
stylelint_lsp = {},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue