Init:start-nix

This commit is contained in:
dichgrem
2025-07-22 12:18:15 +08:00
parent 7ce7214a74
commit e57cdd246c
178 changed files with 22667 additions and 1 deletions

5
home/cli/alejandra.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
alejandra
];
}

5
home/cli/atuin.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.atuin = {
enable = true;
};
}

5
home/cli/deadnix.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
deadnix
];
}

6
home/cli/direnv.nix Normal file
View File

@@ -0,0 +1,6 @@
_: {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

5
home/cli/expect.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
expect
];
}

5
home/cli/fastfetch.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.fastfetch = {
enable = true;
};
}

6
home/cli/fd.nix Normal file
View File

@@ -0,0 +1,6 @@
_: {
programs.fd = {
enable = true;
hidden = true;
};
}

5
home/cli/fzf.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.fzf = {
enable = true;
};
}

5
home/cli/just.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
just
];
}

5
home/cli/nom.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
nix-output-monitor
];
}

5
home/cli/nushell.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.nushell = {
enable = true;
};
}

5
home/cli/onefetch.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
onefetch
];
}

5
home/cli/ripgrep.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.ripgrep = {
enable = true;
};
}

5
home/cli/starship.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.starship = {
enable = true;
};
}

5
home/cli/tesseract.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
tesseract
];
}

5
home/cli/zoxide.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.zoxide = {
enable = true;
};
}

35
home/default.nix Normal file
View File

@@ -0,0 +1,35 @@
{
hostname,
lib,
username,
...
}: let
inherit (import ../hosts/${hostname}/env.nix) StateVersion;
ls = lib.filesystem.listFilesRecursive;
in {
imports =
ls ./cli
++ ls ./gui
++ ls ./tui
++ ls ./wayland;
home = {
file = {
".config" = {
force = true;
recursive = true;
source = ../dotfiles/.config;
};
".local" = {
force = true;
recursive = true;
source = ../dotfiles/.local;
};
};
homeDirectory = "/home/${username}";
stateVersion = StateVersion;
username = "${username}";
};
programs.home-manager.enable = true;
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
peazip
];
}

View File

@@ -0,0 +1,52 @@
_: {
programs = {
floorp = {
enable = true;
languagePacks = ["en-US"];
policies = {
DisableAccounts = true;
DisableAppUpdate = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = "newtab";
DisplayMenuBar = "default-off";
DontCheckDefaultBrowser = true;
EnableTrackingProtection = {
Cryptomining = true;
Fingerprinting = true;
Locked = true;
Value = true;
};
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
Preferences = {
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"browser.formfill.enable" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.search.suggest.enabled" = false;
"browser.search.suggest.enabled.private" = false;
"browser.topsites.contile.enabled" = false;
"browser.urlbar.showSearchSuggestionsFirst" = false;
"browser.urlbar.suggest.searches" = false;
"extensions.pocket.enabled" = false;
"extensions.screenshots.disabled" = true;
};
SearchBar = "unified";
};
};
};
}

View File

@@ -0,0 +1,82 @@
{pkgs, ...}: {
home.packages = with pkgs; [
nil
nixd
zed-editor
];
# programs.zed-editor = {
# enable = true;
# package = pkgs.zed-editor-fhs;
# userSettings = {
# assistant = {
# enabled = false;
# version = "2";
# };
# auto_install_extensions = {
# catppuccin = true;
# catppucchin-icons = true;
# nix = true;
# };
# auto_update = false;
# base_keymap = "VSCode";
# features = {
# copilot = false;
# inline_completion_provider = "none";
# };
# hour_format = "hour24";
# icon_theme = {
# dark = "Catppuccin Mocha";
# light = "Catppuccin Mocha";
# mode = "system";
# };
# load_direnv = "shell_hook";
# lsp = {
# nix = {
# binary = {
# path_lookup = true;
# };
# };
# };
# show_whitespaces = "all";
# terminal = {
# alternate_scroll = "off";
# blinking = "off";
# button = false;
# copy_on_select = false;
# detect_venv = {
# on = {
# directories = [
# ".env"
# "env"
# ".venv"
# "venv"
# ];
# activate_script = "default";
# };
# };
# dock = "bottom";
# font_family = "JetBrainsMono Nerd Font";
# font_features = null;
# font_size = null;
# line_height = "comfortable";
# shell = "system";
# toolbar = {
# breadcrumbs = false;
# };
# option_as_meta = false;
# toolbar = {
# title = true;
# };
# working_directory = "current_project_directory";
# };
# theme = {
# dark = "Catppuccin Mocha";
# light = "Catppuccin Mocha";
# mode = "system";
# };
# vim_mode = false;
# };
# };
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
legcord
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
materialgram
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
foliate
];
}

