diff --git a/.config/nvim/lua/rocketcamel/plugins/lsp.lua b/.config/nvim/lua/rocketcamel/plugins/lsp.lua index 18cc8d3..3a0d57b 100644 --- a/.config/nvim/lua/rocketcamel/plugins/lsp.lua +++ b/.config/nvim/lua/rocketcamel/plugins/lsp.lua @@ -1,88 +1,102 @@ local function setup_luau() - require("luau-lsp").setup({ - platform = { - type = "roblox", - }, - types = { - roblox_security_level = "PluginSecurity", - }, - sourcemap = { - enabled = true, - autogenerate = true, - rojo_project_file = "default.project.json", - sourcemap_file = "sourcemap.json", - }, - plugin = { - enabled = true, - port = 3667, - }, - fflags = { - enable_new_solver = true, - sync = true, - }, - }) + require("luau-lsp").setup({ + platform = { + type = "roblox", + }, + types = { + roblox_security_level = "PluginSecurity", + }, + sourcemap = { + enabled = true, + autogenerate = true, + rojo_project_file = "default.project.json", + sourcemap_file = "sourcemap.json", + }, + plugin = { + enabled = true, + port = 3667, + }, + fflags = { + enable_new_solver = true, + sync = true, + }, + }) + vim.lsp.config("luau-lsp", { + settings = { + ["luau-lsp"] = { + completion = { + autocompleteEnd = true, + imports = { + enabled = true, + suggestServices = true, + suggestRequires = true, + }, + }, + }, + }, + }) end local function setup_lua() - require("lspconfig").lua_ls.setup({ - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file('', true), - checkThirdParty = false, - }, - } - } - }) + require("lspconfig").lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + }, + }, + }) end local function setup_ts() - require("lspconfig").ts_ls.setup({}) + require("lspconfig").ts_ls.setup({}) end local function setup_nix() - require("lspconfig").nixd.setup({}) + require("lspconfig").nixd.setup({}) end return { - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "j-hui/fidget.nvim", - "lopi-py/luau-lsp.nvim", - }, - config = function() - require("mason").setup() - require("fidget").setup({ - notification = { - window = { - winblend = 0, - }, - }, - }) - require("mason-lspconfig").setup({ - ensure_installed = { - "ts_ls", - "lua_ls", - "luau_lsp", - "rust_analyzer", - "tailwindcss", - "svelte", - "html", - "gopls", - "templ", - }, - automatic_enable = { exclude = { "luau_lsp", "lua_ls" } }, - }) - setup_luau() - setup_lua() - setup_ts() - setup_nix() - end, - }, + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "j-hui/fidget.nvim", + "lopi-py/luau-lsp.nvim", + }, + config = function() + require("mason").setup() + require("fidget").setup({ + notification = { + window = { + winblend = 0, + }, + }, + }) + require("mason-lspconfig").setup({ + ensure_installed = { + "ts_ls", + "lua_ls", + "luau_lsp", + "rust_analyzer", + "tailwindcss", + "svelte", + "html", + "gopls", + "templ", + }, + automatic_enable = { exclude = { "luau_lsp", "lua_ls" } }, + }) + setup_luau() + setup_lua() + setup_ts() + setup_nix() + end, + }, } diff --git a/nix/hosts/usahara/configuration.nix b/nix/hosts/usahara/configuration.nix index 0448408..7af9808 100644 --- a/nix/hosts/usahara/configuration.nix +++ b/nix/hosts/usahara/configuration.nix @@ -50,6 +50,7 @@ desktop.enable = true; kanata.enable = true; kanata.apple = true; + sensors.enable = true; users.users.luca = { isNormalUser = true; diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 9c20413..5372957 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -17,5 +17,6 @@ ./zed-editor.nix ./virtualization.nix ./printing.nix + ./sensors.nix ]; } diff --git a/nix/modules/desktop.nix b/nix/modules/desktop.nix index 21ad325..719091c 100644 --- a/nix/modules/desktop.nix +++ b/nix/modules/desktop.nix @@ -48,6 +48,8 @@ awscli2 gitui htop + lm_sensors + fanctl ]; programs.hyprland = { enable = true; diff --git a/nix/modules/sensors.nix b/nix/modules/sensors.nix new file mode 100644 index 0000000..4118698 --- /dev/null +++ b/nix/modules/sensors.nix @@ -0,0 +1,27 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + options.sensors = { + enable = lib.mkEnableOption "enable sensors"; + }; + + config = lib.mkIf config.sensors.enable { + boot.kernelModules = [ + "coretemp" + "nct6775" + ]; + systemd.services."sensors-init" = { + description = "Initialize sensor settings"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "/run/current-system/sw/bin/sensors -s"; + }; + }; + }; +}