feat(nvim): make stylelintplus packages and make them work

This commit is contained in:
matt1432 2023-10-26 16:33:40 -04:00
parent 43cd8574f6
commit d75328ab8b
6 changed files with 94 additions and 20 deletions

View file

@ -17,7 +17,6 @@ in
org.gradle.java.home = ${pkgs.temurin-bin-17} org.gradle.java.home = ${pkgs.temurin-bin-17}
''; '';
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
gradle gradle
gradle-completion # FIXME: not working gradle-completion # FIXME: not working
@ -32,10 +31,14 @@ in
neovim = { neovim = {
enable = true; enable = true;
package = pkgs.neovim-nightly;
withNodeJs = true;
withPython3 = true;
withRuby = false;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
package = pkgs.neovim-nightly;
extraConfig = with lib.strings; '' extraConfig = with lib.strings; ''
${fileContents ./config/base.vim} ${fileContents ./config/base.vim}
@ -45,7 +48,6 @@ in
${fileContents ./config/config.lua} ${fileContents ./config/config.lua}
''; '';
withNodeJs = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
nodejs_latest nodejs_latest
nodePackages.npm nodePackages.npm
@ -54,7 +56,7 @@ in
bat bat
stylelint stylelint-lsp
nil nil
]; ];
extraPython3Packages = with pkgs.python311Packages; [ extraPython3Packages = with pkgs.python311Packages; [
@ -64,18 +66,26 @@ in
coc = { coc = {
enable = true; enable = true;
settings = { settings = {
# General
"colors.enable" = true; "colors.enable" = true;
"coc.preferences.formatOnType" = true; "coc.preferences.formatOnType" = true;
"inlayHint.enable" = false; "inlayHint.enable" = false;
# Eslint
"eslint.format.enable" = true; "eslint.format.enable" = true;
"eslint.autoFixOnSave" = true; "eslint.autoFixOnSave" = true;
# Stylelint FIXME: not working
"stylelintplus.enable" = true;
"stylelintplus.cssInJs" = true;
"stylelintplus.autoFixOnSave" = true;
"stylelintplus.autoFixOnFormat" = true; "stylelintplus.autoFixOnFormat" = true;
"css.validate" = false; "css.validate" = false;
"less.validate" = false; "less.validate" = false;
"scss.validate" = false; "scss.validate" = false;
"wxss.validate" = false; "wxss.validate" = false;
# Lua lsp
"Lua.misc.parameters" = [ "Lua.misc.parameters" = [
"--metapath" "--metapath"
"~/.cache/sumneko_lua/meta" "~/.cache/sumneko_lua/meta"
@ -90,8 +100,7 @@ in
enableNvimLuaDev = true; enableNvimLuaDev = true;
}; };
"java.jdt.ls.java.home" = "${pkgs.temurin-bin-17}"; # Nix
"bashIde.shellcheckPath" = "${pkgs.shellcheck}/bin/shellcheck";
languageserver = { languageserver = {
nix = { nix = {
command = "nil"; command = "nil";
@ -99,6 +108,10 @@ in
rootPatterns = [ "flake.nix" ]; rootPatterns = [ "flake.nix" ];
}; };
}; };
# Misc
"java.jdt.ls.java.home" = "${pkgs.temurin-bin-17}";
"bashIde.shellcheckPath" = "${pkgs.shellcheck}/bin/shellcheck";
}; };
}; };
@ -107,7 +120,11 @@ in
coc-java coc-java
coc-css coc-css
# Lua
coc-sumneko-lua coc-sumneko-lua
neodev-nvim
coc-highlight coc-highlight
coc-json coc-json
coc-pyright coc-pyright
@ -119,11 +136,7 @@ in
coc-markdownlint coc-markdownlint
coc-tsserver coc-tsserver
coc-eslint coc-eslint
(plugin "bmatcuk" coc-stylelintplus
"coc-stylelintplus"
"4854bfdc0cb6f92e39b5afb3b90d60b411ecb9e4"
"sha256-PgcQc3JecfHE4oNcydyOqsKdRbh4yPhXPugVQDGSRuI=")
neodev-nvim
coc-fzf coc-fzf
fzfWrapper fzfWrapper

View file

@ -11,6 +11,16 @@
(import ./blueberry.nix) (import ./blueberry.nix)
(import ./vencord.nix) (import ./vencord.nix)
(final: prev: {
vimPlugins = prev.vimPlugins.extend (final': prev': {
coc-stylelintplus = prev.callPackage ./pkgs/coc-stylelintplus.nix {};
});
})
(final: prev: {
stylelint-lsp = final.callPackage ./pkgs/stylelint-lsp.nix {};
})
(final: prev: { (final: prev: {
spotifywm = final.callPackage ./pkgs/spotifywm.nix {}; spotifywm = final.callPackage ./pkgs/spotifywm.nix {};
}) })

View file

@ -0,0 +1,28 @@
{ vimUtils
, buildNpmPackage
, fetchFromGitHub
}: let
buildVimPlugin = vimUtils.buildVimPlugin;
name = "coc-stylelintplus";
rev = "7945d0c2a26da13b7d1aa6e0681ddac088b22d3b";
nodePkg = buildNpmPackage {
name = name;
src = fetchFromGitHub {
owner = "matt1432";
repo = name;
rev = rev;
hash = "sha256-tdNE0taHuvZ7Gg9RXz5TWKB/ujpGO1tMzWHIj3O9vOw=";
};
npmDepsHash = "sha256-r9JdzGjdf36vyRQeGDt0ZttF/PSCQBYfn472EiSpEXg=";
dontNpmBuild = true;
makeCacheWritable = true;
};
in
buildVimPlugin {
pname = name;
version = rev;
src = "${nodePkg}/lib/node_modules/${name}";
}

View file

@ -0,0 +1,21 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
}:
buildNpmPackage rec {
name = "stylelint-lsp";
pname = "stylelint-lsp";
src = fetchFromGitHub {
owner = "matt1432";
repo = pname;
rev = "279a4a5c53e79b7f7cbb6bdf60cca5ed8135c0a2";
hash = "sha256-myQ2jr+XY/fKuT2NE29OZd4uJZlfWFGbxnUr1SUZEW0=";
};
npmDepsHash = "sha256-P8S6EO//6daUYKQ3GTZDmwah7KD0+mRyhy2ruFERx0I=";
dontNpmBuild = true;
makeCacheWritable = true;
}

View file

@ -40,6 +40,7 @@
scrollbar, scrollbar * { scrollbar, scrollbar * {
all: unset; all: unset;
} }
scrollbar.vertical { scrollbar.vertical {
transition: 200ms; transition: 200ms;
background-color: rgba(23, 23, 23, 0.3); background-color: rgba(23, 23, 23, 0.3);
@ -52,6 +53,7 @@
min-width: .6em; min-width: .6em;
} }
} }
slider { slider {
background-color: rgba(238, 238, 238, 0.5); background-color: rgba(238, 238, 238, 0.5);
border-radius: 9px; border-radius: 9px;

View file

@ -2,49 +2,49 @@
background-color: $bg; background-color: $bg;
color: $fg; color: $fg;
border-radius: 30px; border-radius: 30px;
border-top-right-radius: 0px; border-top-right-radius: 0;
border: 2px solid $contrastbg; border: 2px solid $contrastbg;
} }
.timebox { .timebox {
margin: 30px 0px; margin: 30px 0;
.time-container { .time-container {
.content { .content {
font-family: Product Sans;
font-weight: bolder; font-weight: bolder;
font-size: 60px; font-size: 60px;
} }
.divider { .divider {
margin: 8px 15px; margin: 8px 15px;
padding: 0px 1px; padding: 0 1px;
background: linear-gradient($red, $magenta, $blue, $cyan); background: linear-gradient($red, $magenta, $blue, $cyan);
} }
} }
.date-container { .date-container {
font-family: Product Sans;
margin-top: 2px; margin-top: 2px;
} }
} }
.cal-box { .cal-box {
font-family: Product Sans;
border-radius: 30px; border-radius: 30px;
padding: 0 1rem .2rem; padding: 0 1rem .2rem;
color: $fg; color: $fg;
background-color: $bgfull; background-color: $bgfull;
border-bottom: 2px solid $contrastbg; border-bottom: 2px solid $contrastbg;
border-top: 2px solid $contrastbg; border-top: 2px solid $contrastbg;
margin: 0px 12px 18px 12px; margin: 0 12px 18px;
.cal { .cal {
font-size: 20px; font-size: 20px;
background-color: inherit; background-color: inherit;
padding: .5rem .10rem 0rem; padding: .5rem .10rem 0;
margin-left: 10px; margin-left: 10px;
border-radius: 30px; border-radius: 30px;
& > * { & > * {
border: solid 0px transparent; border: solid 0 transparent;
} }
&.highlight { &.highlight {