View File

@@ -0,0 +1,14 @@
{pkgs, ...}: {
dconf.settings = {
"org/nemo/preferences" = {
"date-font-choice" = "no-mono";
"date-format" = "iso";
"default-folder-viewer" = "list-view";
"show-hidden-files" = true;
};
};
home.packages = with pkgs; [
nemo
];
}

View File

@@ -0,0 +1,6 @@
{pkgs, ...}: {
home.packages = with pkgs; [
syncthing
syncthingtray
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
oculante
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
localsend
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
vlc
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
strawberry
];
}

View File

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

View File

@@ -0,0 +1,6 @@
{pkgs, ...}: {
home.packages = with pkgs; [
git-credential-keepassxc
keepassxc
];
}

View File

@@ -0,0 +1,5 @@
_: {
programs.obs-studio = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
_: {
programs.alacritty = {
enable = true;
};
}

View File

@@ -0,0 +1,21 @@
{
hostname,
lib,
pkgs,
...
}: let
inherit (import ../../../hosts/${hostname}/env.nix) QEMU-VM-Use-Case;
in
with lib;
mkIf QEMU-VM-Use-Case {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
home.packages = with pkgs; [
virt-manager
];
}

5
home/tui/btop.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
btop
];
}

225
home/tui/nixvim/keymaps.nix Normal file
View File

@@ -0,0 +1,225 @@
_: {
programs.nixvim = {
extraConfigLua = ''
function ToggleLineNumber()
if vim.wo.number then
vim.wo.number = false
else
vim.wo.number = true
vim.wo.relativenumber = false
end
end
function ToggleRelativeLineNumber()
if vim.wo.relativenumber then
vim.wo.relativenumber = false
else
vim.wo.relativenumber = true
vim.wo.number = false
end
end
function ToggleWrap()
vim.wo.wrap = not vim.wo.wrap
end
if vim.lsp.inlay_hint then
vim.keymap.set('n', '<leader>uh', function()
vim.lsp.inlay_hint(0, nil)
end, { desc = 'Toggle Inlay Hints' })
end
'';
keymaps = [
{
action = "<cmd> norm! ggVG<cr>";
key = "<C-a>";
mode = "i";
options.desc = "Select all lines in buffer";
}
{
action = "<C-W>c";
key = "<leader>wd";
mode = "n";
options = {
desc = "Delete window";
silent = true;
};
}
{
action = "<C-W>s";
key = "<leader>-";
mode = "n";
options = {
desc = "Split window below";
silent = true;
};
}
{
action = "<C-W>v";
key = "<leader>|";
mode = "n";
options = {
desc = "Split window right";
silent = true;
};
}
{
action = "<cmd>m .+1<cr>==";
key = "<A-Down>";
mode = "n";
options.desc = "Move line down";
}
{
action = "<cmd>m .-2<cr>==";
key = "<A-Up>";
mode = "n";
options.desc = "Move line up";
}
{
action = "<cmd>quitall<cr><esc>";
key = "<leader>qq";
mode = "n";
options = {
desc = "Quit all";
silent = true;
};
}
{
action = "<cmd>w<cr><esc>";
key = "<C-s>";
mode = "n";
options = {
desc = "Save file";
silent = true;
};
}
{
action = "<C-w>j";
key = "<C-Down>";
mode = "n";
options.desc = "Move To Window Down";
}
{
action = "<C-w>h";
key = "<C-Left>";
mode = "n";
options.desc = "Move To Window Left";
}
{
action = "<C-w>l";
key = "<C-Right>";
mode = "n";
options.desc = "Move To Window Right";
}
{
action = "<C-w>k";
key = "<C-Up>";
mode = "n";
options.desc = "Move To Window Up";
}
{
action = "\"_d";
key = "<leader>D";
mode = [
"n"
"v"
];
options.desc = "Delete to void register";
}
{
action = "<cmd>noh<cr><esc>";
key = "<esc>";
mode = [
"n"
"i"
];
options = {
desc = "Escape and clear hlsearch";
silent = true;
};
}
{
action = ":lua ToggleLineNumber()<cr>";
key = "<leader>ul";
mode = "n";
options = {
desc = "Toggle Line Numbers";
silent = true;
};
}
{
action = ":lua ToggleRelativeLineNumber()<cr>";
key = "<leader>uL";
mode = "n";
options = {
desc = "Toggle Relative Line Numbers";
silent = true;
};
}
{
action = ":lua ToggleWrap()<cr>";
key = "<leader>uw";
mode = "n";
options = {
desc = "Toggle Line Wrap";
silent = true;
};
}
{
action = "\"+y";
key = "<leader>y";
mode = [
"n"
"v"
];
options.desc = "Copy to system clipboard";
}
{
action = ":m '>+1<cr>gv=gv";
key = "<A-Down>";
mode = "v";
options.desc = "Move line Down";
}
{
action = ":m '<-2<cr>gv=gv";
key = "<A-Up>";
mode = "v";
options.desc = "Move line up";
}
{
action = "<gv";
key = "<";
mode = "v";
}
{
action = ">gv";
key = ">";
mode = "v";
}
{
action = "\"_dP";
key = "p";
mode = "x";
options.desc = "Deletes to void register and paste over";
}
{
action = "mzJ`z";
key = "J";
mode = "n";
options.desc = "Allow cursor to stay in the same place after appending to current line ";
}
{
action = "Nzzzv";
key = "N";
mode = "n";
options.desc = "Allow search terms to stay in the middle";
}
{
action = "nzzzv";
key = "n";
mode = "n";
options.desc = "Allow search terms to stay in the middle";
}
];
};
}

