back to nil_ls
This commit is contained in:
parent
b78d5fa1e4
commit
205d168099
7 changed files with 195 additions and 226 deletions
17
.nixd.json
17
.nixd.json
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"eval": {
|
|
||||||
"target": {
|
|
||||||
"args": ["-f", "default.nix"],
|
|
||||||
"installable": "nixosConfigurations.sakotop.config.system.build.toplevel"
|
|
||||||
},
|
|
||||||
"depth": 0,
|
|
||||||
"workers": 3
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"enable": true,
|
|
||||||
"target": {
|
|
||||||
"args": [],
|
|
||||||
"installable": ".#nixosConfigurations.sakotop.options"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,13 +7,13 @@ require("mason-lspconfig").setup()
|
||||||
local mason_null_ls = require("mason-null-ls")
|
local mason_null_ls = require("mason-null-ls")
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {})
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {})
|
||||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
||||||
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {})
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {})
|
||||||
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, {})
|
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, {})
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- enable autocomplete
|
-- enable autocomplete
|
||||||
|
@ -29,61 +29,61 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
mason_null_ls.setup()
|
mason_null_ls.setup()
|
||||||
|
|
||||||
-- funny lsp config stuff
|
-- funny lsp config stuff
|
||||||
require('lspconfig').nixd.setup({
|
require('lspconfig').nil_ls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
require("lspconfig").lua_ls.setup({
|
require("lspconfig").lua_ls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").omnisharp.setup({
|
require("lspconfig").omnisharp.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").cmake.setup({
|
require("lspconfig").cmake.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").clangd.setup({
|
require("lspconfig").clangd.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").tsserver.setup({
|
require("lspconfig").tsserver.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").html.setup({
|
require("lspconfig").html.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").eslint.setup({
|
require("lspconfig").eslint.setup({
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
command = "EslintFixAll",
|
command = "EslintFixAll",
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").pyright.setup({
|
require("lspconfig").pyright.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").cssls.setup({
|
require("lspconfig").cssls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
require('lspconfig')['hls'].setup{
|
require('lspconfig')['hls'].setup {
|
||||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,123 +0,0 @@
|
||||||
{ config, inputs, outputs, pkgs, lib, home-manager, ...}:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
# home manager
|
|
||||||
inputs.home-manager.nixosModules.default
|
|
||||||
# modules
|
|
||||||
# import for each folder
|
|
||||||
# modules/desktop IMPORT
|
|
||||||
# modules/desktop/example DO NOT IMPORT,
|
|
||||||
# add entry to module's default.nix
|
|
||||||
outputs.nixosModules.desktop
|
|
||||||
outputs.nixosModules.shell
|
|
||||||
outputs.nixosModules.hardware
|
|
||||||
outputs.nixosModules.dev
|
|
||||||
outputs.nixosModules.media
|
|
||||||
];
|
|
||||||
|
|
||||||
# flakes
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
|
||||||
|
|
||||||
# import the overlays
|
|
||||||
nixpkgs = {
|
|
||||||
overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
outputs.overlays.modifications
|
|
||||||
outputs.overlays.unstable-packages
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# grub (mount efi partition to /boot/efi)
|
|
||||||
# why /boot/efi? instead of /efi?
|
|
||||||
# 1. when dualbooting, windows makes the efi partition 100mb instead of 512mb+ (we need this for generations
|
|
||||||
# and intel microcode)
|
|
||||||
# 2. nixos does not like /efi :(
|
|
||||||
# 3. i dont like systemd boot D:
|
|
||||||
# TODO(sako):: add shim secure boot
|
|
||||||
# because window and riot games devs :(
|
|
||||||
boot.loader = {
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
efiSysMountPoint = "/boot/efi";
|
|
||||||
};
|
|
||||||
grub = {
|
|
||||||
devices = [ "nodev" ];
|
|
||||||
efiSupport = true;
|
|
||||||
enable = true;
|
|
||||||
useOSProber = true;
|
|
||||||
configurationLimit = 10;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# this shouldnt cause any issues right?
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
|
|
||||||
time.timeZone = "Africa/Cairo";
|
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
console = {
|
|
||||||
font = "Lat2-Terminus16";
|
|
||||||
# keyMap = "us";
|
|
||||||
# use xorg layout option
|
|
||||||
# TODO(sako):: add arabic locale
|
|
||||||
useXkbConfig = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# xorg layout
|
|
||||||
# change to needed
|
|
||||||
services.xserver.layout = "us";
|
|
||||||
|
|
||||||
# already sold soul to corporations \_o_/
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.sako = { pkgs, ...}: {
|
|
||||||
# CHANGE THIS WHEN THE SYSTEM VERSION CHANGES TOO!!!
|
|
||||||
home.stateVersion = "23.05";
|
|
||||||
home.packages = [];
|
|
||||||
home.username = "sako";
|
|
||||||
home.homeDirectory = "/home/sako";
|
|
||||||
programs.bash.enable = true;
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
xdg.configFile.git = {
|
|
||||||
source = ./config/git;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# bare minimum
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
vim # backup
|
|
||||||
wget #double u get
|
|
||||||
killall # die processes
|
|
||||||
alsa-utils # unsupported application
|
|
||||||
pulseaudio # unsupported application
|
|
||||||
pamixer # unsupported application
|
|
||||||
feh # im different
|
|
||||||
unzip # zip file
|
|
||||||
gh # github
|
|
||||||
htop # htop
|
|
||||||
tree # trees
|
|
||||||
];
|
|
||||||
# you phisiclally cannot live without this
|
|
||||||
# litearlly! ! ! ! ! !
|
|
||||||
programs.gnupg.agent = {
|
|
||||||
enable = true;
|
|
||||||
pinentryFlavor = "gtk2";
|
|
||||||
# enableSSHSupport = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.gitFull;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# something nixos release
|
|
||||||
# something use ful in for mat ion
|
|
||||||
# blah blah blah
|
|
||||||
# nixos packages type shit
|
|
||||||
# change this on every update idiot
|
|
||||||
# dont name it to string beans or some shit
|
|
||||||
# you idiot
|
|
||||||
system.stateVersion = "23.05";
|
|
||||||
# read comment you read the comment?
|
|
||||||
}
|
|
133
default.nix
133
default.nix
|
@ -1,10 +1,123 @@
|
||||||
(import
|
{ config, inputs, outputs, pkgs, lib, home-manager, ...}:
|
||||||
(
|
{
|
||||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
imports = [
|
||||||
fetchTarball {
|
# home manager
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
inputs.home-manager.nixosModules.default
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
# modules
|
||||||
}
|
# import for each folder
|
||||||
)
|
# modules/desktop IMPORT
|
||||||
{ src = ./.; }
|
# modules/desktop/example DO NOT IMPORT,
|
||||||
).defaultNix
|
# add entry to module's default.nix
|
||||||
|
outputs.nixosModules.desktop
|
||||||
|
outputs.nixosModules.shell
|
||||||
|
outputs.nixosModules.hardware
|
||||||
|
outputs.nixosModules.dev
|
||||||
|
outputs.nixosModules.media
|
||||||
|
];
|
||||||
|
|
||||||
|
# flakes
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
||||||
|
|
||||||
|
# import the overlays
|
||||||
|
nixpkgs = {
|
||||||
|
overlays = [
|
||||||
|
outputs.overlays.additions
|
||||||
|
outputs.overlays.modifications
|
||||||
|
outputs.overlays.unstable-packages
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# grub (mount efi partition to /boot/efi)
|
||||||
|
# why /boot/efi? instead of /efi?
|
||||||
|
# 1. when dualbooting, windows makes the efi partition 100mb instead of 512mb+ (we need this for generations
|
||||||
|
# and intel microcode)
|
||||||
|
# 2. nixos does not like /efi :(
|
||||||
|
# 3. i dont like systemd boot D:
|
||||||
|
# TODO(sako):: add shim secure boot
|
||||||
|
# because window and riot games devs :(
|
||||||
|
boot.loader = {
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
efiSysMountPoint = "/boot/efi";
|
||||||
|
};
|
||||||
|
grub = {
|
||||||
|
devices = [ "nodev" ];
|
||||||
|
efiSupport = true;
|
||||||
|
enable = true;
|
||||||
|
useOSProber = true;
|
||||||
|
configurationLimit = 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# this shouldnt cause any issues right?
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
time.timeZone = "Africa/Cairo";
|
||||||
|
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
console = {
|
||||||
|
font = "Lat2-Terminus16";
|
||||||
|
# keyMap = "us";
|
||||||
|
# use xorg layout option
|
||||||
|
# TODO(sako):: add arabic locale
|
||||||
|
useXkbConfig = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# xorg layout
|
||||||
|
# change to needed
|
||||||
|
services.xserver.layout = "us";
|
||||||
|
|
||||||
|
# already sold soul to corporations \_o_/
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.sako = { pkgs, ...}: {
|
||||||
|
# CHANGE THIS WHEN THE SYSTEM VERSION CHANGES TOO!!!
|
||||||
|
home.stateVersion = "23.05";
|
||||||
|
home.packages = [];
|
||||||
|
home.username = "sako";
|
||||||
|
home.homeDirectory = "/home/sako";
|
||||||
|
programs.bash.enable = true;
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
xdg.configFile.git = {
|
||||||
|
source = ./config/git;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# bare minimum
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim # backup
|
||||||
|
wget #double u get
|
||||||
|
killall # die processes
|
||||||
|
alsa-utils # unsupported application
|
||||||
|
pulseaudio # unsupported application
|
||||||
|
pamixer # unsupported application
|
||||||
|
feh # im different
|
||||||
|
unzip # zip file
|
||||||
|
gh # github
|
||||||
|
htop # htop
|
||||||
|
tree # trees
|
||||||
|
];
|
||||||
|
# you phisiclally cannot live without this
|
||||||
|
# litearlly! ! ! ! ! !
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
pinentryFlavor = "gtk2";
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.gitFull;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# something nixos release
|
||||||
|
# something use ful in for mat ion
|
||||||
|
# blah blah blah
|
||||||
|
# nixos packages type shit
|
||||||
|
# change this on every update idiot
|
||||||
|
# dont name it to string beans or some shit
|
||||||
|
# you idiot
|
||||||
|
system.stateVersion = "23.05";
|
||||||
|
# read comment you read the comment?
|
||||||
|
}
|
||||||
|
|
74
flake.nix
74
flake.nix
|
@ -3,63 +3,69 @@
|
||||||
description = "horrible dotfiles for amazing distro";
|
description = "horrible dotfiles for amazing distro";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# nixpkgs
|
# nixpkgs
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
# unstable for a few packages
|
# unstable for a few packages
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
# flake-compat for nixd
|
# flake-compat for nixd
|
||||||
flake-compat = {
|
#flake-compat = {
|
||||||
url = "github:edolstra/flake-compat";
|
# url = "github:edolstra/flake-compat";
|
||||||
flake = false;
|
# flake = false;
|
||||||
};
|
#};
|
||||||
# TODO(sako):: add agenix or sops-nix
|
# TODO(sako):: add agenix or sops-nix
|
||||||
# https://github.com/ryantm/agenix#install-via-flakes
|
# https://github.com/ryantm/agenix#install-via-flakes
|
||||||
# https://github.com/Mic92/sops-nix
|
# https://github.com/Mic92/sops-nix
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, ...}@inputs:
|
outputs = {
|
||||||
let
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [
|
forAllSystems = nixpkgs.lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
in
|
in rec {
|
||||||
rec {
|
|
||||||
# custom packages
|
# custom packages
|
||||||
packages = forAllSystems (system:
|
packages = forAllSystems (
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
system: let
|
||||||
in import ./packages { inherit pkgs; }
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in
|
||||||
|
import ./packages {inherit pkgs;}
|
||||||
);
|
);
|
||||||
# dev shell for bootstrap
|
# dev shell for bootstrap
|
||||||
devShells = forAllSystems (system:
|
devShells = forAllSystems (
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
system: let
|
||||||
in import ./shell.nix { inherit pkgs; }
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in
|
||||||
|
import ./shell.nix {inherit pkgs;}
|
||||||
);
|
);
|
||||||
|
|
||||||
# overlays here
|
# overlays here
|
||||||
overlays = import ./overlays { inherit inputs; };
|
overlays = import ./overlays {inherit inputs;};
|
||||||
|
|
||||||
# modules :D
|
# modules :D
|
||||||
nixosModules = import ./modules;
|
nixosModules = import ./modules;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
sakotop = nixpkgs.lib.nixosSystem {
|
sakotop = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = {inherit inputs outputs;};
|
||||||
modules = [
|
modules = [
|
||||||
./default-options.nix
|
./default.nix
|
||||||
./hosts/sakotop/configuration.nix
|
./hosts/sakotop/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
sakopc = nixpkgs.lib.nixosSystem {
|
sakopc = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = {inherit inputs outputs;};
|
||||||
modules = [
|
modules = [
|
||||||
./default-options.nix
|
./default.nix
|
||||||
./hosts/sakopc/configuration.nix
|
./hosts/sakopc/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,8 @@
|
||||||
nvim.enable = true;
|
nvim.enable = true;
|
||||||
vscode.fhs.enable = true;
|
vscode.fhs.enable = true;
|
||||||
};
|
};
|
||||||
nixd.enable = true;
|
nixd.enable = false;
|
||||||
nil.enable = false;
|
nil.enable = true;
|
||||||
cc.enable = true;
|
cc.enable = true;
|
||||||
javascript.enable = true;
|
javascript.enable = true;
|
||||||
python.enable = true;
|
python.enable = true;
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"eval": {
|
|
||||||
"target": {
|
|
||||||
"args": [
|
|
||||||
"--expr",
|
|
||||||
"with import <nixpkgs> { }; callPackage ./nullpomino.nix { }"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue