diff options
-rw-r--r-- | config/nvim/lua/lsp.lua | 128 | ||||
-rw-r--r-- | default.nix | 2 | ||||
-rw-r--r-- | flake.lock | 36 | ||||
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | hosts/jonbox/default.nix | 11 | ||||
-rw-r--r-- | modules/desktop/apps/editors/neovim.nix | 1 | ||||
-rw-r--r-- | modules/desktop/apps/editors/vscode.nix | 3 | ||||
-rw-r--r-- | modules/desktop/apps/mpd.nix | 6 | ||||
-rw-r--r-- | modules/desktop/apps/mutt-wizard.nix | 26 | ||||
-rw-r--r-- | modules/desktop/apps/virt.nix | 4 | ||||
-rw-r--r-- | modules/desktop/hyprland.nix | 55 | ||||
-rw-r--r-- | modules/hardware/gpu.nix | 35 |
12 files changed, 120 insertions, 189 deletions
diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 1056431..7f41534 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -1,122 +1,6 @@ -local cmp = require("cmp") -local nvim_lsp = require("lspconfig") -local cmp_window = require("cmp.utils.window") - vim.o.completeopt = "menuone,noselect" vim.o.shortmess = vim.o.shortmess .. "c" -local function on_attach(client, bufn) - local function map(...) - vim.api.nvim_buf_set_keymap(bufn, ...) - end - - local function buf_set_option(...) - vim.api.nvim_buf_set_option(bufn, ...) - end - - local opts = { noremap = true, silent = true } - map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts) - map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts) - map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts) - map("n", "gi", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts) - map("n", "<C-k>", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts) - map("n", "<leader>D", "<Cmd>lua vim.lsp.buf.type_definition()<CR>", opts) - map("n", "gr", "<Cmd>lua vim.lsp.buf.references()<CR>", opts) - map("n", "<leader>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts) - map("n", "[d", "<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts) - map("n", "]d", "<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts) - map("n", "<leader>q", "<Cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts) - map("n", "ga", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts) -end - -local function has_words_before() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -local function feedkey(key, mode) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) -end - -local function border(hl_name) - return { - { "╭", hl_name }, - { "─", hl_name }, - { "╮", hl_name }, - { "│", hl_name }, - { "╯", hl_name }, - { "─", hl_name }, - { "╰", hl_name }, - { "│", hl_name }, - } -end - -cmp_window.info_ = cmp_window.info -cmp_window.info = function(self) - local info = self:info_() - info.scrollable = false - return info -end - -cmp.setup({ - window = { - completion = { - border = border "CmpBorder", - winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", - }, - documentation = { - border = border "CmpDocBorder" - }, - }, - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-Space>'] = cmp.mapping.complete(), - ['<C-e>'] = cmp.mapping.abort(), - ['<CR>'] = cmp.mapping.confirm({select = true}), - ["<Tab>"] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif vim.fn["vsnip#available"](1) == 1 then - feedkey("<Plug>(vsnip-expand-or-jump)", "") - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, {"i", "s"}), - - ["<S-Tab"] = cmp.mapping(function() - if cmp.visible() then - cmp.select_prev_item() - elseif vim.fn["vsnip#jumpable"](-1) == 1 then - feedkey("<Plug>(vsnip-jump-prev)", "") - end - end, {"i", "s"}), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "vsnip" }, - { name = "treesitter" }, - { name = "path", option = { trailing_slash = true }}, - { name = "buffer" } - }), -}) - -cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), -}) - vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = true, @@ -125,18 +9,6 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( } ) -local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) - -local servers = { "ccls", "bashls", "rnix", "texlab", "lua_ls" } - -for _, lang in pairs(servers) do - nvim_lsp[lang].setup({ - root_dir = vim.loop.cwd, - on_attach = on_attach, - capabilities = capabilities - }) -end - require("nvim-treesitter.configs").setup({ highlight = { enable = true, }, }) diff --git a/default.nix b/default.nix index f223141..b68f048 100644 --- a/default.nix +++ b/default.nix @@ -66,5 +66,5 @@ }; }; - system.stateVersion = "23.11"; + system.stateVersion = "24.05"; } @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1704100519, - "narHash": "sha256-SgZC3cxquvwTN07vrYYT9ZkfvuhS5Y1k1F4+AMsuflc=", + "lastModified": 1720734513, + "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", "owner": "nix-community", "repo": "home-manager", - "rev": "6e91c5df192395753d8e6d55a0352109cb559790", + "rev": "90ae324e2c56af10f20549ab72014804a3064c7f", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1706411424, - "narHash": "sha256-BzziJYucEZvdCE985vjPoo3ztWcmUiSQ1wJ2CoT6jCc=", + "lastModified": 1720926593, + "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "c782f2a4f6fc94311ab5ef31df2f1149a1856181", + "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", "type": "github" }, "original": { @@ -40,15 +40,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706191920, - "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", - "owner": "nixos", + "lastModified": 1720768451, + "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", + "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -56,27 +56,27 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1703992652, - "narHash": "sha256-C0o8AUyu8xYgJ36kOxJfXIroy9if/G6aJbNOpA5W0+M=", + "lastModified": 1720954236, + "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "32f63574c85fbc80e4ba1fbb932cde9619bad25e", + "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1720768451, + "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", "type": "github" }, "original": { @@ -3,7 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; home-manager = { url = "github:nix-community/home-manager"; diff --git a/hosts/jonbox/default.nix b/hosts/jonbox/default.nix index 3cd8d16..2804902 100644 --- a/hosts/jonbox/default.nix +++ b/hosts/jonbox/default.nix @@ -71,6 +71,7 @@ flatpak.enable = true; newsboat.enable = true; virt-manager.enable = true; + mutt.enable = true; }; }; }; @@ -78,10 +79,18 @@ services.printing.enable = true; services.avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; openFirewall = true; }; + environment.systemPackages = [ + pkgs.wineWowPackages.staging + pkgs.winetricks + pkgs.wineWowPackages.waylandFull + ]; + #services.clamav.daemon.enable = true; + #services.clamav.updater.enable = true; + home.manager.wayland.windowManager.hyprland.extraConfig = '' monitor=DP-2,1920x1080,0x0,1 monitor=HDMI-A-2,1920x1080,1920x0,1 diff --git a/modules/desktop/apps/editors/neovim.nix b/modules/desktop/apps/editors/neovim.nix index ee6424b..bc3ff86 100644 --- a/modules/desktop/apps/editors/neovim.nix +++ b/modules/desktop/apps/editors/neovim.nix @@ -24,7 +24,6 @@ in { }; home.packages = [ - pkgs.rnix-lsp pkgs.ccls pkgs.nodePackages.bash-language-server pkgs.texlab diff --git a/modules/desktop/apps/editors/vscode.nix b/modules/desktop/apps/editors/vscode.nix index f2db004..39c6e03 100644 --- a/modules/desktop/apps/editors/vscode.nix +++ b/modules/desktop/apps/editors/vscode.nix @@ -18,11 +18,10 @@ in { config = lib.mkIf (codeConf.enable) { home.manager.programs.vscode = { enable = true; - package = pkgs.vscode; + package = pkgs.vscode.fhs; extensions = with pkgs.vscode-extensions; [ catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons - ms-dotnettools.csharp ]; }; }; diff --git a/modules/desktop/apps/mpd.nix b/modules/desktop/apps/mpd.nix index e7af8c3..f37c465 100644 --- a/modules/desktop/apps/mpd.nix +++ b/modules/desktop/apps/mpd.nix @@ -18,7 +18,6 @@ in config = lib.mkIf (mpdConfig.enable) { home.packages = [ pkgs.mpc-cli - pkgs.ncmpcpp ]; services.mpd = { @@ -34,6 +33,11 @@ audio_output { }; systemd.services.mpd.environment = { XDG_RUNTIME_DIR = "/run/user/1000"; + }; + + home.manager.programs.ncmpcpp = { + enable = true; + mpdMusicDir = /home/jon/mus; }; }; } diff --git a/modules/desktop/apps/mutt-wizard.nix b/modules/desktop/apps/mutt-wizard.nix new file mode 100644 index 0000000..3b8a5db --- /dev/null +++ b/modules/desktop/apps/mutt-wizard.nix @@ -0,0 +1,26 @@ +{ + config, + options, + lib, + pkgs, + ... +}: let + muttConfig = config.modules.desktop.apps.mutt; +in +{ + options.modules.desktop.apps.mutt = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + }; + + config = lib.mkIf (muttConfig.enable) { + home.packages = [ + pkgs.neomutt + pkgs.isync + pkgs.lynx + pkgs.mutt-wizard + ]; + }; +} diff --git a/modules/desktop/apps/virt.nix b/modules/desktop/apps/virt.nix index 5851a0b..a9eaef4 100644 --- a/modules/desktop/apps/virt.nix +++ b/modules/desktop/apps/virt.nix @@ -16,6 +16,10 @@ in }; config = lib.mkIf (virtConfig.enable) { + home.packages = [ + pkgs.virtiofsd + ]; + virtualisation.libvirtd = { enable = true; qemu = { diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 5e35608..134d52f 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -135,13 +135,17 @@ in { }; }; }; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - config.common.default = ["wlr" "gtk"]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + config.common.default = ["wlr" "gtk" "hyprland" ]; }; home.manager.wayland.windowManager.hyprland = { enable = true; xwayland.enable = hyprlandConf.xwayland; + systemd.enable = true; settings = { "$mod" = "SUPER"; @@ -171,22 +175,41 @@ in { "swww img ${configDir}/hypr/wallpaper.png" ]; - env = [ + env = lib.mkMerge [ + ([ "XDG_CURRENT_DESKTOP,Hyprland" "XDG_SESSION_TYPE,wayland" "XDG_SESSION_DESKTOP,Hyprland" - "GDK_BACKEND=wayland,x11" - "QT_QPA_PLATFORM=wayland;xcb" - "CLUTTER_BACKEND=wayland" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "GDK_BACKEND,wayland,x11" + "SDL_VIDEODRIVER,wayland" + "CLUTTER_BACKEND,wayland" + "MOZ_ENABLE_WAYLAND,1" + "MOZ_DISABLE_RDD_SANDBOX,1" + "_JAVA_AWT_WM_NONREPARENTING,1" "QT_AUTO_SCREEN_SCALE_FACTOR,1" - - "SDL_VIDEODRIVER=wayland" + "QT_QPA_PLATFORM,wayland" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "disable_hyprland_logo=true" + "disable_hyprland_logo,true" "force_default_wallpaper,0" - ]; + ]) + ( lib.mkIf (config.modules.device.gpu == "nvidia") + [ + "GBM_BACKEND,nvidia" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "LIBVA_DRIVER_NAME,nvidia" + "NVD_BACKEND,direct" + "PROTON_ENABLE_NGX_UPDATER,1" + "__GL_GSYNC_ALLOWED,1" + "__GL_VRR_ALLOWED,1" + "__GL_MaxFramesAllowed,1" + "__NV_PRIME_RENDER_OFFLOAD,1" + "__VK_LAYER_NV_optimus,NIVIDA_only" + "WLR_DRM_NO_ATOMIC,1" + "WLR_USE_LIBINPUT,1" + "WLR_RENDERER_ALLOW_SOFTWARE,1" + ])]; decoration = decoration; animations = animations; @@ -209,16 +232,6 @@ in { security.pam.services.swaylock = {}; } - (lib.mkIf (device.gpu == "nvidia") { - home.manager.wayland.windowManager.hyprland.settings.env = [ - "GBM_BACKEND=nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME=nvidia" - "LIBVA_DRIVER_NAME=nvidia" - "__GL_GSYNC_ALLOWED" - "__GL_VRR_ALLOWED" - "WLR_DRM_NO_ATOMIC=1" - ]; - }) (lib.mkIf (config.modules.desktop.greetd.enable) { services.greetd.settings = { default_session.command = '' diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix index fd696ab..bb8b831 100644 --- a/modules/hardware/gpu.nix +++ b/modules/hardware/gpu.nix @@ -17,10 +17,8 @@ in { config = lib.mkIf (gpuConfig.enable) (lib.mkMerge [ { - hardware.opengl = { + hardware.graphics = { enable = true; - driSupport = true; - driSupport32Bit = true; }; } (lib.mkIf (device.gpu == "intel") { @@ -38,24 +36,31 @@ in { environment.variables.VDPAU_DRIVER = "va_gl"; }) (lib.mkIf (device.gpu == "nvidia") { + boot = { + extraModulePackages = [ + config.boot.kernelPackages.nvidia_x11_beta + ]; + initrd.kernelModules = [ + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; + blacklistedKernelModules = [ "nouveau" ]; + }; + + environment.systemPackages = with pkgs; [ + pkgs.nvidia-vaapi-driver + ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; + powerManagement.enable = true; open = false; nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.production; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; - boot.initrd.kernelModules = [ - "nvidia" - "nvidia_modeset" - "nvidia_uvm" - "nvidia_drm" - ]; - boot.extraModprobeConfig = '' - options nvidia-drm modeset=1 - ''; }) ]); } |