View File

@@ -0,0 +1,61 @@
{inputs, ...}: {
imports = [inputs.nixvim.homeManagerModules.nixvim];
programs.nixvim = {
colorschemes = {
catppuccin = {
enable = true;
settings = {
background = {
dark = "mocha";
light = "macchiato";
};
flavour = "mocha";
integrations = {
cmp = true;
fidget = true;
lsp_trouble = true;
mini.enabled = true;
native_lsp = {
enabled = true;
inlay_hints = {
background = true;
};
underlines = {
errors = ["underline"];
hints = ["underline"];
information = ["underline"];
warnings = ["underline"];
};
virtual_text = {
errors = ["italic"];
hints = ["italic"];
information = ["italic"];
ok = ["italic"];
warnings = ["italic"];
};
};
neotree = true;
noice = true;
notify = true;
telescope.enabled = true;
treesitter = true;
treesitter_context = true;
which_key = true;
};
transparent_background = true;
};
};
};
defaultEditor = true;
enable = true;
enableMan = false;
globals = {
have_nerd_font = true;
mapleader = " ";
maplocalleader = " ";
};
performance = {
combinePlugins.enable = true;
};
};
}

44
home/tui/nixvim/opts.nix Normal file
View File

@@ -0,0 +1,44 @@
{pkgs, ...}: {
programs.nixvim = {
opts = {
breakindent = true;
clipboard = {
providers = {
wl-copy = {
enable = true;
package = pkgs.wl-clipboard-rs;
};
};
register = "unnamedplus";
};
cmdheight = 2;
cursorline = true;
encoding = "utf-8";
expandtab = true;
fileencoding = "utf-8";
grepformat = "%f:%l:%c:%m";
grepprg = "rg --vimgrep";
hlsearch = true;
ignorecase = true;
inccommand = "split";
list = true;
listchars.__raw = "{ tab = '» ', trail = '·', nbsp = '' }";
mouse = "a";
number = true;
pumheight = 0;
scrolloff = 8;
shiftwidth = 2;
showmode = false;
signcolumn = "yes";
smartcase = true;
softtabstop = 2;
splitbelow = true;
splitright = true;
tabstop = 2;
termguicolors = true;
timeoutlen = 250;
undofile = true;
updatetime = 50;
};
};
}

View File

@@ -0,0 +1,10 @@
_: {
programs.nixvim = {
plugins.nvim-autopairs = {
enable = true;
};
extraConfigLua = ''
require('cmp').event:on('confirm_done', require('nvim-autopairs.completion.cmp').on_confirm_done())
'';
};
}

View File

