diff --git a/flake.lock b/flake.lock index 22d16a6..cdabb11 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "alejandra": { + "inputs": { + "flakeCompat": "flakeCompat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1646107632, + "narHash": "sha256-jhmNDzNICcXc0p+Esi+uWCL1wOkGDyrJGBa0IEnkE08=", + "owner": "kamadorueda", + "repo": "alejandra", + "rev": "47cbeddfbf60f5b4bbf8723e90b6106ef5da3fbb", + "type": "github" + }, + "original": { + "owner": "kamadorueda", + "repo": "alejandra", + "type": "github" + } + }, "cadquery-src": { "flake": false, "locked": { @@ -92,6 +113,22 @@ "type": "github" } }, + "flakeCompat": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "ha-now-playing": { "inputs": { "naersk": [ @@ -324,6 +361,7 @@ }, "root": { "inputs": { + "alejandra": "alejandra", "cq-flake": "cq-flake", "emacs-overlay": "emacs-overlay", "flake-utils": "flake-utils", diff --git a/flake.nix b/flake.nix index d637be6..ccdd59b 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,11 @@ inputs.flake-utils.follows = "flake-utils"; }; + alejandra = { + url = "github:kamadorueda/alejandra"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ha-now-playing = { url = "git+ssh://git@git.datarift.nl/erwin/ha-now-playing.git?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home-manager/modules/vscode/default.nix b/home-manager/modules/vscode/default.nix index 17c7898..e781d0c 100644 --- a/home-manager/modules/vscode/default.nix +++ b/home-manager/modules/vscode/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, ... }: +{ lib, pkgs, config, flake-inputs, ... }: with lib; let cfg = config.eboskma.programs.vscode; in @@ -10,52 +10,53 @@ in programs.vscode = { enable = true; package = pkgs.vscode; - extensions = with pkgs.vscode-extensions; [ - arrterian.nix-env-selector - bbenoist.nix - brettm12345.nixfmt-vscode - # aaronduino.nix-lsp - # aliariff.auto-add-brackets - bradlc.vscode-tailwindcss - # bungcip.better-toml - coolbear.systemd-unit-file - # dawhite.mustache - dbaeumer.vscode-eslint - denoland.vscode-deno - # dlasagno.rasi - # dprint.dprint - editorconfig.editorconfig - esbenp.prettier-vscode - # EugenWiens.bitbake - elixir-lsp.vscode-elixir-ls # this is the one by Jake Becker, not the deprecated one - # kumar-harsh.graphql-for-vscode - matklad.rust-analyzer - # monokai.theme-monokai-pro-vscode - ms-azuretools.vscode-docker - ms-python.python - ms-python.vscode-pylance - ms-toolsai.jupyter - # ms-toolsai.jupyter-keymap - # ms-toolsai.jupyter-renderers - # ms-vscode-remote.remote-containers - ms-vscode-remote.remote-ssh - # ms-vscode-remote.remote-ssh-edit - # ms-vscode.cmake-tools - ms-vscode.cpptools - # msaraiva.surface - # pgourlain.erlang - # phoenixframework.phoenix - rubymaniac.vscode-paste-and-indent - # surajbarkale.ninja - timonwong.shellcheck - # twxs.cmake - vadimcn.vscode-lldb - # vscode-icons-team.vscode-icons - vscodevim.vim - wholroyd.jinja - xaver.clang-format - zxh404.vscode-proto3 - ]; + extensions = + (with pkgs.vscode-extensions; [ + arrterian.nix-env-selector + bbenoist.nix + # brettm12345.nixfmt-vscode + # aaronduino.nix-lsp + # aliariff.auto-add-brackets + bradlc.vscode-tailwindcss + # bungcip.better-toml + coolbear.systemd-unit-file + # dawhite.mustache + dbaeumer.vscode-eslint + denoland.vscode-deno + # dlasagno.rasi + # dprint.dprint + editorconfig.editorconfig + esbenp.prettier-vscode + # EugenWiens.bitbake + elixir-lsp.vscode-elixir-ls # this is the one by Jake Becker, not the deprecated one + # kumar-harsh.graphql-for-vscode + matklad.rust-analyzer + # monokai.theme-monokai-pro-vscode + ms-azuretools.vscode-docker + ms-python.python + ms-python.vscode-pylance + ms-toolsai.jupyter + # ms-toolsai.jupyter-keymap + # ms-toolsai.jupyter-renderers + # ms-vscode-remote.remote-containers + ms-vscode-remote.remote-ssh + # ms-vscode-remote.remote-ssh-edit + # ms-vscode.cmake-tools + ms-vscode.cpptools + # msaraiva.surface + # pgourlain.erlang + # phoenixframework.phoenix + rubymaniac.vscode-paste-and-indent + # surajbarkale.ninja + timonwong.shellcheck + # twxs.cmake + vadimcn.vscode-lldb + # vscode-icons-team.vscode-icons + vscodevim.vim + wholroyd.jinja + xaver.clang-format + zxh404.vscode-proto3 + ]); keybindings = [ { @@ -78,6 +79,7 @@ in home.packages = with pkgs; [ rnix-lsp shellcheck + flake-inputs.alejandra.defaultPackage.${pkgs.system} ]; }; } diff --git a/home-manager/modules/vscode/settings.json b/home-manager/modules/vscode/settings.json index c86b6c2..95c512f 100644 --- a/home-manager/modules/vscode/settings.json +++ b/home-manager/modules/vscode/settings.json @@ -21,7 +21,10 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[nix]": { - "editor.defaultFormatter": "aaronduino.nix-lsp" + "editor.defaultFormatter": "kamadorueda.alejandra", + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnType": false }, "[python]": { "editor.tabSize": 4 @@ -38,6 +41,7 @@ "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "alejandra.program": "alejandra", "docker.showStartPage": false, "editor.bracketPairColorization.enabled": true, "editor.cursorStyle": "line",