Skip to content

Commit

Permalink
Bundle ecsls_run within vim extra packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Aug 9, 2023
1 parent 156cbda commit 73344b9
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 74 deletions.
Empty file added Makefile
Empty file.
109 changes: 97 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";

hosts.url = github:StevenBlack/hosts;
hosts.url = "github:StevenBlack/hosts";
nixos-hardware.url = "github:NixOS/nixos-hardware";

nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";

ecsls.url = "github:Sigmapitech-meta/ecsls";

home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
{ self
, nixpkgs
{ nixpkgs
, nix-index-database
, nixos-hardware
, home-manager
, hosts
, ecsls
, ...
} @inputs:
}:
let
username = "sigmanificient";
system = "x86_64-linux";
Expand All @@ -37,7 +39,14 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = import ./home;
home-manager.extraSpecialArgs = { inherit username; };
home-manager.extraSpecialArgs = {
inherit ecsls;
conf = {
inherit username;
inherit system;
ecsls.enable = true;
};
};
}

hosts.nixosModule
Expand Down
9 changes: 5 additions & 4 deletions home/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ config, pkgs, username, ... }:
{ pkgs, conf, ecsls, ... }:
{
nixpkgs.config.allowUnfree = true;

imports = [
(import ./nvim { inherit ecsls; inherit pkgs; inherit conf; })

./btop
./neofetch
./nvim
./picom
./qtile
./dunst
Expand All @@ -24,8 +25,8 @@
];

home = {
username = "${username}";
homeDirectory = "/home/${username}";
username = "${conf.username}";
homeDirectory = "/home/${conf.username}";

stateVersion = "22.11";
sessionVariables = {
Expand Down
63 changes: 16 additions & 47 deletions home/nvim/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
{ pkgs, ... }:
{ pkgs, ecsls, conf, ... }:
let
vera = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "banana-vera";
version = "1.3.0-python3.10";

src = pkgs.fetchFromGitHub {
owner = "Epitech";
repo = "banana-vera";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-1nAKhUltQS1301JNrr0PQQrrf2W9Hj5gk1nbUhN4cXw=";
};

nativeBuildInputs = [ pkgs.cmake ];
buildInputs = with pkgs; [
python310
python310.pkgs.boost
tcl
];

cmakeFlags = [
"-DVERA_LUA=OFF"
"-DVERA_USE_SYSTEM_BOOST=ON"
"-DPANDOC=OFF"
];
});
base_pkgs = with pkgs; [
nil # Nix
lua-language-server
nodePackages.pyright
clang-tools
llvmPackages_latest.clang
nodejs # Copilot
xclip # Clipboard fix
];

extra_pkgs =
if conf.ecsls.enable
then base_pkgs ++ [ ecsls.packages.${conf.system}.default ]
else base_pkgs;
in
{
home.file.nvim_conf = {
Expand All @@ -43,28 +33,7 @@ in
lazy-nvim
];

extraPackages = with pkgs; [
vera

# ↓ Nix
nil

# ↓ Lua
lua-language-server

# ↓ Python
nodePackages.pyright

# ↓ C
clang-tools
llvmPackages_latest.clang

# ↓ Copilot
nodejs

# ↓ Clipboard fix
xclip
];
extraPackages = extra_pkgs;
};
}

7 changes: 1 addition & 6 deletions home/nvim/lua/sigma/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ if not configs.ecsls then
configs.ecsls = {
default_config = {
root_dir = lspconfig.util.root_pattern(".git", "Makefile"),
cmd = {
'/home/sigmanificient/dev/ecsls/.direnv/python-3.11.4/bin/ecsls_run'
},
cmd = { 'ecsls_run' },
autostart = true,
name = 'ecsls',
filetypes = { 'c', 'cpp', 'make' },
init_options = {
path = '/home/sigmanificient/dev/ecsls/'
},
},
}
end
Expand Down

0 comments on commit 73344b9

Please sign in to comment.