@@ -0,0 +1,175 @@
_: {
programs.nixvim = {
plugins = {
bufferline = {
enable = true;
settings = {
highlights = {
background = {
bg = "#252434";
fg = "#605f6f";
};
buffer_selected = {
bg = "#1E1D2D";
fg = "#D9E0EE";
};
buffer_visible = {
fg = "#605f6f";
bg = "#252434";
};
close_button = {
fg = "#605f6f";
bg = "#252434";
};
close_button_visible = {
fg = "#605f6f";
bg = "#252434";
};
duplicate = {
fg = "NONE";
bg = "#252434";
};
duplicate_selected = {
fg = "#F38BA8";
bg = "#1E1D2D";
};
duplicate_visible = {
fg = "#89B4FA";
bg = "#252434";
};
error = {
fg = "#605f6f";
bg = "#252434";
};
error_diagnostic = {
fg = "#605f6f";
bg = "#252434";
};
fill = {
bg = "#1E1D2D";
fg = "#605f6f";
};
indicator_selected = {
bg = "#1E1D2D";
fg = "#1E1D2D";
};
modified = {
fg = "#F38BA8";
bg = "#252434";
};
modified_visible = {
fg = "#F38BA8";
bg = "#252434";
};
modified_selected = {
fg = "#ABE9B3";
bg = "#1E1D2D";
};
separator = {
bg = "#252434";
fg = "#252434";
};
separator_visible = {
bg = "#252434";
fg = "#252434";
};
separator_selected = {
bg = "#252434";
fg = "#252434";
};
};
options.offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
};
};
};
keymaps = [
{
mode = "n";
key = "<C-Tab>";
action = "<cmd>BufferLineCycleNext<cr>";
options = {
desc = "Cycle to next buffer";
};
}
{
mode = "n";
key = "<C-S-Tab>";
action = "<cmd>BufferLineCyclePrev<cr>";
options = {
desc = "Cycle to previous buffer";
};
}
{
mode = "n";
key = "<C-x>";
action = "<cmd>:bp | bd #<cr>";
options = {
desc = "Delete buffer";
};
}
{
mode = "n";
key = "<leader>br";
action = "<cmd>BufferLineCloseRight<cr>";
options = {
desc = "Delete buffers to the right";
};
}
{
mode = "n";
key = "<leader>bl";
action = "<cmd>BufferLineCloseLeft<cr>";
options = {
desc = "Delete buffers to the left";
};
}
{
mode = "n";
key = "<leader>bo";
action = "<cmd>BufferLineCloseOthers<cr>";
options = {
desc = "Delete other buffers";
};
}
{
mode = "n";
key = "<leader>bp";
action = "<cmd>BufferLineTogglePin<cr>";
options = {
desc = "Toggle pin";
};
}
{
mode = "n";
key = "<leader>bP";
action = "<Cmd>BufferLineGroupClose ungrouped<CR>";
options = {
desc = "Delete non-pinned buffers";
};
}
];
};
}

View File

@@ -0,0 +1,44 @@
{pkgs, ...}: {
programs.nixvim = {
extraPackages = with pkgs; [
stylua
];
plugins.conform-nvim = {
enable = true;
settings = {
notify_on_error = false;
format_on_save = ''
function(bufnr)
-- Disable "format_on_save lsp_fallback" for lanuages that don't
-- have a well standardized coding style. You can add additional
-- lanuages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype]
}
end
'';
formatters_by_ft = {
lua = ["stylua"];
};
};
};
keymaps = [
{
mode = "";
key = "<leader>f";
action.__raw = ''
function()
require('conform').format { async = true, lsp_fallback = true }
end
'';
options = {
desc = "[F]ormat buffer";
};
}
];
};
}

View File

@@ -0,0 +1,7 @@
_: {
programs.nixvim = {
plugins.edgy = {
enable = true;
};
};
}

View File

@@ -0,0 +1,7 @@
_: {
programs.nixvim = {
plugins.indent-blankline = {
enable = true;
};
};
}

View File

@@ -0,0 +1,34 @@
_: {
programs.nixvim = {
plugins.lint = {
autoCmd = {
callback.__raw = ''
function()
require('lint').try_lint()
end
'';
group = "lint";
event = [
"BufEnter"
"BufWritePost"
"InsertLeave"
];
};
enable = true;
lintersByFt = {
nix = ["nix"];
markdown = [
"markdownlint"
];
};
};
autoGroups = {
lint = {
clear = true;
};
};
};
}

125
home/tui/nixvim/plugins/lsp.nix Executable file
View File

