initial configuration

This commit is contained in:
2024-03-09 17:18:36 +01:00
commit b51cdf718a
41 changed files with 1741 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
{ pkgs, ... }:
{
imports = [
./waybar.nix
./hyprpaper.nix
./hyprlock.nix
./hypridle.nix
./fixes.nix
];
home.packages = with pkgs; [
rofi
kitty
wev
brightnessctl
playerctl
wl-clipboard
grimblast
nwg-bar
powertop
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
settings = {
monitor = ",preferred,auto,1.566667";
exec-once = [
"waybar"
"hyprpaper"
];
"$mod" = "SUPER";
input = {
follow_mouse = 2;
touchpad = {
natural_scroll = true;
clickfinger_behavior = true;
};
};
general = {
gaps_in = "5";
gaps_out = "10";
border_size = "2";
"col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg";
"col.inactive_border" = "rgba(0a3543aa)";
layout = "dwindle";
};
decoration = {
rounding = "5";
drop_shadow = "false";
blur.enabled = "false";
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
gestures = {
workspace_swipe = "on";
workspace_swipe_distance = "200";
};
misc = {
vfr = "true";
};
bind = [
"$mod, Q, exec, kitty"
"$mod, SPACE, exec, rofi -show drun"
",Print, exec, grimblast copy area"
"$mod,ESCAPE, exec, nwg-bar"
"$mod, C, killactive"
"$mod, V, togglefloating"
"$mod, F, fullscreen, 0"
"$mod, M, fullscreen, 1"
"$mod, L, exec, hyprlock"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
"$mod ALT, h, resizeactive, -20 0"
"$mod ALT, l, resizeactive, 20 0"
"$mod ALT, k, resizeactive, 0 -20"
"$mod ALT, j, resizeactive, 0 20"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
];
bindle = [
# Volume control
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
# Brightness control
",XF86MonBrightnessUp, exec, brightnessctl set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl set 5%-"
];
bindl= [
# Toggle audio mute
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Media control
",XF86AudioPlay, exec, playerctl play-pause"
",XF86AudioNext, exec, playerctl next"
",XF86AudioPrev, exec, playerctl previous"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,22 @@
{ ... }:
{
home.file.".config/electron-flags.conf" = {
enable = true;
executable = false;
text =''
--enable-features=UseOzonePlatform --ozone-platform=wayland
'';
};
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
programs.bash = {
enable = true;
#sessionVariables = {
# NIXOS_OZONE_WL = "1";
#};
};
}

View File

@@ -0,0 +1,35 @@
{ inputs, pkgs, ... }:
{
imports = [
inputs.hypridle.homeManagerModules.default
];
services.hypridle = {
enable = true;
lockCmd = "pidof ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock || ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
beforeSleepCmd = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # lock before suspend.
afterSleepCmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
listeners = [
{
timeout = 120; # 2.5min.
onTimeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
onResume = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
{
timeout = 300; # 5min
onTimeout = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock";
}
{
timeout = 380; # 5.5min
onTimeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; # screen off when timeout has passed
onResume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = 600; # 30min
onTimeout = "systemctl suspend"; # suspend pc
}
];
};
}

View File

@@ -0,0 +1,42 @@
{ inputs, config, ... }:
{
imports = [
inputs.hyprlock.homeManagerModules.default
];
programs.hyprlock = {
enable = true;
backgrounds = [
{
monitor = "";
path = "$HOME/Pictures/wallpaper-2.png";
blur_passes = 1;
}
];
input-fields = [{
monitor = "";
size = {
width = 400;
};
fade_on_empty = false;
dots_size = 0.3;
dots_center = true;
outline_thickness = -1;
outer_color = "0xff${config.colorScheme.palette.base05}";
inner_color = "0xff${config.colorScheme.palette.base00}";
font_color = "0xff${config.colorScheme.palette.base05}";
placeholder_text = "<i>Press enter for fingerprint</i>";
position.x = 0;
position.y = -50;
}];
labels = [{
font_size = 80;
color = "0xff${config.colorScheme.palette.base06}";
position.x = 0;
position.y = 250;
font_family = "DejaVuSansM Nerd Font Mono";
text = "$TIME";
}];
};
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
hyprpaper
];
home.file.".config/hypr/hyprpaper.conf" = {
enable = true;
executable = false;
text =''
preload = ~/Pictures/wallpaper.png
preload = ~/Pictures/wallpaper-1.png
preload = ~/Pictures/wallpaper-2.png
wallpaper = eDP-1,~/Pictures/wallpaper-2.png
ipc = off
'';
};
}

View File

@@ -0,0 +1,142 @@
{ ... }:
{
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [
"clock"
];
modules-right = [
"tray"
"pulseaudio"
"battery"
];
# Modules left
"hyprland/workspaces" = {
"format" = "{icon}";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
"on-click" = "activate";
"persistent-workspaces" = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
"7" = [];
"8" = [];
};
"format-icons" = {
"default" = "";
"empty" = "";
"active" = "";
};
};
"hyprland/window" = {
"max-length" = 200;
"seperate-outputs" = true;
};
# Modules middle
"clock" = {
"interval" = 1;
"format" = "{:%a %d %b | %H:%M:%S}";
};
# Modules right
"tray" = {
"spacing" = 10;
"icon-size" = 21;
};
"battery" = {
"bat" = "BAT1";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{icon} {capacity}%";
"format-icons" = [ "" "" "" "" "" ];
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "󰝟";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" ""];
};
"scroll-step" = 1;
"on-click" = "pavucontrol";
"ignored-sinks" = ["Easy Effects Sink"];
};
};
};
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: DejaVuSansM Nerd Font;
}
#workspaces,#window,#clock,#battery,#tray,#pulseaudio {
background-color: @theme_bg_color;
border-radius: 50px;
padding: 0px 15px;
margin: 5px 3px 0px 3px;
}
#workspaces {
margin-left: 10px;
padding: 0px 5px;
font-size: 15px;
}
window#waybar.empty #window {
background-color: transparent;
}
window#waybar {
background-color: transparent;
font-size: 12px;
}
#workspaces button.active {
color: @theme_text_color;
}
#workspaces button {
color: shade(@theme_text_color, 0.5);
padding: 2px 5px;
}
#battery {
margin-right: 10px;
}
#battery.warning {
background-color: #ff8000;
}
#battery.critical {
background-color: #f00;
}
'';
};
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ...}:
{
home.packages = with pkgs; [
libreoffice
onlyoffice-bin
];
}

