add python lsp

This commit is contained in:
Malte Tammena 2024-04-25 12:23:30 +02:00
parent 78b37317d2
commit b94555e703
2 changed files with 145 additions and 137 deletions

9
.helix/languages.toml Normal file
View file

@ -0,0 +1,9 @@
[[language]]
name = "python"
language-servers = [ "pyright", "ruff" ]
[language-server.ruff]
command = "ruff-lsp"
[language-server.ruff.config.settings]
args = ["--ignore", "E501"]

View file

@ -30,18 +30,17 @@
};
};
outputs =
inputs @ { self
, nixpkgs
, flake-parts
, crane
, fenix
, flake-utils
, advisory-db
, rust-overlay
,
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
crane,
fenix,
flake-utils,
advisory-db,
rust-overlay,
}:
flake-parts.lib.mkFlake { inherit inputs self; } {
flake-parts.lib.mkFlake {inherit inputs self;} {
imports = [
];
@ -53,15 +52,14 @@
flake.hydraJobs.devShells.x86_64-linux = self.devShells.x86_64-linux;
flake.hydraJobs.checks.x86_64-linux = self.checks.x86_64-linux;
perSystem =
{ self'
, pkgs
, lib
, config
, system
, ...
}:
let
perSystem = {
self',
pkgs,
lib,
config,
system,
...
}: let
# Load toolchain from file and extend with rust-src and rust-analyzer + clippy
rustToolchain = (pkgs.rust-bin.fromRustupToolchainFile (self + /rust-toolchain.toml)).override {
extensions = [
@ -115,8 +113,7 @@
// {
inherit cargoArtifacts;
});
in
{
in {
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [
@ -174,8 +171,8 @@
packages =
{
default = aba2sat;
aspforaba = pkgs.callPackage ./nix/packages/aspforaba.nix { inherit (self'.packages) clingo; };
clingo = pkgs.callPackage ./nix/packages/clingo.nix { };
aspforaba = pkgs.callPackage ./nix/packages/aspforaba.nix {inherit (self'.packages) clingo;};
clingo = pkgs.callPackage ./nix/packages/clingo.nix {};
}
// lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
aba2sat-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs
@ -194,7 +191,7 @@
RUST_LOG = "trace";
inputsFrom = [ ];
inputsFrom = [];
packages = [
pkgs.hyperfine
@ -202,6 +199,8 @@
pkgs.nil
pkgs.nodejs
pkgs.pre-commit
pkgs.pyright
pkgs.ruff-lsp
pkgs.shellcheck
pkgs.shfmt
self'.packages.aspforaba