Skip to content

Commit

Permalink
home: add dunst and nvim dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
savalet committed Apr 24, 2024
1 parent aed61ab commit a2d82e6
Show file tree
Hide file tree
Showing 13 changed files with 312 additions and 2 deletions.
4 changes: 2 additions & 2 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
imports = [
./hyprland
./dunst
./nvim
];

nixpkgs.config.allowUnfree = true;
Expand All @@ -18,7 +20,6 @@
lazygit
vim
wget
neovim
ripgrep
btop
htop
Expand All @@ -32,7 +33,6 @@
xfce.thunar
hyprpaper
waybar
dunst
playerctl
python3
python311Packages.pip
Expand Down
9 changes: 9 additions & 0 deletions home/dunst/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ dunst ];

home.file.dunst= {
source = ./dunstrc;
target = ".config/dunst/dunstrc";
};
}
56 changes: 56 additions & 0 deletions home/dunst/dunstrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[global]
follow = mouse
indicate_hidden = yes

offset = 3x3

separator_height = 2

padding = 6
horizontal_padding = 6
text_icon_padding = 0
frame_width = 1

frame_color = "#33d4ee"
separator_color = frame

sort = yes
idle_threshold = 120
font = JetbrainsMono 10
line_height = 0
markup = full
alignment = left
vertical_alignment = center
show_age_threshold = 60
word_wrap = yes
stack_duplicates = true
hide_duplicate_count = false

show_indicators = yes

min_icon_size = 0
max_icon_size = 64

icon_path = /usr/share/icons/Gruvbox-Plus-Dark/status/16/:/usr/share/icons/Gruvbox-Plus-Dark/devices/16/:/usr/share/icons/Gruvbox-Plus-Dark/actions/16/:/usr/share/icons/Gruvbox-Plus-Dark/animations/22/:/usr/share/icons/Gruvbox-Plus-Dark/apps/16/:/usr/share/icons/Gruvbox-Plus-Dark/categories/16/:/usr/share/icons/Gruvbox-Plus-Dark/devices/16/:/usr/share/icons/Gruvbox-Plus-Dark/emotes/16/:/usr/share/icons/Gruvbox-Plus-Dark/mimetypes/16/:/usr/share/icons/Gruvbox-Plus-Dark/panel/16/:/usr/share/icons/Gruvbox-Plus-Dark/places/16/

dmenu = /usr/bin/wofi -d dunst:
browser = /usr/bin/firefox --new-tab

title = Dunst
class = Dunst

corner_radius = 2
timeout = 7

[urgency_low]
background = "#282828"
foreground = "#2cbed6"

[urgency_normal]
background = "#282828"
foreground = "#2cbed6"

[urgency_critical]
background = "#282828"
foreground = "#2cbed6"
frame_color = "#FB4943"
10 changes: 10 additions & 0 deletions home/nvim/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ neovim ];

home.file.nvim= {
source = ./src;
target = ".config/nvim";
recursive = true;
};
}
40 changes: 40 additions & 0 deletions home/nvim/src/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "

-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

if not vim.loop.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end

vim.opt.rtp:prepend(lazypath)

local lazy_config = require "configs.lazy"

-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
config = function()
require "options"
end,
},

{ import = "plugins" },
}, lazy_config)

-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")

require "nvchad.autocmds"

vim.schedule(function()
require "mappings"
end)
vim.wo.relativenumber = true
29 changes: 29 additions & 0 deletions home/nvim/src/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" },
"NvChad": { "branch": "v2.5", "commit": "6833c60694a626615911e379d201dd723511546d" },
"base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
"copilot.vim": { "branch": "release", "commit": "7097b09e52621a97d11f254e04de5e5a0f26e5f5" },
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"gitsigns.nvim": { "branch": "main", "commit": "c097cb255096f333e14d341082a84f572b394fa2" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" },
"nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" },
"nvim-treesitter": { "branch": "master", "commit": "b0ac1135fe304edd34e18204304906744db0fe63" },
"nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" },
"ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}
16 changes: 16 additions & 0 deletions home/nvim/src/lua/chadrc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua

---@type ChadrcConfig
local M = {}

M.ui = {
theme = "tokyonight",

-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}

return M
15 changes: 15 additions & 0 deletions home/nvim/src/lua/configs/conform.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},

-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}

require("conform").setup(options)
47 changes: 47 additions & 0 deletions home/nvim/src/lua/configs/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },

ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},

performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}
23 changes: 23 additions & 0 deletions home/nvim/src/lua/configs/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities

local lspconfig = require "lspconfig"
local servers = { "html", "cssls" }

-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end

-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
10 changes: 10 additions & 0 deletions home/nvim/src/lua/mappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "nvchad.mappings"

-- add yours here

local map = vim.keymap.set

map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")

-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
6 changes: 6 additions & 0 deletions home/nvim/src/lua/options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require "nvchad.options"

-- add yours here!

-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
49 changes: 49 additions & 0 deletions home/nvim/src/lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
{
"github/copilot.vim",
lazy = false,
config = function()
-- Mapping tab is already used by NvChad
vim.g.copilot_no_tab_map = true;
vim.g.copilot_assume_mapped = true;
vim.g.copilot_tab_fallback = "";
-- The mapping is set to other key, see custom/lua/mappings
-- or run <leader>ch to see copilot mapping section
end
},
-- These are some examples, uncomment them if you want to see them work!
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- require("nvchad.configs.lspconfig").defaults()
-- require "configs.lspconfig"
-- end,
-- },
--
-- {
-- "williamboman/mason.nvim",
-- opts = {
-- ensure_installed = {
-- "lua-language-server", "stylua",
-- "html-lsp", "css-lsp" , "prettier"
-- },
-- },
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}

0 comments on commit a2d82e6

Please sign in to comment.