View File

@@ -0,0 +1,83 @@
{ inputs, pkgs, ... }:
{
programs.firefox = {
enable = true;
profiles.xeovalyte = {
search.engines = {
"Nix" = {
urls = [{
template = "https://mynixos.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nix" ];
};
"SearXNG" = {
urls = [{
template = "https:/search.xeovalyte.dev/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@searxng" ];
};
"Startpage" = {
urls = [{
template = "https:/startpage.com/sp/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
definedAliases = [ "@sp" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.hidden = true;
"eBay".metaData.hidden = true;
};
search.force = true;
search.default = "SearXNG";
settings = {
"browser.disableResetPrompt" = true;
"browser.download.panel.shown" = true;
"browser.download.useDownloadDir" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.shell.checkDefaultBrowser" = false;
"browser.shell.defaultBrowserCheckCount" = 1;
"dom.security.https_only_mode" = true;
"privacy.trackingProtection.enabled" = true;
"browser.toolbars.bookmarks.visibility" = "never";
"browser.translations.neverTranslateLanguages" = "nl";
"browser.newtabpage.pinned" = [
{
label = "Server";
url = "https://home.xeovalyte.dev";
}
{
label = "Youtube";
url = "https://youtube.com";
}
{
label = "Schoolportaal";
url = "https://coenecoopcollege.sharepoint.com/";
}
];
"signon.rememberSignons" = false;
};
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
bitwarden
ublock-origin
];
};
};
}

View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
lazygit
];
programs.git = {
enable = true;
userEmail = "me+gitea@xeovalyte.dev";
userName = "xeovalyte";
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/gitea.pub";
};
};
}

View File

@@ -0,0 +1,13 @@
{ pkgs, config, ... }:
{
programs.kitty = {
enable = true;
settings = {
foreground = "#${config.colorScheme.palette.base05}";
background = "#${config.colorScheme.palette.base00}";
background_opacity = "0.6";
font_family = "DejaVuSansM Nerd Font Mono";
};
};
}

View File

@@ -0,0 +1,12 @@
{ inputs, pkgs, ... }:
{
nix.settings = {
substituters = ["https://getchoo.cachix.org"];
trusted-public-keys = ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="];
};
home.packages = with inputs.getchoo.packages.${pkgs.system}; [
modrinth-app
];
}

View File

@@ -0,0 +1,11 @@
local api = vim.api
api.nvim_create_autocmd(
"FileType",
{ pattern = "markdown", command = "setlocal spell" }
)
api.nvim_create_autocmd(
"FileType",
{ pattern = "markdown", command = "setlocal complete+=kspell" }
)

View File

@@ -0,0 +1,4 @@
require('onedark').setup {
style = 'deep'
}
require('onedark').load()

View File

@@ -0,0 +1,126 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
home.packages = with pkgs; [
ripgrep
marksman
wl-clipboard
];
programs.neovim =
let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in
{
enable = true;
coc = {
enable = false;
settings = {
languageserver = {
arduino = {
command = ["steam-run" "arduino-language-server"];
rootPatterns = ["*.ino"];
filetypes = ["arduino"];
args = ["-cli" "steam-run" "arduino-cli" "-clangd" "steam-run" "clangd" "-cli-config" "/home/xeovalyte/.arduino15/arduino-cli.yaml"];
};
};
};
};
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./keymaps.lua}
${builtins.readFile ./autocmd.lua}
'';
plugins = with pkgs.vimPlugins; [
nvim-web-devicons
{
plugin = nvim-autopairs;
config = toLua "require(\"nvim-autopairs\").setup{}";
}
{
plugin = telescope-nvim;
}
plenary-nvim
{
plugin = nvim-lspconfig;
config = toLuaFile ./plugins/lsp.lua;
}
neodev-nvim
mason-nvim
mason-lspconfig-nvim
which-key-nvim
rustaceanvim
lsp-inlayhints-nvim
nvim-dap
{
plugin = markdown-preview-nvim;
config = toLuaFile ./plugins/markdown-preview.lua;
}
{
plugin = nvim-cmp;
config = toLuaFile ./plugins/cmp.lua;
}
cmp_luasnip
cmp-nvim-lsp
luasnip
friendly-snippets
{
plugin = nvim-tree-lua;
config = toLuaFile ./plugins/nvim-tree.lua;
}
{
plugin = toggleterm-nvim;
config = toLuaFile ./plugins/toggleterm.lua;
}
{
plugin = (nvim-treesitter.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-bash
p.tree-sitter-json
p.tree-sitter-rust
p.tree-sitter-vue
p.tree-sitter-arduino
p.tree-sitter-html
p.tree-sitter-css
p.tree-sitter-javascript
]));
config = toLuaFile ./plugins/treesitter.lua;
}
{
plugin = onedark-nvim;
config = toLuaFile ./colorscheme.lua;
}
{
plugin = presence-nvim;
config = toLua "require(\"presence\").setup()";
}
{
plugin = bufferline-nvim;
config = toLuaFile ./plugins/bufferline.lua;
}
];
};
}