@@ -0,0 +1,125 @@
_: {
programs.nixvim = {
autoGroups = {
"kickstart-lsp-attach" = {
clear = true;
};
};
plugins = {
cmp-nvim-lsp.enable = true;
fidget.enable = true;
lsp = {
enable = true;
keymaps = {
diagnostic = {
"<leader>q" = {
action = "setloclist";
desc = "Open diagnostic [Q]uickfix list";
};
};
extra = [
{
mode = "n";
key = "gd";
action.__raw = "require('telescope.builtin').lsp_definitions";
options = {
desc = "LSP: [G]oto [D]efinition";
};
}
{
mode = "n";
key = "gr";
action.__raw = "require('telescope.builtin').lsp_references";
options = {
desc = "LSP: [G]oto [R]eferences";
};
}
{
mode = "n";
key = "gI";
action.__raw = "require('telescope.builtin').lsp_implementations";
options = {
desc = "LSP: [G]oto [I]mplementation";
};
}
{
mode = "n";
key = "<leader>D";
action.__raw = "require('telescope.builtin').lsp_type_definitions";
options = {
desc = "LSP: Type [D]efinition";
};
}
{
mode = "n";
key = "<leader>ds";
action.__raw = "require('telescope.builtin').lsp_document_symbols";
options = {
desc = "LSP: [D]ocument [S]ymbols";
};
}
{
mode = "n";
key = "<leader>ws";
action.__raw = "require('telescope.builtin').lsp_dynamic_workspace_symbols";
options = {
desc = "LSP: [W]orkspace [S]ymbols";
};
}
];
lspBuf = {
"<leader>rn" = {
action = "rename";
desc = "LSP: [R]e[n]ame";
};
"<leader>ca" = {
action = "code_action";
desc = "LSP: [C]ode [A]ction";
};
"gD" = {
action = "declaration";
desc = "LSP: [G]oto [D]eclaration";
};
};
};
servers = {
# clangd = {
# enable = true;
# };
# lua_ls = {
# enable = true;
# settings = {
# completion = {
# callSnippet = "Replace";
# };
# };
# };
# gopls = {
# enable = true;
# };
# pyright = {
# enable = true;
# };
# rust_analyzer = {
# enable = true;
# };
# ...etc. See `https://nix-community.github.io/nixvim/plugins/lsp` for a list of pre-configured LSPs
# Some languages (like typscript) have entire language plugins that can be useful:
# `https://nix-community.github.io/nixvim/plugins/typescript-tools/index.html?highlight=typescript-tools#pluginstypescript-toolspackage`
# But for many setups the LSP (`ts_ls`) will work just fine
ts_ls = {
enable = true;
};
};
};
};
};
}

View File

@@ -0,0 +1,23 @@
_: {
programs.nixvim = {
plugins.mini = {
enable = true;
modules = {
ai = {
n_lines = 500;
};
statusline = {
use_icons.__raw = "vim.g.have_nerd_font";
};
surround = {
};
};
};
extraConfigLua = ''
require('mini.statusline').section_location = function()
return '%2l:%-2v'
end
'';
};
}

View File

@@ -0,0 +1,56 @@
_: {
programs.nixvim = {
plugins.cmp = {
enable = true;
settings = {
completion = {
completeopt = "menu,menuone,noinsert";
};
mapping = {
"<C-n>" = "cmp.mapping.select_next_item()";
"<C-p>" = "cmp.mapping.select_prev_item()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-y>" = "cmp.mapping.confirm { select = true }";
"<C-Space>" = "cmp.mapping.complete {}";
"<C-l>" = ''
cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' })
'';
"<C-h>" = ''
cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' })
'';
};
snippet = {
expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
};
sources = [
{
name = "luasnip";
}
{
name = "nvim_lsp";
}
{
name = "path";
}
];
};
};
};
}

View File

@@ -0,0 +1,17 @@
_: {
programs.nixvim = {
plugins.nvim-tree = {
enable = true;
};
keymaps = [
{
key = "<C-\\>";
action = "<cmd>NvimTreeToggle<cr>";
options = {
desc = "NvimTree Toggle";
};
}
];
};
}

View File

