From ac1fb30cc8230a4c1c90e54151a93299acf1e771 Mon Sep 17 00:00:00 2001 From: redyf Date: Mon, 12 Feb 2024 16:47:51 +0000 Subject: [PATCH 1/2] Auto lint/format --- config/lsp/lsp.nix | 14 +++++++------- flake.lock | 11 ++++++----- flake.nix | 27 +++++++++++++++------------ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/config/lsp/lsp.nix b/config/lsp/lsp.nix index 4fe368e1..aaa46649 100644 --- a/config/lsp/lsp.nix +++ b/config/lsp/lsp.nix @@ -7,7 +7,7 @@ enable = true; capabilities = "offsetEncoding = 'utf-16'"; servers = { - clangd = {enable = true;}; + clangd = { enable = true; }; lua-ls = { enable = true; extraOptions = { @@ -19,15 +19,15 @@ telemetry = { enabled = false; }; - hint = {enable = true;}; + hint = { enable = true; }; }; }; }; }; - nil_ls = {enable = true;}; + nil_ls = { enable = true; }; tsserver = { enable = false; - filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; + filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" ]; extraOptions = { settings = { javascript = { @@ -55,9 +55,9 @@ }; }; }; - eslint = {enable = true;}; - pyright = {enable = true;}; - ruff-lsp = {enable = true;}; + eslint = { enable = true; }; + pyright = { enable = true; }; + ruff-lsp = { enable = true; }; rust-analyzer = { enable = true; diff --git a/flake.lock b/flake.lock index 3955cf13..4f079398 100644 --- a/flake.lock +++ b/flake.lock @@ -139,11 +139,12 @@ }, "nixpkgs": { "locked": { - "lastModified": 1707268954, - "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", - "path": "/nix/store/snp5f95xhkz89kdw9703kana3m6xfd0a-source", - "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", - "type": "path" + "lastModified": 1707711327, + "narHash": "sha256-JaiR0Er0Bx80CT5POOYR1I1tLM7VvC2/ny6mOmkoRQw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01737456dfe4907fb5bdc8af39ac8c6d6b1fb551", + "type": "github" }, "original": { "id": "nixpkgs", diff --git a/flake.nix b/flake.nix index 0f78ddab..6f0128e0 100644 --- a/flake.nix +++ b/flake.nix @@ -6,18 +6,20 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { - self, - nixpkgs, - nixvim, - flake-utils, - ... - } @ inputs: let - config = import ./config; # import the module directly - in - flake-utils.lib.eachDefaultSystem (system: let + outputs = + { self + , nixpkgs + , nixvim + , flake-utils + , ... + } @ inputs: + let + config = import ./config; # import the module directly + in + flake-utils.lib.eachDefaultSystem (system: + let nixvimLib = nixvim.lib.${system}; - pkgs = import nixpkgs {inherit system;}; + pkgs = import nixpkgs { inherit system; }; nixvim' = nixvim.legacyPackages.${system}; nvim = nixvim'.makeNixvimWithModule { inherit pkgs; @@ -27,7 +29,8 @@ inherit self; }; }; - in { + in + { checks = { # Run `nix flake check .` to verify that your config is not broken default = nixvimLib.check.mkTestDerivationFromNvim { From d001cd4ce2a89850cb3bd6da1195bfe1aea8b653 Mon Sep 17 00:00:00 2001 From: Redyf Date: Mon, 12 Feb 2024 14:07:07 -0300 Subject: [PATCH 2/2] feat: Change formatter to alejandra --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0f78ddab..71464c9f 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,6 @@ default = nvim; }; - formatter = pkgs.nixpkgs-fmt; + formatter = pkgs.alejandra; }); }