View File

@@ -0,0 +1,90 @@
local function map(mode, lhs, rhs, opts)
opts = opts or {}
opts.silent = opts.silent ~= false
if opts.remap and not vim.g.vscode then
opts.remap = nil
end
vim.keymap.set(mode, lhs, rhs, opts)
end
-- better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
-- Resize window using <ctrl> arrow keys
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
-- Move Lines
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
-- Clear search with <esc>
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
-- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua
map(
"n",
"<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / clear hlsearch / diff update" }
)
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
-- Add undo break-points
map("i", ",", ",<c-g>u")
map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u")
-- save file
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
--keywordprg
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- better indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- new file
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
-- Toggle NeoTree
map("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "Toggle file explorer" })
-- Telescope
map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Telescope find files" })
map("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Telescope find files" })
map("n", "<leader>fb", "<cmd>Telescope buffers<cr>", { desc = "Telescope find files" })
-- LSP
map("n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>", { desc = "Show diagnostics" })
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", { desc = "Show diagnostics" })
map("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", { desc = "Show diagnostics" })
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", { desc = "Show diagnostics" })
-- Buffers
map("n", "<Tab>", "<cmd>bn<cr>", { desc = "Cycle to next buffer" })
map("n", "<S-Tab>", "<cmd>bp<cr>", { desc = "Cycle to previous buffer" })
map("n", "bq", "<cmd>b#|bd#<cr>", { desc = "Close current buffer" })
map("n", "<leader>bq", "<cmd>BufferLineCloseOthers<cr>", { desc = "Close all other buffers" })

