From 6deaef9abf614436c500ac5cbcc45aa237866d84 Mon Sep 17 00:00:00 2001 From: Weckyy702 Date: Thu, 29 Jan 2026 14:19:33 +0100 Subject: [PATCH] 2026-01-29 --- configuration.nix | 32 +++++--- flake.nix | 62 ++++++++------- home/home.nix | 95 +++++++++++++---------- home/hyprland/settings.nix | 11 ++- home/nixvim/keymaps.nix | 2 +- home/nixvim/plugins/cmp/default.nix | 68 ++++++++-------- home/nixvim/plugins/cmp/keymaps.nix | 16 ++++ home/nixvim/plugins/lsp.nix | 8 ++ home/nixvim/plugins/telescope/keymaps.nix | 5 ++ 9 files changed, 180 insertions(+), 119 deletions(-) create mode 100644 home/nixvim/plugins/cmp/keymaps.nix diff --git a/configuration.nix b/configuration.nix index 0c4f07f..6a27079 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,17 +1,17 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ - config, - pkgs, - inputs, - hostname, - username, - ... +{ config +, pkgs +, inputs +, hostname +, username +, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + inputs.catppuccin.nixosModules.catppuccin ]; ## Boot @@ -70,11 +70,13 @@ fonts = { enableDefaultPackages = true; packages = with pkgs; [ - jetbrains-mono + nerd-fonts.jetbrains-mono ]; fontDir.enable = true; }; + catppuccin.enable = true; + programs.hyprland = { enable = true; xwayland.enable = true; @@ -89,6 +91,9 @@ protontricks = { enable = true; }; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + remotePlay.openFirewall = true; }; # Some programs need SUID wrappers, can be configured further or are @@ -105,7 +110,7 @@ users.users.${username} = { isNormalUser = true; - extraGroups = ["networkmanager" "wheel"]; + extraGroups = [ "networkmanager" "wheel" ]; shell = pkgs.zsh; }; @@ -125,7 +130,9 @@ }; # required for zsh completion - environment.pathsToLink = ["/share/zsh"]; + environment.pathsToLink = [ "/share/zsh" ]; + + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # List services that you want to enable: @@ -135,6 +142,11 @@ }; services.mullvad-vpn.enable = true; + services.pipewire = { + alsa.enable = true; + enable = true; + wireplumber.enable = true; + }; networking.firewall.enable = false; diff --git a/flake.nix b/flake.nix index b6839bd..1e52bb2 100644 --- a/flake.nix +++ b/flake.nix @@ -17,35 +17,37 @@ spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { - self, - nixpkgs, - home-manager, - nixvim, - ... - } @ inputs: { - nixosConfigurations.keith = let - hostname = "keith"; - username = "weckyy702"; - specialArgs = { - inherit inputs; - inherit hostname; - inherit username; - }; - in - nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./configuration.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + outputs = + { self + , nixpkgs + , home-manager + , catppuccin + , nixvim + , ... + } @ inputs: { + nixosConfigurations.keith = + let + hostname = "keith"; + username = "weckyy702"; + specialArgs = { + inherit inputs; + inherit hostname; + inherit username; + }; + in + nixpkgs.lib.nixosSystem { + inherit specialArgs; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = specialArgs; - home-manager.users.${username} = import ./home/home.nix; - } - ]; - }; - }; + home-manager.extraSpecialArgs = specialArgs; + home-manager.users.${username} = import ./home/home.nix; + } + ]; + }; + }; } diff --git a/home/home.nix b/home/home.nix index ba9818c..52c88e9 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,9 +1,8 @@ -top @ { - config, - pkgs, - username, - inputs, - ... +top @ { config +, pkgs +, username +, inputs +, ... }: { imports = [ inputs.nixvim.homeModules.nixvim @@ -20,15 +19,19 @@ top @ { home.packages = with pkgs; [ mpv - bitwarden-desktop feh grim slurp xdg-user-dirs + hyprpicker libqalculate + btop xfce.thunar prismlauncher playerctl + signal-desktop + qbittorrent + unzip ]; catppuccin.enable = true; @@ -44,7 +47,7 @@ top @ { settings = (import ./hyprland/settings.nix) top; }; - #TODO: decide on waybar + programs.zathura.enable = true; programs.direnv = { enable = true; @@ -60,28 +63,38 @@ top @ { ]; }; - programs.spicetify = let - spkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in { - enable = true; - enabledExtensions = with spkgs.extensions; [ - fullAppDisplay - shuffle - aiBandBlocker - ]; - enabledCustomApps = with spkgs.apps; [ - newReleases - ]; - theme = spkgs.themes.catppuccin; - colorScheme = "mocha"; - }; + programs.spicetify = + let + spkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + in + { + enable = true; + enabledExtensions = with spkgs.extensions; [ + fullAppDisplay + shuffle + aiBandBlocker + ]; + enabledCustomApps = with spkgs.apps; [ + newReleases + ]; + theme = spkgs.themes.catppuccin; + colorScheme = "mocha"; + }; - programs.vesktop = { - enable = true; - vencord.useSystem = true; - }; + programs.vesktop.enable = true; - programs.wofi.enable = true; + programs.rofi = { + enable = true; + modes = [ + "combi" + "drun" + "calc" + "ssh" + ]; + plugins = [ + pkgs.rofi-calc + ]; + }; programs.zsh = { enable = true; # For automatic login @@ -153,19 +166,23 @@ top @ { services.hyprpaper = { enable = true; - settings = let - # TODO: this should be done more cleanly - wallpaper_path = ./hyprland/horizontal_16x9.png; - in { - preload = toString wallpaper_path; - wallpaper = [ - #TODO: this should be dynamic - "DP-1,${wallpaper_path}" - "HDMI-A-1,${wallpaper_path}" - ]; - }; + settings = + let + # TODO: this should be done more cleanly + wallpaper_path = ./hyprland/horizontal_16x9.png; + in + { + preload = "${wallpaper_path}"; + wallpaper = [ + #TODO: this should be dynamic + "DP-1,${wallpaper_path}" + "HDMI-A-1,${wallpaper_path}" + ]; + }; }; + services.dunst.enable = true; + services.hyprpolkitagent.enable = true; services.ssh-agent = { diff --git a/home/hyprland/settings.nix b/home/hyprland/settings.nix index a8031ef..ea95476 100644 --- a/home/hyprland/settings.nix +++ b/home/hyprland/settings.nix @@ -1,4 +1,4 @@ -{...}: { +{ ... }: { "$mod" = "SUPER"; "$browser" = "zen"; "$term" = "kitty"; @@ -12,8 +12,7 @@ resize_on_border = true; }; - snap = { - }; + snap = { }; input = { kb_layout = "de"; @@ -24,7 +23,7 @@ [ "$mod, Q, exit" "$mod, Return, exec, $term" - "$mod, D, exec, wofi --show drun" + "$mod, D, exec, rofi -show drun -modes drun,calc" "$mod, F2, exec, $browser" "$mod, c, killactive" "$mod, f, fullscreen" @@ -41,8 +40,8 @@ ] ++ # Switch workspaces - (map (i: "$mod, ${builtins.toString i}, workspace, ${builtins.toString i}") [1 2 3 4 5 6 7 8 9]) - ++ (map (i: "$mod+SHIFT, ${builtins.toString i}, movetoworkspacesilent, ${builtins.toString i}") [1 2 3 4 5 6 7 8 9]); + (map (i: "$mod, ${builtins.toString i}, workspace, ${builtins.toString i}") [ 1 2 3 4 5 6 7 8 9 ]) + ++ (map (i: "$mod+SHIFT, ${builtins.toString i}, movetoworkspacesilent, ${builtins.toString i}") [ 1 2 3 4 5 6 7 8 9 ]); bindm = [ "$mod, mouse:272, movewindow" diff --git a/home/nixvim/keymaps.nix b/home/nixvim/keymaps.nix index bf08bb9..604c144 100644 --- a/home/nixvim/keymaps.nix +++ b/home/nixvim/keymaps.nix @@ -1,4 +1,4 @@ -{...}: { +{ ... }: { programs.nixvim.globals.mapleader = " "; programs.nixvim.keymaps = [ diff --git a/home/nixvim/plugins/cmp/default.nix b/home/nixvim/plugins/cmp/default.nix index 0dbcf1e..dd19d2a 100644 --- a/home/nixvim/plugins/cmp/default.nix +++ b/home/nixvim/plugins/cmp/default.nix @@ -1,40 +1,42 @@ {...}: { + imports = [ + ./keymaps.nix + ]; + programs.nixvim.plugins = { lspkind.enable = true; - blink-cmp.enable = true; + cmp-nvim-lsp-signature-help.enable = true; - # cmp-nvim-lsp-signature-help.enable = true; - # - # cmp = { - # enable = true; - # autoEnableSources = true; - # autoLoad = true; - # - # settings.sources = [ - # { name = "nvim_lsp"; } - # { name = "nvim_lsp_signature_help"; } - # { name = "path"; } - # ]; - # - # settings.mapping = { - # "" = "cmp.mapping.select_next_item()"; - # "" = "cmp.mapping.select_prev_item()"; - # "" = "cmp.mapping.complete()"; - # "" = "cmp.mapping.close()"; - # "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; - # }; - # }; - # - # lsp-format.enable = true; - # - # none-ls = { - # enable = true; - # enableLspFormat = true; - # sources.formatting = { - # alejandra.enable = true; - # nixpkgs_fmt.enable = true; - # }; - # }; + cmp = { + enable = true; + autoEnableSources = true; + autoLoad = true; + + settings.sources = [ + {name = "nvim_lsp";} + {name = "nvim_lsp_signature_help";} + {name = "path";} + ]; + + settings.mapping = { + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; + }; + }; + + lsp-format.enable = true; + + none-ls = { + enable = true; + enableLspFormat = true; + sources.formatting = { + alejandra.enable = true; + nixpkgs_fmt.enable = true; + }; + }; }; } diff --git a/home/nixvim/plugins/cmp/keymaps.nix b/home/nixvim/plugins/cmp/keymaps.nix new file mode 100644 index 0000000..7eaa941 --- /dev/null +++ b/home/nixvim/plugins/cmp/keymaps.nix @@ -0,0 +1,16 @@ +{...}: { + programs.nixvim.keymaps = [ + { + key = "grd"; + action = "Telescope lsp_definitions"; + mode = "n"; + options.desc = "LSP: [G]oto [D]efinition"; + } + { + key = "gri"; + action = "Telescope lsp_implementations"; + mode = "n"; + options.desc = "LSP: [G]oto [I]mplementations"; + } + ]; +} diff --git a/home/nixvim/plugins/lsp.nix b/home/nixvim/plugins/lsp.nix index 19af75a..45faba5 100644 --- a/home/nixvim/plugins/lsp.nix +++ b/home/nixvim/plugins/lsp.nix @@ -22,6 +22,14 @@ }; rnix.enable = true; }; + + keymaps = [ + { + key = "e"; + action = "lua vim.diagnostic.open_float()"; + options.desc = "Open Diagnostics"; + } + ]; }; plugins.lspconfig.enable = true; diff --git a/home/nixvim/plugins/telescope/keymaps.nix b/home/nixvim/plugins/telescope/keymaps.nix index 5cdca56..c95f76c 100644 --- a/home/nixvim/plugins/telescope/keymaps.nix +++ b/home/nixvim/plugins/telescope/keymaps.nix @@ -15,5 +15,10 @@ action = "Telescope grep_string"; options.desc = "[S]earch current [W]ord"; } + { + key = "q"; + action = "Telescope diagnostics"; + options.desc = "Lsp Diagnostics"; + } ]; }