@@ -0,0 +1,137 @@
_: {
programs.nixvim = {
plugins.telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
ui-select.enable = true;
};
keymaps = {
"<leader>sh" = {
mode = "n";
action = "help_tags";
options = {
desc = "[S]earch [H]elp";
};
};
"<leader>sk" = {
mode = "n";
action = "keymaps";
options = {
desc = "[S]earch [K]eymaps";
};
};
"<leader>sf" = {
mode = "n";
action = "find_files";
options = {
desc = "[S]earch [F]iles";
};
};
"<leader>ss" = {
mode = "n";
action = "builtin";
options = {
desc = "[S]earch [S]elect Telescope";
};
};
"<leader>sw" = {
mode = "n";
action = "grep_string";
options = {
desc = "[S]earch current [W]ord";
};
};
"<leader>sg" = {
mode = "n";
action = "live_grep";
options = {
desc = "[S]earch by [G]rep";
};
};
"<leader>sd" = {
mode = "n";
action = "diagnostics";
options = {
desc = "[S]earch [D]iagnostics";
};
};
"<leader>sr" = {
mode = "n";
action = "resume";
options = {
desc = "[S]earch [R]esume";
};
};
"<leader>s" = {
mode = "n";
action = "oldfiles";
options = {
desc = "[S]earch Recent Files ('.' for repeat)";
};
};
"<leader><leader>" = {
mode = "n";
action = "buffers";
options = {
desc = "[ ] Find existing buffers";
};
};
};
settings = {
extensions.__raw = "{ ['ui-select'] = { require('telescope.themes').get_dropdown() } }";
};
};
keymaps = [
{
mode = "n";
key = "<leader>/";
action.__raw = ''
function()
require('telescope.builtin').current_buffer_fuzzy_find(
require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false
}
)
end
'';
options = {
desc = "[/] Fuzzily search in current buffer";
};
}
{
mode = "n";
key = "<leader>s/";
action.__raw = ''
function()
require('telescope.builtin').live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files'
}
end
'';
options = {
desc = "[S]earch [/] in Open Files";
};
}
{
mode = "n";
key = "<leader>sn";
action.__raw = ''
function()
require('telescope.builtin').find_files {
cwd = vim.fn.stdpath 'config'
}
end
'';
options = {
desc = "[S]earch [N]eovim files";
};
}
];
};
}

View File

@@ -0,0 +1,66 @@
_: {
programs.nixvim = {
keymaps = [
{
action = "<cmd>2ToggleTerm<cr>";
key = "<C-g>";
mode = "t";
options.desc = "Open/Close Terminal 2";
}
{
action = "<cmd>wincmd j<cr>";
key = "<C-Down>";
mode = "t";
options.desc = "Go to Down window";
}
{
action = "<cmd>wincmd h<cr>";
key = "<C-Left>";
mode = "t";
options.desc = "Go to Left window";
}
{
action = "<cmd>wincmd l<cr>";
key = "<C-Right>";
mode = "t";
options.desc = "Go to Right window";
}
{
action = "<cmd>wincmd k<cr>";
key = "<C-Up>";
mode = "t";
options.desc = "Go to Up window";
}
];
plugins.toggleterm = {
enable = true;
settings = {
close_on_exit = true;
direction = "horizontal"; # 'vertical' | 'horizontal' | 'tab' | 'float'
float_opts = {
border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
height = 20;
width = 80;
winblend = 0;
};
hide_numbers = true;
insert_mappings = true;
open_mapping = "[[<C-/>]]";
persist_mode = true;
shade_terminals = true;
shell = "nu";
size = ''
function(term)
if term.direction == "horizontal" then
return 30
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end
'';
start_in_insert = true;
terminal_mappings = true;
};
};
};
}

View File

@@ -0,0 +1,35 @@
_: {
programs.nixvim = {
plugins.treesitter = {
enable = true;
settings = {
ensureInstalled = [
"bash"
"c"
"diff"
"html"
"lua"
"luadoc"
"markdown"
"markdown_inline"
"query"
"vim"
"vimdoc"
];
highlight = {
additional_vim_regex_highlighting = true;
enable = true;
};
indent = {
enable = true;
disable = [
"ruby"
];
};
};
};
};
}

View File