View File

@@ -0,0 +1,57 @@
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
local opt = vim.opt
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true })
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en", "nl" }
opt.spell = false -- Enable spell
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
if vim.fn.has("nvim-0.9.0") == 1 then
opt.splitkeep = "screen"
opt.shortmess:append({ C = true })
end
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]

View File

@@ -0,0 +1,12 @@
require('bufferline').setup{
options = {
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
separator = true -- use a "true" to enable the default, or set your own character
}
}
}
}

View File

@@ -0,0 +1,46 @@
local cmp = require('cmp')
local luasnip = require('luasnip')
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
}

View File

@@ -0,0 +1,42 @@
require("mason").setup{
PATH = "append",
}
require("mason-lspconfig").setup()
require('neodev').setup()
local lspconfig = require('lspconfig')
vim.g.rustaceanvim = {
inlay_hints = {
highlight = "NonText",
},
tools = {
hover_actions = {
auto_focus = true,
},
},
server = {
on_attach = function(client, bufnr)
require("lsp-inlayhints").on_attach(client, bufnr)
end,
},
}
lspconfig.tsserver.setup{}
lspconfig.spyglassmc_language_server.setup{}
lspconfig.arduino_language_server.setup{
cmd = {
"steam-run","arduino-language-server",
"-cli-config", "/home/xeovalyte/.arduino15/arduino-cli.yaml",
"-cli", "/usr/bin/arduino-cli",
"-clangd", "steam-run clangd"
}
}
lspconfig.tailwindcss.setup{}
lspconfig.volar.setup{}
lspconfig.marksman.setup{}

View File

@@ -0,0 +1,2 @@
vim.g.mkdp_auto_start = 0
vim.g.mkdp_auto_close = 0

View File

@@ -0,0 +1,20 @@
local function my_on_attach(bufnr)
local api = require "nvim-tree.api"
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
-- default mappings
api.config.mappings.default_on_attach(bufnr)
-- custom mappings
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
vim.keymap.set('n', '.', api.tree.change_root_to_node, opts('CD'))
end
-- pass to setup along with your other options
require("nvim-tree").setup {
on_attach = my_on_attach,
}

View File

@@ -0,0 +1,7 @@
require("toggleterm").setup{
open_mapping = [[<c-\>]],
direction = 'float',
float_opts = {
border = 'curved'
}
}

View File

@@ -0,0 +1,9 @@
require("nvim-treesitter.configs").setup{
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}

View File

@@ -0,0 +1,21 @@
{ pkgs, ... }:
{
programs.ssh = {
enable = true;
matchBlocks = {
archserver = {
hostname = "192.168.1.20";
user = "xeovalyte";
identityFile = "~/.ssh/archserver";
};
gitea = {
hostname = "gitea.xeovalyte.dev";
port = 2222;
user = "git";
identityFile = "~/.ssh/gitea";
};
};
};
}

View File

@@ -0,0 +1,2 @@
# Base16 themes
https://tinted-theming.github.io/base16-gallery/

View File

@@ -0,0 +1,9 @@
{ nix-colors, ... }:
{
imports = [
nix-colors.homeManagerModules.default
];
colorScheme = nix-colors.colorSchemes.da-one-sea;
}

