diff --git a/common/dunst.nix b/common/dunst.nix new file mode 100644 index 0000000..818061d --- /dev/null +++ b/common/dunst.nix @@ -0,0 +1,8 @@ +{ config, pkgs, inputs, ... }: + +{ + services.dunst = { + enable = true; + + }; +} diff --git a/common/hyprland.nix b/common/hyprland.nix index 49e4aaa..49638fe 100644 --- a/common/hyprland.nix +++ b/common/hyprland.nix @@ -8,12 +8,12 @@ ./wofi.nix # ./hypridle.nix # TODO: find out why these bitches not work # ./hyprlock.nix + ./dunst.nix ]; home.packages = with pkgs; [ hyprland # I always want these with hyprland anyways - dunst libnotify # to enable the notify-send command wl-clipboard diff --git a/common/nvim/init.lua b/common/nvim/init.lua index 8e58ceb..858c11b 100644 --- a/common/nvim/init.lua +++ b/common/nvim/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know how the Neovim basics, you can skip this step) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not sure exactly what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or neovim features used in kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your nvim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -174,11 +88,10 @@ vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagn -- or just use to exit terminal mode vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set("n", "", 'echo "Use h to move!!"') +vim.keymap.set("n", "", 'echo "Use l to move!!"') +vim.keymap.set("n", "", 'echo "Use k to move!!"') +vim.keymap.set("n", "", 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -569,12 +482,13 @@ require("lazy").setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { + -- TODO: see if there is a fun way to make these added and installed per project clangd = {}, gopls = {}, pyright = {}, - rust_analyzer = {}, html = { filetypes = { "html", "twig", "hbs" } }, templ = { filetypes = { "templ" } }, + nil_ls = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -585,7 +499,6 @@ require("lazy").setup({ -- htmx = { - cmd = { "/home/noa/Documents/programming/htmx-lsp/target/debug/htmx-lsp" }, filetypes = { "html" }, }, @@ -663,6 +576,8 @@ require("lazy").setup({ lua = { "stylua" }, -- Conform can also run multiple formatters sequentially python = { "black" }, + + go = { "gopls" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. diff --git a/common/nvim/nvim.nix b/common/nvim/nvim.nix index c9ce2cf..aafcfbd 100644 --- a/common/nvim/nvim.nix +++ b/common/nvim/nvim.nix @@ -4,6 +4,12 @@ home.packages = with pkgs; [ # needed for the nvim config, neovim itself is a system package already ripgrep + + # TODO: find how I can make this build dependencies only + gnumake + cargo + rustc + python3 ]; programs.neovim = { enable = true; @@ -11,7 +17,7 @@ viAlias = true; vimAlias = true; - extraConfig = lib.fileContents ./nvim.lua; + extraLuaConfig = lib.fileContents ./init.lua; }; programs.nixvim = { enable = false; diff --git a/common/waybar.nix b/common/waybar.nix index f57a7f8..9213285 100644 --- a/common/waybar.nix +++ b/common/waybar.nix @@ -11,7 +11,7 @@ mainBar = { layer = "top"; position = "top"; - height = 28; + height = 39; margin-top = 8; margin-left = 10; margin-right = 10; @@ -46,26 +46,10 @@ tooltip = false; }; "wireplumber" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "󰂯 {icon} {volume}% {format_source}"; - format-bluetooth-muted = "󰂯 󰝟 {format_source}"; - format-muted = "󰝟 {format_source}"; - format-source = "󰍬"; - format-source-muted = "󰍭"; - format-icons = { - headphone = "󰋋"; - hands-free = "󰋎"; - headset = "󰋎"; - phone = ""; - portable = ""; - car = "󰄋"; - default = [ - "󰕾" - "󰕾" - "󰕾" - ]; - }; - on-click = "pavucontrol"; # TODO: find an alternative + format = "{volume}% {icon}"; + format-muted = ""; + on-click = "helvum"; + format-icons = ["" "" ""]; }; "custom/vpn" = { format = "VPN"; @@ -209,6 +193,7 @@ #custom-media, #mode, #idle_inhibitor, + #custom-vpn, #scratchpad, #tray, #custom-updates, diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 483fa8c..8648b59 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -164,6 +164,27 @@ maxtime = "1h"; overalljails = true; }; + + jails = { + go-login.settings = { + enabled = true; + filter = "go-login"; + action = ''iptables-multiport[name=HTTP, port="http,https,2000"]''; + logpath = "/home/noa/Documents/programming/SODS/login.log"; + backend = "systemd"; + findtime = 600; + bantime = 600; + maxretry = 5; + }; + }; + + }; + + environment.etc = { + "fail2ban/filter.d/go-login.local".text = pkgs.lib.mkDefault (pkgs.lib.mkAfter '' + [Definition] + failregex=^time= level=WARN msg=".*?" ip= status=4\d\d$ + ''); }; boot.kernelModules = [ diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 21bb34d..40b8b52 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -55,7 +55,6 @@ # Programming langs go nodejs - rustup ]; diff --git a/hosts/server/home.nix b/hosts/server/home.nix index ec35cfb..40b928d 100644 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -42,7 +42,6 @@ # Programming langs go nodejs - rustup ];