From 0f917ffd3e29f5a5f21e4d3c57dff81aee272550 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Mon, 12 Feb 2024 20:08:44 +0100 Subject: [PATCH] Minor config stuff idk anymore --- flake.nix | 4 +- home/config-files/hyprland.conf | 17 ++- home/config-files/wezterm.lua | 17 +-- home/default.nix | 92 ++++++++++++++++- home/modules/firefox.nix | 79 ++++++++++++++ home/modules/nixvim.nix | 176 ++++++++++++++++++++++++++++++++ hosts/lilith/default.nix | 1 - 7 files changed, 357 insertions(+), 29 deletions(-) create mode 100644 home/modules/firefox.nix create mode 100644 home/modules/nixvim.nix diff --git a/flake.nix b/flake.nix index a919c29..f89776e 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs @ {self, nixpkgs, nixpkgs-unstable, home-manager, nixos-hardware, nixvim, ...}: let + outputs = inputs @ {self, nixpkgs, nixpkgs-unstable, firefox-addons, home-manager, nixos-hardware, nixvim, ...}: let lib = nixpkgs.lib; util = (import ./overlays/util.nix {} {}).util; system = "x86_64-linux"; @@ -31,7 +31,7 @@ home-manager.useUserPackages = true; home-manager.extraSpecialArgs = inputs; - home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; }; + home-manager.users.xqtc = {...}: {imports = [ ./home ./home/firefox.nix nixvim.homeManagerModules.nixvim ]; }; } (lib.optionalString (host == "lilith") inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480) ]; diff --git a/home/config-files/hyprland.conf b/home/config-files/hyprland.conf index 5ea4cb6..07dec46 100644 --- a/home/config-files/hyprland.conf +++ b/home/config-files/hyprland.conf @@ -18,14 +18,14 @@ monitor=,preferred,auto,1 # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch -exec-once = waybar & hyprpaper & dunst & +exec-once = swww init & mako & # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { - kb_layout = de + kb_layout = us kb_variant = kb_model = kb_options = @@ -59,7 +59,7 @@ decoration { blur { size = 4 - passes = 1 + passes = 2 new_optimizations = on } @@ -103,14 +103,11 @@ gestures { # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic mouse V1 { - sensitivity = -0.5 -} # Example windowrule v1 windowrule = float, ^(wezterm)$ # Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +windowrulev2 = float,class:^(wezterm)$,title:^(wezterm)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more @@ -119,16 +116,18 @@ $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod SHIFT, return, exec, wezterm -bind = $mainMod SHIFT, U, exec, systemctl suspend; swaylock -k -F --image ~/Pictures/walls/1538974492308.png +bind = $mainMod SHIFT, U, exec, systemctl suspend; swaylock -k -F --image ~/dotfiles_new/walls/walls/nix-black-4k.png bind = $mainMod SHIFT, Q, killactive, bind = $mainMod SHIFT, X, exit, -bind = $mainMod, L, exec, swaylock --indicator --clock --effect-blur 7x5 -e -f -i ~/dotfiles_new/walls/walls/1685550590567432.png +bind = $mainMod, L, exec, swaylock --indicator --clock --effect-blur 7x5 -e -f -i ~/dotfiles_new/walls/walls/nix-black-4k.png bind = $mainMod SHIFT, SPACE, togglefloating, bind = $mainMod, P, exec, tofi-drun --drun-launch=true +bind = $mainMod SHIFT, P, exec, tofi-run --drun-launch=true bind = $mainMod SHIFT, P, exec, tofi, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod SHIFT, I, exec, grimshot copy area bind = $mainMod, N, exec, neovide +bind = $mainMod SHIFT, F, exec, firefox bind = $mainMod, Z, exec, zathura bind = ,XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% diff --git a/home/config-files/wezterm.lua b/home/config-files/wezterm.lua index ee59580..2ddbb2f 100644 --- a/home/config-files/wezterm.lua +++ b/home/config-files/wezterm.lua @@ -14,21 +14,7 @@ if getHostname() == "lilith" then else config.font_size = 11 end -config.window_background_opacity = .8 ---config.window_background_image = "/home/xqtc/dotfiles_new/walls/walls/SMT 40.png" - - ---config.window_background_image_hsb = { --- -- Darken the background image by reducing it to 1/3rd --- brightness = 0.1, --- --- -- You can adjust the hue by scaling its value. --- -- a multiplier of 1.0 leaves the value unchanged. --- hue = .8, --- --- -- You can adjust the saturation also. --- saturation = 1, ---} +config.window_background_opacity = .85 local arrowkeys = { [1] = { "LeftArrow", "left" }, [2] = "RightArrow", @@ -89,6 +75,7 @@ for i in pairs(arrowkeys) do }) end +config.hide_tab_bar_if_only_one_tab = true config.text_background_opacity = .4 config.enable_scroll_bar = false config.enable_tab_bar = true diff --git a/home/default.nix b/home/default.nix index dbe5621..5d52aab 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,7 +1,7 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, inputs, lib, ... }: { #imports = [ - # inputs.nixvim.homeManagerModules.nixvim + # ./firefox.nix #]; home.username = "xqtc"; home.homeDirectory = "/home/xqtc"; @@ -90,6 +90,83 @@ #}; #systemd.xqtc.sessionVariables = config.home-manager.users.xqtc.home.sessionVariables; + home.sessionVariables.DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox"; + + programs.firefox = { + enable = true; + package = pkgs.firefox.override { + cfg = { + enableGnomeExtensions = true; + }; + }; + }; +# profiles.xqtc = { +# isDefault = true; +# extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ +# ublock-origin +# bitwarden +# sidebery +# darkreader +# noscript +# ]; +# search = { +# default = "DuckDuckGo"; +# force = true; +# engines = { +# "Nix Packages" = { +# urls = [{ +# template = "https://search.nixos.org/packages"; +# params = [ +# { name = "type"; value = "packages"; } +# { name = "query"; value = "{searchTerms}"; } +# ]; +# }]; +# +# icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; +# definedAliases = [ "@np" ]; +# }; +# +# "NixOS Wiki" = { +# urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; +# iconUpdateURL = "https://nixos.wiki/favicon.png"; +# updateInterval = 24 * 60 * 60 * 1000; # every day +# definedAliases = [ "@nw" ]; +# }; +# +# "Bing".metaData.hidden = true; +# "Google".metaData.hidden = true; +# "DuckDuckGo".metaData.alias = "@ddg"; +# }; +# }; +# settings = { +# "app.normandy.first_run" = false; +# "app.shield.optoutstudies.enabled" = false; +# "privacy.donotttrackheader.enabled" = true; +# "browser.startup.homepage" = "https://start.duckduckgo.com"; +# "browser.search.region" = "DE"; +# "browser.search.isUS" = false; +# "browser.theme.content-theme" = "0"; +# "browser.theme.toolbar-theme" = "0"; +# "browser.newtabpage.activity-stream.showSponsored" = false; +# "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; +# "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored" = false; +# "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites" = false; +# "browser.toolbars.bookmarks.visibility" = "never"; +# "general.useragent.locale" = "de-DE"; +# "distribution.searchplugins.defaultLocale" = "de-DE"; +# "signon.rememberSignons" = false; +# "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Needed to allow userChrome.css +# }; +# userChrome = '' +# #TabsToolbar { +# display: none; !important +# } +# #sidebar-header { +# display: none; +# } +# ''; +# }; +# }; programs.nixvim = { enable = true; globals.mapleader = " "; @@ -272,6 +349,10 @@ #enableNvidiaPatches = true; extraConfig = builtins.readFile ./config-files/hyprland.conf; }; + services.mako = { + enable = true; + font = "Hack Nerd Font 15"; + }; #home.file."~/.config/hypr/hyprland.conf. @@ -287,6 +368,8 @@ sway-contrib.grimshot #zathura + libnotify + strace ltrace @@ -304,6 +387,7 @@ #schildichat-desktop qbittorrent + nicotine-plus neovide jetbrains.rust-rover @@ -315,6 +399,10 @@ spotify sayonara + mpv + + nixos-icons + swww ]; home.stateVersion = "23.11"; diff --git a/home/modules/firefox.nix b/home/modules/firefox.nix new file mode 100644 index 0000000..f58324c --- /dev/null +++ b/home/modules/firefox.nix @@ -0,0 +1,79 @@ +{ inputs, outputs, config, pkgs, ... }: { + + home.sessionVariables.DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox"; + + programs.firefox = { + enable = true; + package = pkgs.firefox.override { + cfg = { + enableGnomeExtensions = true; + }; + }; + profiles.xqtc = { + isDefault = true; + extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ + ublock-origin + bitwarden + sidebery + darkreader + noscript + ]; + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "DuckDuckGo".metaData.alias = "@ddg"; + }; + }; + settings = { + "app.normandy.first_run" = false; + "app.shield.optoutstudies.enabled" = false; + "privacy.donotttrackheader.enabled" = true; + "browser.startup.homepage" = "https://start.duckduckgo.com"; + "browser.search.region" = "DE"; + "browser.search.isUS" = false; + "browser.theme.content-theme" = "0"; + "browser.theme.toolbar-theme" = "0"; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored" = false; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.toolbars.bookmarks.visibility" = "never"; + "general.useragent.locale" = "de-DE"; + "distribution.searchplugins.defaultLocale" = "de-DE"; + "signon.rememberSignons" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Needed to allow userChrome.css + }; + userChrome = '' + #TabsToolbar { + display: none; !important + } + #sidebar-header { + display: none; + } + ''; + }; + }; +} diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix new file mode 100644 index 0000000..acb4f52 --- /dev/null +++ b/home/modules/nixvim.nix @@ -0,0 +1,176 @@ +{ pkgs, lib, config, inputs, outputs, ... }: +{ + programs.nixvim = { + enable = true; + globals.mapleader = " "; + extraConfigLua = builtins.readFile ../config-files/nvim/init.lua; + + clipboard.providers.wl-copy.enable = true; + + options = { + number = true; # Show line numbers + relativenumber = true; # Show relative line numbers + + shiftwidth = 2; # Tab width should be 2 + }; + + colorschemes.catppuccin.enable = true; + plugins = { + lualine.enable = true; + lsp-format = { + enable = true; + }; + lsp = { + enable = true; + servers = { + lua-ls.enable = true; + clangd.enable = true; + svelte.enable = true; + tsserver.enable = true; + eslint.enable = true; + rust-analyzer = { + enable = true; + installLanguageServer = false; + installCargo = false; + installRustc = false; + }; + nil_ls.enable = true; + }; + }; + gitsigns.enable = true; + fugitive.enable = true; + treesitter = { + enable = true; + folding = true; + indent = true; + nixvimInjections = true; + }; + treesitter-refactor = { + enable = true; + smartRename.enable = true; + highlightCurrentScope.enable = true; + navigation.enable = true; + }; + cursorline.enable = true; + #nvim-cmp = { + # enable = true; + # sources = [ + # {name = "nvim_lsp";} + # {name = "path";} + # {name = "buffer";} + # ]; + #}; + nvim-cmp = { + enable = true; + autoEnableSources = true; + sources = [ + {name = "nvim_lsp";} + {name = "path";} + {name = "buffer";} + {name = "luasnip";} + ]; + + snippet.expand = "luasnip"; + + mapping = { + "" = "cmp.mapping.confirm({ select = true })"; + "" = { + action = '' + function(fallback) + local luasnip = require 'luasnip' + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end + ''; + modes = [ "i" "s" ]; + }; + }; + }; + telescope.enable = true; + telescope.extensions = { + file_browser.enable = true; + }; + which-key.enable = true; + cmp-nvim-lsp.enable = true; + cmp-nvim-lua.enable = true; + noice.enable = true; + notify.enable = true; + luasnip.enable = true; + neo-tree.enable = true; + presence-nvim.enable = true; + crates-nvim.enable = true; + fidget.enable = true; + alpha = { + enable = true; + theme = "startify"; + }; + bufferline.enable = true; + }; + keymaps = [ + { + mode = "n"; + key = "ff"; + options.silent = true; + action = "Telescope file_browser"; + } + { + mode = "n"; + key = "bb"; + options.silent = true; + action = "Telescope buffers"; + } + { + mode = "n"; + key = "Gp"; + action = "Git pull"; + } + { + mode = "n"; + key = "GP"; + action = "Git push"; + } + { + mode = "n"; + key = "Gc"; + action = "Git commit"; + } + { + mode = "n"; + key = "Ga"; + action = "Git add ."; + } + { + mode = "n"; + key = "Gd"; + action = "Git diff"; + } + { + mode = "n"; + key = "nt"; + action = "Neotree toggle left"; + } + { + mode = "n"; + key = "P"; + action = "\"+p"; + } + { + mode = [ "n" "v" ]; + key = "y"; + action = "[[\"+y]]"; + } + { + mode = [ "n" ]; + key = "Y"; + action = "[[\"+Y]]"; + } + ]; + }; +} diff --git a/hosts/lilith/default.nix b/hosts/lilith/default.nix index bd26c31..d0c6fe6 100644 --- a/hosts/lilith/default.nix +++ b/hosts/lilith/default.nix @@ -127,7 +127,6 @@ vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget #git - firefox neovim gcc13 cargo