View File

@@ -0,0 +1,35 @@
{ config, nix-colors, pkgs, lib, ... }:
let
inherit
(nix-colors.lib-contrib { inherit pkgs; })
gtkThemeFromScheme;
in
{
gtk = {
enable = true;
theme = {
name = "${config.colorScheme.slug}";
package = gtkThemeFromScheme { scheme = config.colorScheme; };
};
iconTheme = {
package = pkgs.qogir-icon-theme;
name = "Qogir-dark";
};
};
qt = {
enable = true;
platformTheme = "gtk";
style = {
name = "gtk2";
package = pkgs.qt6Packages.qt6gtk2;
};
};
home.pointerCursor = {
package = pkgs.phinger-cursors;
name = "phinger-cursors";
size = 24;
gtk.enable = true;
};
}

View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
noto-fonts
fira-code
font-awesome
(nerdfonts.override { fonts = [ "DejaVuSansMono" ]; })
];
}

View File

@@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
# Configure display manager
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --cmd Hyprland";
user = "xeovalyte";
};
};
};
# Configure networking
networking.networkmanager.enable = true;
networking.wireless.iwd.enable = true;
}

View File

@@ -0,0 +1,34 @@
{ ... }:
{
services.syncthing = {
enable = true;
user = "xeovalyte";
dataDir = "/home/xeovalyte";
overrideDevices = true;
overrideFolders = true;
openDefaultPorts = true;
settings = {
devices = {
"xv-server" = {
id = "DYBGKGM-I7JM6NG-EV7EGYY-NZL5WCG-CSDSJCJ-B4Q7AOP-5YVQYAZ-ETLQWA5";
addresses = [
"dynamic"
"tcp://ddns.xeovalyte.com:22000"
"quick://ddns.xeovalyte.com:22000"
];
};
};
folders = {
"xeovalyte-documents" = { # Name of folder in Syncthing, also the folder ID
path = "/home/xeovalyte/Documents"; # Which folder to add to Syncthing
devices = [ "xv-server" ]; # Which devices to share the folder with
};
"xeovalyte-logseq" = { # Name of folder in Syncthing, also the folder ID
path = "/home/xeovalyte/Logseq"; # Which folder to add to Syncthing
devices = [ "xv-server" ]; # Which devices to share the folder with
};
};
};
};
}

View File

@@ -0,0 +1,14 @@
{ pkgs, ... }:
{
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
services.gvfs.enable = true;
services.tumbler.enable = true;
}

View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
usbutils
neofetch
btop
git
];
}

View File

@@ -0,0 +1,33 @@
{ lib, pkgs, ... }:
{
services.fprintd.enable = true;
security.pam.services.hyprlock = {
text = ''
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so
auth include login
'';
};
security.pam.services.greetd = {
text = ''
account required pam_unix.so # unix (order 10900)
# Authentication management.
auth sufficient pam_unix.so likeauth nullok try_first_pass # unix (order 11600)
auth sufficient /nix/store/bz12s6mba297725i9y35p73lvsic8gd3-fprintd-1.94.2/lib/security/pam_fprintd.so # fprintd (order 11400)
auth required pam_deny.so # deny (order 12400)
# Password management.
password sufficient pam_unix.so nullok yescrypt # unix (order 10200)
# Session management.
session required pam_env.so conffile=/etc/pam/environment readenv=0 # env (order 10100)
session required pam_unix.so # unix (order 10200)
session required pam_loginuid.so # loginuid (order 10300)
session optional /nix/store/dzp7d4k1d94s1x49p9171mvcsfyxr7bj-systemd-254.6/lib/security/pam_systemd.so # systemd (order 12000) login
'';
};
}

View File

@@ -0,0 +1,11 @@
{ ... }:
{
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
nix.settings.auto-optimise-store = true;
}

View File

@@ -0,0 +1,18 @@
{ ... }:
{
services.auto-cpufreq.enable = true;
services.auto-cpufreq.settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
powerManagement.powertop.enable = true;
}