@@ -0,0 +1,189 @@
_: {
programs.nixvim = {
plugins = {
alpha = {
enable = true;
layout = let
padding = val: {
type = "padding";
inherit val;
};
in [
(padding 4)
{
opts = {
hl = "AlphaHeader";
position = "center";
};
type = "text";
val = [
" "
" "
" "
" "
" "
" "
];
}
(padding 6)
{
type = "button";
val = " Find File";
on_press.raw = "require('telescope.builtin').find_files";
opts = {
keymap = [
"n"
"f"
":Telescope find_files <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "f";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
(padding 1)
{
type = "button";
val = " New File";
on_press.__raw = "function() vim.cmd[[ene]] end";
opts = {
keymap = [
"n"
"n"
":ene <BAR> startinsert <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "n";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
(padding 1)
{
type = "button";
val = " Recent Files";
on_press.raw = "require('telescope.builtin').oldfiles";
opts = {
keymap = [
"n"
"r"
":Telescope oldfiles <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "r";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
(padding 1)
{
type = "button";
val = " Find Word";
on_press.raw = "require('telescope.builtin').live_grep";
opts = {
keymap = [
"n"
"w"
":Telescope live_grep <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "w";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
(padding 1)
{
type = "button";
val = "󱀸 Restore Session";
on_press.raw = "require('persistence').load()";
opts = {
keymap = [
"n"
"s"
":lua require('persistence').load()<cr>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "s";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
(padding 1)
{
type = "button";
val = "󰈆 Quit Neovim";
on_press.__raw = "function() vim.cmd[[qa]] end";
opts = {
keymap = [
"n"
"q"
":qa<CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "q";
position = "center";
cursor = 3;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
}
];
};
dressing.enable = true;
neoscroll.enable = true;
nui.enable = true;
persistence.enable = true;
todo-comments.enable = true;
trim.enable = true;
web-devicons.enable = true;
};
};
}

View File

@@ -0,0 +1,43 @@
_: {
programs.nixvim = {
plugins.which-key = {
enable = true;
settings = {
spec = [
{
__unkeyed-1 = "<leader>c";
group = "[C]ode";
}
{
__unkeyed-1 = "<leader>d";
group = "[D]ocument";
}
{
__unkeyed-1 = "<leader>h";
group = "Git [H]unk";
mode = [
"n"
"v"
];
}
{
__unkeyed-1 = "<leader>r";
group = "[R]ename";
}
{
__unkeyed-1 = "<leader>s";
group = "[S]earch";
}
{
__unkeyed-1 = "<leader>t";
group = "[T]oggle";
}
{
__unkeyed-1 = "<leader>w";
group = "[W]orkspace";
}
];
};
};
};
}

5
home/tui/termshark.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
termshark
];
}

5
home/tui/zellij.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
zellij
];
}

View File

@@ -0,0 +1,5 @@
{hostname, ...}: let
inherit (import ../../hosts/${hostname}/env.nix) Bluetooth;
in {
services.blueman-applet.enable = Bluetooth;
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
brightnessctl
];
}

View File

@@ -0,0 +1,3 @@
_: {
services.easyeffects.enable = true;
}

25
home/wayland/fcitx5.nix Normal file
View File

@@ -0,0 +1,25 @@
{pkgs, ...}: {
home.file.".local/share/fcitx5/rime" = {
force = true;
recursive = true;
source = pkgs.fetchFromGitHub {
hash = "sha256-s3r8cdEliiPnKWs64Wgi0rC9Ngl1mkIrLnr2tIcyXWw=";
owner = "iDvel";
repo = "rime-ice";
tag = "2025.04.06";
};
};
i18n.inputMethod = {
enable = true;
fcitx5 = {
addons = with pkgs; [
fcitx5-gtk
fcitx5-rime
libsForQt5.fcitx5-qt
];
waylandFrontend = true;
};
type = "fcitx5";
};
}

5
home/wayland/fuzzel.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.fuzzel = {
enable = true;
};
}

60
home/wayland/hyprland.nix Normal file
View File

@@ -0,0 +1,60 @@
{
hostname,
lib,
pkgs,
...
}:
let
inherit (import ../../hosts/${hostname}/env.nix)
GPU-Nvidia
MonitorSettings
KeyboardLayout
ScaleLevel
WM
;
in
with lib;
mkIf (WM == "Hyprland") {
home.packages = with pkgs; [
xorg.xprop
];
wayland.windowManager.hyprland = {
enable = true;
plugins = [
pkgs.hyprlandPlugins.hy3
];
systemd = {
enable = true;
variables = [ "--all" ];
};
xwayland.enable = true;
extraConfig = concatStrings [
''
${MonitorSettings}
$KEYBOARDLAYOUT = ${KeyboardLayout}
$SCALE = ${ScaleLevel}
source = ~/.config/hypr/hyprland/*
''
];
settings = mkIf GPU-Nvidia {
env = [
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
"LIBVA_DRIVER_NAME,nvidia"
"NVD_BACKEND,direct"
"WLR_NO_HARDWARE_CURSORS,1"
];
};
};
xdg.portal = {
config = {
common = {
default = [ "gtk" ];
};
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
};
}

View File

@@ -0,0 +1,5 @@
_: {
programs.hyprlock = {
enable = true;
};
}

View File

@@ -0,0 +1,3 @@
_: {
services.hyprpolkitagent.enable = true;
}

View File

@@ -0,0 +1,15 @@
{
hostname,
lib,
pkgs,
...
}: let
inherit (import ../../hosts/${hostname}/env.nix) HotSpot-Use-Case;
in
with lib;
mkIf HotSpot-Use-Case
{
home.packages = with pkgs; [
linux-wifi-hotspot
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
networkmanagerapplet
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
playerctl
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
pwvucontrol
];
}

View File

@@ -0,0 +1,8 @@
{pkgs, ...}: {
home.packages = with pkgs; [
grim
jq
slurp
swappy
];
}

3
home/wayland/swaync.nix Normal file
View File

@@ -0,0 +1,3 @@
_: {
services.swaync.enable = true;
}

5
home/wayland/swayosd.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
swayosd
];
}

5
home/wayland/swww.nix Normal file
View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
swww
];
}

51
home/wayland/theme.nix Normal file
View File

@@ -0,0 +1,51 @@
{pkgs, ...}: {
fonts.fontconfig = {
defaultFonts = {
emoji = ["Noto Color Emoji"];
monospace = ["JetBrainsMono Nerd Font Mono"];
sansSerif = ["Sarasa Gothic SC"];
serif = ["Sarasa Gothic SC"];
};
enable = true;
};
gtk = {
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
home.packages = with pkgs; [
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
qt6ct
];
qt = {
enable = true;
style.name = "kvantum";
};
stylix = {
autoEnable = true;
targets = {
fcitx5.enable = false;
floorp.enable = false;
hyprland.enable = false;
kde.enable = false;
mpv.enable = false;
nixvim.enable = false;
sway.enable = false;
waybar.enable = false;
yazi.enable = false;
zed.enable = false;
};
};
}

5
home/wayland/waybar.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.waybar = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
waytrogen
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
wl-clipboard-rs
];
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [
wl-gammarelay-rs
];
}

5
home/wayland/wlogout.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
programs.wlogout = {
enable = true;
};
}

106
home/wayland/xdg.nix Normal file
View File

@@ -0,0 +1,106 @@
{config, ...}: {
xdg = {
enable = true;
mimeApps = let
archiver-extract-smart = ["peazip-extract-smart.desktop"];
archiver-useless-options = [
"peazip-extract.desktop"
"peazip-extract-desktop.desktop"
"peazip-extract-documents.desktop"
"peazip-extract-downloads.desktop"
"peazip-extract-here.desktop"
];
browser = ["brave-browser.desktop"];
editor = ["dev.zed.Zed.desktop"];
filemanager = ["nemo.desktop"];
image-viewer = ["oculante.desktop"];
media-player = ["vlc.desktop"];
in {
associations = {
added = {
"application/x-directory" = ["peazip-add-to-archive.desktop"];
"inode/directory" = ["peazip-add-to-archive.desktop"];
};
removed = {
"application/iso" = archiver-useless-options;
"application/x-7z-compressed" = archiver-useless-options;
"application/x-ace-compressed" = archiver-useless-options;
"application/x-bzip2" = archiver-useless-options;
"application/x-gzip" = archiver-useless-options;
"application/x-rar-compressed" = archiver-useless-options;
"application/x-tar" = archiver-useless-options;
"application/zip" = archiver-useless-options;
};
};
enable = true;
defaultApplications = {
"application/iso" = archiver-extract-smart;
"application/zip" = archiver-extract-smart;
"application/x-7z-compressed" = archiver-extract-smart;
"application/x-ace-compressed" = archiver-useless-options;
"application/x-bzip2" = archiver-extract-smart;
"application/x-gzip" = archiver-extract-smart;
"application/x-rar-compressed" = archiver-extract-smart;
"application/x-tar" = archiver-extract-smart;
"application/json" = browser;
"application/pdf" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"text/html" = browser;
"text/xml" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"application/x-wine-extension-ini" = editor;
"text/plain" = editor;
"x-scheme-handler/about" = filemanager;
"x-scheme-handler/ftp" = filemanager;
"image/*" = image-viewer;
"image/avif" = image-viewer;
"image/gif" = image-viewer;
"image/jpeg" = image-viewer;
"image/png" = image-viewer;
"image/webp" = image-viewer;
"audio/*" = media-player;
"video/*" = media-player;
"x-scheme-handler/tg" = ["io.github.kukuruzka165.materialgram.desktop"];
};
};
portal = {
config = {
common = {
"org.freedesktop.impl.portal.FileChooser" = "gtk";
};
};
enable = true;
};
userDirs = {
enable = true;
createDirectories = false;
documents = "$HOME/Documents";
download = "$HOME/Downloads";
music = "$HOME/Music";
pictures = "$HOME/Pictures";
publicShare = "/var/empty";
templates = "/var/empty";
videos = "$HOME/Videos";
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
}