From d75328ab8b6b642fcb6a15eae1a1802724ed63d6 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 26 Oct 2023 16:33:40 -0400 Subject: [PATCH] feat(nvim): make stylelintplus packages and make them work --- common/modules/neovim/default.nix | 35 +++++++++++++------ common/overlays/default.nix | 10 ++++++ common/overlays/pkgs/coc-stylelintplus.nix | 28 +++++++++++++++ common/overlays/pkgs/stylelint-lsp.nix | 21 +++++++++++ .../config/ags/scss/widgets/applauncher.scss | 2 ++ hosts/wim/config/ags/scss/widgets/date.scss | 18 +++++----- 6 files changed, 94 insertions(+), 20 deletions(-) create mode 100644 common/overlays/pkgs/coc-stylelintplus.nix create mode 100644 common/overlays/pkgs/stylelint-lsp.nix diff --git a/common/modules/neovim/default.nix b/common/modules/neovim/default.nix index 814b58d2..04e678b4 100644 --- a/common/modules/neovim/default.nix +++ b/common/modules/neovim/default.nix @@ -17,7 +17,6 @@ in org.gradle.java.home = ${pkgs.temurin-bin-17} ''; }; - home.packages = with pkgs; [ gradle gradle-completion # FIXME: not working @@ -32,10 +31,14 @@ in neovim = { enable = true; + package = pkgs.neovim-nightly; + withNodeJs = true; + withPython3 = true; + withRuby = false; + defaultEditor = true; viAlias = true; vimAlias = true; - package = pkgs.neovim-nightly; extraConfig = with lib.strings; '' ${fileContents ./config/base.vim} @@ -45,7 +48,6 @@ in ${fileContents ./config/config.lua} ''; - withNodeJs = true; extraPackages = with pkgs; [ nodejs_latest nodePackages.npm @@ -54,7 +56,7 @@ in bat - stylelint + stylelint-lsp nil ]; extraPython3Packages = with pkgs.python311Packages; [ @@ -64,18 +66,26 @@ in coc = { enable = true; settings = { + # General "colors.enable" = true; "coc.preferences.formatOnType" = true; "inlayHint.enable" = false; + # Eslint "eslint.format.enable" = true; "eslint.autoFixOnSave" = true; + + # Stylelint FIXME: not working + "stylelintplus.enable" = true; + "stylelintplus.cssInJs" = true; + "stylelintplus.autoFixOnSave" = true; "stylelintplus.autoFixOnFormat" = true; "css.validate" = false; "less.validate" = false; "scss.validate" = false; "wxss.validate" = false; + # Lua lsp "Lua.misc.parameters" = [ "--metapath" "~/.cache/sumneko_lua/meta" @@ -90,8 +100,7 @@ in enableNvimLuaDev = true; }; - "java.jdt.ls.java.home" = "${pkgs.temurin-bin-17}"; - "bashIde.shellcheckPath" = "${pkgs.shellcheck}/bin/shellcheck"; + # Nix languageserver = { nix = { command = "nil"; @@ -99,6 +108,10 @@ in 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-css + + # Lua coc-sumneko-lua + neodev-nvim + coc-highlight coc-json coc-pyright @@ -119,11 +136,7 @@ in coc-markdownlint coc-tsserver coc-eslint - (plugin "bmatcuk" - "coc-stylelintplus" - "4854bfdc0cb6f92e39b5afb3b90d60b411ecb9e4" - "sha256-PgcQc3JecfHE4oNcydyOqsKdRbh4yPhXPugVQDGSRuI=") - neodev-nvim + coc-stylelintplus coc-fzf fzfWrapper diff --git a/common/overlays/default.nix b/common/overlays/default.nix index 61689c6d..7eb3cb24 100644 --- a/common/overlays/default.nix +++ b/common/overlays/default.nix @@ -11,6 +11,16 @@ (import ./blueberry.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: { spotifywm = final.callPackage ./pkgs/spotifywm.nix {}; }) diff --git a/common/overlays/pkgs/coc-stylelintplus.nix b/common/overlays/pkgs/coc-stylelintplus.nix new file mode 100644 index 00000000..a7ea9665 --- /dev/null +++ b/common/overlays/pkgs/coc-stylelintplus.nix @@ -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}"; +} diff --git a/common/overlays/pkgs/stylelint-lsp.nix b/common/overlays/pkgs/stylelint-lsp.nix new file mode 100644 index 00000000..e9479961 --- /dev/null +++ b/common/overlays/pkgs/stylelint-lsp.nix @@ -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; +} diff --git a/hosts/wim/config/ags/scss/widgets/applauncher.scss b/hosts/wim/config/ags/scss/widgets/applauncher.scss index d9fe80b3..e2faf854 100644 --- a/hosts/wim/config/ags/scss/widgets/applauncher.scss +++ b/hosts/wim/config/ags/scss/widgets/applauncher.scss @@ -40,6 +40,7 @@ scrollbar, scrollbar * { all: unset; } + scrollbar.vertical { transition: 200ms; background-color: rgba(23, 23, 23, 0.3); @@ -52,6 +53,7 @@ min-width: .6em; } } + slider { background-color: rgba(238, 238, 238, 0.5); border-radius: 9px; diff --git a/hosts/wim/config/ags/scss/widgets/date.scss b/hosts/wim/config/ags/scss/widgets/date.scss index c068f3dc..6ed3e585 100644 --- a/hosts/wim/config/ags/scss/widgets/date.scss +++ b/hosts/wim/config/ags/scss/widgets/date.scss @@ -2,49 +2,49 @@ background-color: $bg; color: $fg; border-radius: 30px; - border-top-right-radius: 0px; + border-top-right-radius: 0; border: 2px solid $contrastbg; } .timebox { - margin: 30px 0px; + margin: 30px 0; + .time-container { .content { - font-family: Product Sans; font-weight: bolder; font-size: 60px; } + .divider { margin: 8px 15px; - padding: 0px 1px; + padding: 0 1px; background: linear-gradient($red, $magenta, $blue, $cyan); } } + .date-container { - font-family: Product Sans; margin-top: 2px; } } .cal-box { - font-family: Product Sans; border-radius: 30px; padding: 0 1rem .2rem; color: $fg; background-color: $bgfull; border-bottom: 2px solid $contrastbg; border-top: 2px solid $contrastbg; - margin: 0px 12px 18px 12px; + margin: 0 12px 18px; .cal { font-size: 20px; background-color: inherit; - padding: .5rem .10rem 0rem; + padding: .5rem .10rem 0; margin-left: 10px; border-radius: 30px; & > * { - border: solid 0px transparent; + border: solid 0 transparent; } &.highlight {