From e703e1b31c0daf1b018571ee416915269a429d3d Mon Sep 17 00:00:00 2001 From: moons Date: Mon, 27 Jul 2026 15:24:37 +0900 Subject: [PATCH] add vim, vscode, zed, zellij, zsh --- modules/applications/vim/home.nix | 678 +++++++++++++++++++++++++ modules/applications/vim/meta.nix | 8 + modules/applications/vscode/common.nix | 5 + modules/applications/vscode/home.nix | 277 ++++++++++ modules/applications/zed/home.nix | 41 ++ modules/applications/zellij/home.nix | 65 +++ modules/applications/zsh/home.nix | 39 ++ modules/applications/zsh/nixos.nix | 3 + 8 files changed, 1116 insertions(+) create mode 100644 modules/applications/vim/home.nix create mode 100644 modules/applications/vim/meta.nix create mode 100644 modules/applications/vscode/common.nix create mode 100644 modules/applications/vscode/home.nix create mode 100644 modules/applications/zed/home.nix create mode 100644 modules/applications/zellij/home.nix create mode 100644 modules/applications/zsh/home.nix create mode 100644 modules/applications/zsh/nixos.nix diff --git a/modules/applications/vim/home.nix b/modules/applications/vim/home.nix new file mode 100644 index 0000000..50f9c0b --- /dev/null +++ b/modules/applications/vim/home.nix @@ -0,0 +1,678 @@ +{ pkgs, ... }: +{ + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; + + programs.nixvim = { + enable = true; + vimAlias = true; + viAlias = true; + withNodeJs = true; + + nixpkgs = { + source = pkgs.path; + config.allowUnfree = true; + }; + + extraPackages = with pkgs; [ + git + ripgrep + fd + nodejs + zellij + vtsls + vscode-langservers-extracted + tailwindcss-language-server + prettierd + prettier + biome + stylua + shfmt + alejandra + nixfmt + lua-language-server + nixd + lazygit + ]; + + opts = { + number = true; + relativenumber = true; + signcolumn = "yes"; + termguicolors = true; + mouse = "a"; + clipboard = "unnamedplus"; + updatetime = 200; + timeoutlen = 300; + undofile = true; + wrap = false; + scrolloff = 8; + ignorecase = true; + smartcase = true; + splitright = true; + splitbelow = true; + tabstop = 2; + shiftwidth = 2; + expandtab = true; + encoding = "utf-8"; + fileencoding = "utf-8"; + fileencodings = "utf-8,sjis,euc-jp,iso-2022-jp"; + list = true; + listchars = "tab:»-,trail:-,extends:»,precedes:«,nbsp:%"; + jumpoptions = "stack"; + switchbuf = "useopen,uselast"; + foldcolumn = "1"; + foldlevel = 99; + foldlevelstart = 99; + foldenable = true; + }; + + globals = { + mapleader = " "; + maplocalleader = " "; + clipboard = "osc52"; + }; + + env = { + LANG = "ja_JP.UTF-8"; + LC_MESSAGES = "ja_JP.UTF-8"; + }; + + autoCmd = [ + { + event = "TextYankPost"; + callback.__raw = "function() vim.highlight.on_yank() end"; + } + ]; + + colorschemes.catppuccin = { + enable = true; + settings.transparent_background = true; + }; + + diagnostic.settings = { + virtual_text = true; + float = { + border = "rounded"; + source = true; + }; + }; + + plugins = { + lsp = { + enable = true; + servers = { + vtsls = { + enable = true; + packageFallback = true; + rootMarkers = [ + "pnpm-workspace.yaml" + "package.json" + "tsconfig.json" + "jsconfig.json" + ".git" + ]; + extraOptions.settings.typescript.locale = "ja"; + }; + biome = { + enable = true; + packageFallback = true; + rootMarkers = [ + "biome.json" + "biome.jsonc" + "package.json" + "pnpm-workspace.yaml" + ".git" + ]; + }; + tailwindcss.enable = true; + cssls.enable = true; + jsonls.enable = true; + yamlls.enable = true; + lua_ls.enable = true; + nixd.enable = true; + rust_analyzer = { + enable = true; + installCargo = true; + installRustc = true; + }; + svelte.enable = true; + ty.enable = true; + ruff.enable = true; + astro.enable = true; + gopls.enable = true; + }; + }; + + blink-cmp = { + enable = true; + setupLspCapabilities = true; + settings = { + keymap = { + preset = "enter"; + "" = [ "show" ]; + "" = [ "scroll_documentation_up" ]; + "" = [ "hide" ]; + "" = [ "scroll_documentation_down" ]; + "" = [ + "accept" + { + __raw = '' + function() + local ok, copilot = pcall(require, "copilot.suggestion") + if ok and copilot.is_visible() then + copilot.accept() + return true + end + end + ''; + } + "fallback" + ]; + "" = [ + "select_prev" + "fallback" + ]; + "" = [ + "select_next" + "fallback" + ]; + "" = [ + "select_prev" + "fallback" + ]; + }; + completion.list.selection = { + preselect = true; + auto_insert = false; + }; + sources.default = [ + "lsp" + "path" + "buffer" + ]; + }; + }; + + nvim-autopairs.enable = true; + comment.enable = true; + "conform-nvim" = { + enable = true; + settings = { + formatters_by_ft = { + javascript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }''; + javascriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }''; + typescript.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }''; + typescriptreact.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }''; + json.__raw = ''{ "biome", "prettierd", "prettier", stop_after_first = true }''; + yaml.__raw = ''{ "prettierd", "prettier", stop_after_first = true }''; + markdown.__raw = ''{ "prettierd", "prettier", stop_after_first = true }''; + lua = [ "stylua" ]; + nix.__raw = ''{ "nix_fmt", "alejandra", stop_after_first = true }''; + sh = [ "shfmt" ]; + }; + formatters.nix_fmt.command = "nixfmt"; + format_on_save.__raw = '' + function(_) + return { timeout_ms = 1000, lsp_format = "fallback" } + end + ''; + }; + }; + copilot-lua = { + enable = true; + settings.suggestion = { + auto_trigger = true; + keymap.enabled = false; + }; + }; + lazygit.enable = true; + diffview.enable = true; + gitsigns = { + enable = true; + settings.signs = { + add.text = "+"; + change.text = "~"; + delete.text = "_"; + topdelete.text = "‾"; + changedelete.text = "~"; + }; + }; + lsp-signature = { + enable = true; + settings = { + hint_enable = true; + hint_prefix = " "; + floating_window = true; + bind = true; + }; + }; + nvim-surround.enable = true; + treesitter = { + enable = true; + settings = { + highlight.enable = true; + indent.enable = true; + }; + }; + trouble.enable = true; + barbar = { + enable = true; + settings = { + animation = false; + auto_hide = 1; + tabpages = true; + clickable = true; + focus_on_close = "left"; + icons = { + button = "󰅖"; + separator = { + left = "▎"; + right = ""; + }; + separator_at_end = false; + filetype.enabled = true; + }; + sidebar_filetypes.neo-tree = true; + }; + }; + indent-blankline = { + enable = true; + settings = { + scope = { + enabled = true; + show_start = true; + show_end = true; + }; + exclude.filetypes = [ + "help" + "neo-tree" + "toggleterm" + "lazy" + ]; + }; + }; + colorizer = { + enable = true; + settings = { + filetypes = [ + "*" + "!markdown" + ]; + user_commands = true; + options = { + parsers = { + css = true; + tailwind = { + enable = true; + lsp = true; + update_names = true; + }; + }; + display.mode = "background"; + }; + }; + }; + dropbar.enable = true; + nvim-lightbulb = { + enable = true; + settings.autocmd.enabled = true; + }; + lualine = { + enable = true; + settings.sections.lualine_x = [ + { + __raw = '' + function() + local ok, conform = pcall(require, "conform") + if not ok then return "" end + for _, formatter in ipairs(conform.list_formatters(0)) do + if formatter.available then return "󰛖 " .. formatter.name end + end + return "" + end + ''; + } + "encoding" + "fileformat" + "filetype" + ]; + }; + neo-tree = { + enable = true; + settings = { + close_if_last_window = true; + filesystem = { + follow_current_file = { + enabled = true; + leave_dirs_open = true; + }; + filtered_items = { + visible = true; + hide_dotfiles = false; + hide_gitignored = true; + hide_ignored = false; + hide_hidden = false; + never_show = [ + ".DS_Store" + "thumbs.db" + ]; + }; + }; + }; + }; + toggleterm.enable = true; + "treesitter-context".enable = true; + web-devicons.enable = true; + which-key.enable = true; + }; + + extraPlugins = with pkgs.vimPlugins; [ + flash-nvim + git-conflict-nvim + glance-nvim + snacks-nvim + nvim-spectre + todo-comments-nvim + nvim-ts-autotag + vim-wakatime + markview-nvim + nvim-scrollbar + nvim-ufo + promise-async + zen-mode-nvim + ]; + + extraConfigLua = '' + vim.cmd.language("ja_JP.utf8") + vim.opt.helplang = { "ja", "en" } + + require("flash").setup() + require("git-conflict").setup() + require("glance").setup() + require("spectre").setup() + require("todo-comments").setup() + require("nvim-ts-autotag").setup() + require("markview").setup({ initial_state = false }) + require("scrollbar").setup() + require("zen-mode").setup() + require("ufo").setup({ + provider_selector = function() + return { "treesitter", "indent" } + end, + }) + require("snacks").setup({ + picker = { + enabled = true, + actions = require("trouble.sources.snacks").actions, + win = { input = { keys = { + [""] = { "trouble_open", mode = { "n", "i" } }, + } } }, + }, + notifier = { enabled = true }, + words = { enabled = true }, + scroll = { enabled = true }, + dim = { enabled = true }, + }) + ''; + + keymaps = [ + { + mode = "n"; + key = ""; + action = "nohlsearch"; + options = { + silent = true; + desc = "検索ハイライトを解除"; + }; + } + { + mode = "n"; + key = "j"; + action.__raw = "function() return vim.v.count == 0 and 'gj' or 'j' end"; + options = { + silent = true; + expr = true; + desc = "下へ移動"; + }; + } + { + mode = "n"; + key = "k"; + action.__raw = "function() return vim.v.count == 0 and 'gk' or 'k' end"; + options = { + silent = true; + expr = true; + desc = "上へ移動"; + }; + } + { + mode = "n"; + key = "K"; + action.__raw = "vim.lsp.buf.hover"; + options = { + silent = true; + desc = "シンボル情報"; + }; + } + { + mode = "n"; + key = "gd"; + action.__raw = "vim.lsp.buf.definition"; + options = { + silent = true; + desc = "定義へジャンプ"; + }; + } + { + mode = "n"; + key = "grr"; + action.__raw = "vim.lsp.buf.references"; + options = { + silent = true; + desc = "参照一覧"; + }; + } + { + mode = "n"; + key = "gri"; + action.__raw = "vim.lsp.buf.implementation"; + options = { + silent = true; + desc = "実装一覧"; + }; + } + { + mode = "n"; + key = "grt"; + action.__raw = "vim.lsp.buf.type_definition"; + options = { + silent = true; + desc = "型定義"; + }; + } + { + mode = "n"; + key = "grn"; + action.__raw = "vim.lsp.buf.rename"; + options = { + silent = true; + desc = "名前変更"; + }; + } + { + mode = "n"; + key = "gra"; + action.__raw = "vim.lsp.buf.code_action"; + options = { + silent = true; + desc = "コードアクション"; + }; + } + { + mode = "n"; + key = "cf"; + action.__raw = "function() require('conform').format({ timeout_ms = 1000, lsp_format = 'fallback' }) end"; + options = { + silent = true; + desc = "フォーマット"; + }; + } + { + mode = "n"; + key = "e"; + action = "Neotree toggle left"; + options = { + silent = true; + desc = "ファイルツリー"; + }; + } + { + mode = "n"; + key = "tt"; + action = "ToggleTerm direction=float"; + options = { + silent = true; + desc = "ターミナル"; + }; + } + { + mode = "n"; + key = "xx"; + action = "Trouble diagnostics toggle"; + options = { + silent = true; + desc = "診断一覧"; + }; + } + { + mode = "n"; + key = "gl"; + action = "LazyGit"; + options = { + silent = true; + desc = "LazyGit"; + }; + } + { + mode = "n"; + key = "gd"; + action = "DiffviewOpen"; + options = { + silent = true; + desc = "差分"; + }; + } + { + mode = "n"; + key = "mp"; + action = "Markview splitToggle"; + options = { + silent = true; + desc = "Markdown プレビュー"; + }; + } + { + mode = "n"; + key = "zz"; + action = "ZenMode"; + options = { + silent = true; + desc = "Zen Mode"; + }; + } + { + mode = "n"; + key = "zR"; + action.__raw = "require('ufo').openAllFolds"; + options = { + silent = true; + desc = "全て展開"; + }; + } + { + mode = "n"; + key = "zM"; + action.__raw = "require('ufo').closeAllFolds"; + options = { + silent = true; + desc = "全て折りたたむ"; + }; + } + { + mode = "n"; + key = "s"; + action.__raw = "function() require('flash').jump() end"; + options = { + silent = true; + desc = "Flash ジャンプ"; + }; + } + { + mode = "n"; + key = "S"; + action.__raw = "function() require('flash').treesitter() end"; + options = { + silent = true; + desc = "Flash 選択"; + }; + } + { + mode = "n"; + key = "sr"; + action.__raw = "function() require('spectre').toggle() end"; + options = { + silent = true; + desc = "検索・置換"; + }; + } + { + mode = "n"; + key = "ff"; + action.__raw = "function() Snacks.picker.files() end"; + options = { + silent = true; + desc = "ファイルを探す"; + }; + } + { + mode = "n"; + key = "fg"; + action.__raw = "function() Snacks.picker.grep() end"; + options = { + silent = true; + desc = "全文検索"; + }; + } + { + mode = "n"; + key = "fb"; + action.__raw = "function() Snacks.picker.buffers() end"; + options = { + silent = true; + desc = "バッファを探す"; + }; + } + { + mode = "n"; + key = "fh"; + action.__raw = "function() Snacks.picker.help() end"; + options = { + silent = true; + desc = "ヘルプを探す"; + }; + } + { + mode = "n"; + key = "fs"; + action.__raw = "function() Snacks.picker.lsp_symbols() end"; + options = { + silent = true; + desc = "シンボルを探す"; + }; + } + ]; + }; +} diff --git a/modules/applications/vim/meta.nix b/modules/applications/vim/meta.nix new file mode 100644 index 0000000..5e306f5 --- /dev/null +++ b/modules/applications/vim/meta.nix @@ -0,0 +1,8 @@ +{ inputs, ... }: +{ + description = "Neovim configured with Nixvim"; + + imports.home = [ + inputs.nixvim.homeModules.nixvim + ]; +} diff --git a/modules/applications/vscode/common.nix b/modules/applications/vscode/common.nix new file mode 100644 index 0000000..20baf1c --- /dev/null +++ b/modules/applications/vscode/common.nix @@ -0,0 +1,5 @@ +{ + # Home Manager uses the system package set on both NixOS and nix-darwin. + # VS Code itself is unfree, so permit it where this application is selected. + nixpkgs.config.allowUnfree = true; +} diff --git a/modules/applications/vscode/home.nix b/modules/applications/vscode/home.nix new file mode 100644 index 0000000..a148d4c --- /dev/null +++ b/modules/applications/vscode/home.nix @@ -0,0 +1,277 @@ +{ pkgs, lib, ... }: +let + vsc = pkgs.vscode-extensions; + inherit (lib) recursiveUpdate; + localePath = + if pkgs.stdenv.hostPlatform.isDarwin then + "Library/Application Support/Code/User/locale.json" + else + ".config/Code/User/locale.json"; + + rustEnvironment = lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { + "rust-analyzer.cargo.extraEnv" = { + LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ]; + BINDGEN_EXTRA_CLANG_ARGS = lib.concatStringsSep " " ( + (map (path: ''-I"${path}/include"'') [ pkgs.glibc.dev ]) + ++ [ + ''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"'' + ''-I"${pkgs.glib.dev}/include/glib-2.0"'' + "-I${pkgs.glib.out}/lib/glib-2.0/include/" + ] + ); + }; + }; + + layers = rec { + common = { + extensions = + (with vsc; [ + github.copilot + github.copilot-chat + dracula-theme.theme-dracula + ms-vscode-remote.vscode-remote-extensionpack + dbaeumer.vscode-eslint + ms-vscode-remote.remote-containers + ms-vscode-remote.remote-ssh + github.vscode-github-actions + github.vscode-pull-request-github + eamodio.gitlens + streetsidesoftware.code-spell-checker + ms-ceintl.vscode-language-pack-ja + ]) + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "hadolint"; + publisher = "exiasr"; + version = "1.1.2"; + hash = "sha256-6GO1f8SP4CE8yYl87/tm60FdGHqHsJA4c2B6UKVdpgM="; + } + { + name = "chatgpt"; + publisher = "openai"; + version = "0.4.71"; + hash = "sha256-Q0le5rhVRgTDQXjIlhbzJOv/7+xC6JXwTp6fxZCP4ak="; + } + ]; + userSettings = { + "workbench.colorTheme" = "Dracula"; + "window.autoDetectColorScheme" = false; + "editor.formatOnSave" = true; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + "git.enableSmartCommit" = true; + "files.autoSave" = "onFocusChange"; + "git.confirmSync" = false; + "github.copilot.nextEditSuggestions.enabled" = true; + "editor.suggestOnTriggerCharacters" = true; + "editor.quickSuggestions" = { + other = true; + comments = false; + strings = true; + }; + "git.autofetch" = true; + "workbench.editor.enablePreview" = false; + "files.exclude" = { + "**/.direnv" = true; + "**/.direnv/**" = true; + }; + "search.exclude" = { + "**/.direnv" = true; + "**/.direnv/**" = true; + }; + }; + }; + + web = { + extensions = + (with vsc; [ + lokalise.i18n-ally + bradlc.vscode-tailwindcss + prisma.prisma + hashicorp.terraform + yoavbls.pretty-ts-errors + ]) + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "pnpm-catalog-lens"; + publisher = "antfu"; + version = "1.0.0"; + hash = "sha256-mCMBVxZRIb3Jao1XSS7EQRQX3Y2vrkpAmy6ldSqZa9c="; + } + { + name = "explorer"; + publisher = "vitest"; + version = "1.32.1"; + hash = "sha256-MAfjS/oFfFuiE+Q2w6leSlao436QSw2fKjd7/BE/Q8Y="; + } + ]; + userSettings = { }; + }; + + web-biome = { + extensions = with vsc; [ biomejs.biome ]; + userSettings = { + "editor.defaultFormatter" = "biomejs.biome"; + "[typescript].editor.defaultFormatter" = "biomejs.biome"; + "[typescriptreact].editor.defaultFormatter" = "biomejs.biome"; + }; + }; + + web-oxc = { + extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "oxc-vscode"; + publisher = "oxc"; + version = "1.48.0"; + hash = "sha256-RZ7mLcLJyn7lR6w6Au6fZeguB3wtk8sIXb67lPnPnrc="; + } + ]; + userSettings = { + "editor.defaultFormatter" = "oxc.oxc-vscode"; + "[typescript].editor.defaultFormatter" = "oxc.oxc-vscode"; + "[typescriptreact].editor.defaultFormatter" = "oxc.oxc-vscode"; + }; + }; + + nix = { + extensions = with vsc; [ + bbenoist.nix + jnoortheen.nix-ide + ]; + userSettings = { + "nix.enableLanguageServer" = true; + "nix.serverPath" = "nil"; + "[nix]" = { + "editor.defaultFormatter" = "jnoortheen.nix-ide"; + }; + }; + }; + + jupyter = { + extensions = with vsc; [ + ms-toolsai.jupyter + ms-python.python + ]; + userSettings = { }; + }; + + java = { + extensions = with vsc; [ + vscjava.vscode-java-pack + sonarsource.sonarlint-vscode + vscjava.vscode-java-debug + redhat.java + ]; + userSettings = { + "java.jdt.ls.java.home" = "${pkgs.jdk25.home}"; + "java.configuration.runtimes" = [ + { + name = "JavaSE-25"; + path = "${pkgs.jdk25.home}"; + default = true; + } + ]; + "editor.codeLens" = true; + "java.debug.settings.enableRunDebugCodeLens" = true; + "java.jdt.ls.vmargs" = "-Xms256m -Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication"; + "java.configuration.updateBuildConfiguration" = "interactive"; + "java.maven.downloadSources" = true; + "java.eclipse.downloadSources" = true; + "maven.executable.path" = "${pkgs.maven}/bin/mvn"; + "[java]" = { + "editor.defaultFormatter" = "redhat.java"; + }; + }; + }; + + rust = { + extensions = with vsc; [ + rust-lang.rust-analyzer + vadimcn.vscode-lldb + serayuzgur.crates + tamasfe.even-better-toml + ]; + userSettings = recursiveUpdate { + "[rust]" = { + "editor.defaultFormatter" = "rust-lang.rust-analyzer"; + "editor.formatOnSave" = true; + "editor.codeActionsOnSave" = { + "source.organizeImports" = true; + "source.fixAll" = true; + }; + }; + "rust-analyzer.checkOnSave" = true; + "rust-analyzer.check.command" = "clippy"; + "rust-analyzer.cargo.buildScripts.enable" = true; + "rust-analyzer.procMacro.enable" = true; + "rust-analyzer.cargo.targetDir" = true; + "rust-analyzer.lens.enable" = true; + "rust-analyzer.lens.implementations.enable" = true; + "rust-analyzer.lens.references.adt.enable" = true; + "rust-analyzer.lens.references.enumVariant.enable" = true; + "rust-analyzer.lens.references.method.enable" = true; + "rust-analyzer.lens.references.trait.enable" = true; + "files.watcherExclude" = { + "**/target/**" = true; + }; + "search.exclude" = { + "**/target/**" = true; + }; + } rustEnvironment; + }; + }; + + combine = + layersList: + builtins.foldl' + (acc: layer: { + extensions = acc.extensions ++ layer.extensions; + userSettings = recursiveUpdate acc.userSettings layer.userSettings; + }) + { + extensions = [ ]; + userSettings = { }; + } + layersList; + + mkProfile = combine; +in +{ + programs.vscode = { + enable = true; + profiles = { + default = mkProfile [ layers.common ]; + nix = mkProfile [ + layers.common + layers.nix + ]; + web = mkProfile [ + layers.common + layers.web + layers.web-biome + ]; + web-oxc = mkProfile [ + layers.common + layers.web + layers.web-oxc + ]; + jupyter = mkProfile [ + layers.common + layers.jupyter + ]; + java = mkProfile [ + layers.common + layers.java + ]; + rust = mkProfile [ + layers.common + layers.rust + ]; + }; + }; + + home.file.${localePath}.text = '' + { + "locale": "ja" + } + ''; +} diff --git a/modules/applications/zed/home.nix b/modules/applications/zed/home.nix new file mode 100644 index 0000000..7f1ea02 --- /dev/null +++ b/modules/applications/zed/home.nix @@ -0,0 +1,41 @@ +{ + programs.zed-editor = { + enable = true; + extensions = [ + "catppuccin" + "nix" + ]; + mutableUserSettings = false; + + userSettings = { + agent = { + flexible = true; + favorite_models = [ ]; + model_parameters = [ ]; + }; + project_panel.dock = "left"; + telemetry = { + diagnostics = false; + metrics = false; + }; + vim_mode = true; + agent_servers = { + github-copilot-cli.type = "registry"; + codex-acp.type = "registry"; + claude-acp.type = "registry"; + }; + icon_theme = { + mode = "dark"; + light = "Zed (Default)"; + dark = "Zed (Default)"; + }; + ui_font_size = 16; + buffer_font_size = 16; + theme = { + mode = "dark"; + light = "Catppuccin Latte"; + dark = "Catppuccin Mocha"; + }; + }; + }; +} diff --git a/modules/applications/zellij/home.nix b/modules/applications/zellij/home.nix new file mode 100644 index 0000000..6d8f9d0 --- /dev/null +++ b/modules/applications/zellij/home.nix @@ -0,0 +1,65 @@ +{ pkgs, ... }: +{ + programs.zellij = { + enable = true; + enableZshIntegration = false; + + settings = { + pane_frames = true; + copy_clipboard = "system"; + copy_on_select = false; + default_mode = "locked"; + default_shell = "${pkgs.zsh}/bin/zsh"; + }; + + extraConfig = '' + keybinds { + locked { + bind "Ctrl g" { SwitchToMode "normal"; } + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + bind "Alt j" "Alt Down" { MoveFocus "Down"; } + bind "Alt k" "Alt Up" { MoveFocus "Up"; } + bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + bind "Alt n" { NewPane; } + bind "Alt t" { NewTab; } + bind "Alt H" { Resize "Increase Left"; } + bind "Alt J" { Resize "Increase Down"; } + bind "Alt K" { Resize "Increase Up"; } + bind "Alt L" { Resize "Increase Right"; } + bind "Alt c" "Ctrl Shift c" { Copy; } + } + normal { + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + bind "Alt j" "Alt Down" { MoveFocus "Down"; } + bind "Alt k" "Alt Up" { MoveFocus "Up"; } + bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + bind "Alt n" { NewPane; } + bind "Alt t" { NewTab; } + bind "Ctrl Shift c" { Copy; } + bind "Alt H" { Resize "Increase Left"; } + bind "Alt J" { Resize "Increase Down"; } + bind "Alt K" { Resize "Increase Up"; } + bind "Alt L" { Resize "Increase Right"; } + } + } + ''; + + layouts.dev = '' + layout { + pane split_direction="vertical" { + pane { + pane command="nvim" + pane stacked=true size="30%" { + pane expanded=true + pane + } + } + + pane size=1 borderless=true { + plugin location="zellij:compact-bar" + } + } + } + ''; + }; +} diff --git a/modules/applications/zsh/home.nix b/modules/applications/zsh/home.nix new file mode 100644 index 0000000..6ac5803 --- /dev/null +++ b/modules/applications/zsh/home.nix @@ -0,0 +1,39 @@ +{ + programs.zsh = { + enable = true; + enableCompletion = true; + + oh-my-zsh = { + enable = true; + theme = "robbyrussell"; + plugins = [ "git" ]; + }; + + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + initContent = '' + export HISTSIZE=999999999 + export HISTFILESIZE=999999999 + + setopt extended_history + setopt hist_allow_clobber + setopt hist_fcntl_lock + setopt hist_find_no_dups + setopt hist_ignore_all_dups + setopt hist_ignore_dups + setopt hist_ignore_space + setopt hist_reduce_blanks + setopt hist_save_no_dups + setopt hist_verify + setopt inc_append_history_time + + unsetopt SHARE_HISTORY + setopt APPEND_HISTORY + setopt INC_APPEND_HISTORY_TIME + + alias docker-compose="docker compose" + alias lssh='ssh -o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 -o Ciphers=+aes256-cbc,aes128-cbc -o HostKeyAlgorithms=+ssh-rsa -o SetEnv=TERM=xterm' + ''; + }; +} diff --git a/modules/applications/zsh/nixos.nix b/modules/applications/zsh/nixos.nix new file mode 100644 index 0000000..5b95235 --- /dev/null +++ b/modules/applications/zsh/nixos.nix @@ -0,0 +1,3 @@ +{ + programs.zsh.enable = true; +}