From 69c5f456e558aca55d40013d3f379a07e7707041 Mon Sep 17 00:00:00 2001 From: moons-14 Date: Wed, 11 Mar 2026 15:01:32 +0900 Subject: [PATCH] vim --- flake.lock | 201 +++++++++++++++++++-- flake.nix | 164 ++++++++--------- modules/core/packages.nix | 3 +- modules/home/claude.nix | 9 + modules/home/default.nix | 2 + modules/home/nixvim/keymaps.nix | 5 + modules/home/nixvim/plugins/ui/barbar.nix | 26 +++ modules/home/nixvim/plugins/ui/default.nix | 1 + modules/home/zellij.nix | 29 +++ 9 files changed, 340 insertions(+), 100 deletions(-) create mode 100644 modules/home/claude.nix create mode 100644 modules/home/nixvim/plugins/ui/barbar.nix create mode 100644 modules/home/zellij.nix diff --git a/flake.lock b/flake.lock index 6234e9d..7edddc4 100644 --- a/flake.lock +++ b/flake.lock @@ -68,6 +68,65 @@ "type": "github" } }, + "blueprint": { + "inputs": { + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ], + "systems": [ + "llm-agents", + "systems" + ] + }, + "locked": { + "lastModified": 1771437256, + "narHash": "sha256-bLqwib+rtyBRRVBWhMuBXPCL/OThfokA+j6+uH7jDGU=", + "owner": "numtide", + "repo": "blueprint", + "rev": "06ee7190dc2620ea98af9eb225aa9627b68b0e33", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "blueprint", + "type": "github" + } + }, + "bun2nix": { + "inputs": { + "flake-parts": [ + "llm-agents", + "flake-parts" + ], + "import-tree": "import-tree", + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ], + "systems": [ + "llm-agents", + "systems" + ], + "treefmt-nix": [ + "llm-agents", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1770895533, + "narHash": "sha256-v3QaK9ugy9bN9RXDnjw0i2OifKmz2NnKM82agtqm/UY=", + "owner": "nix-community", + "repo": "bun2nix", + "rev": "c843f477b15f51151f8c6bcc886954699440a6e1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "bun2nix", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1754269165, @@ -169,6 +228,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "llm-agents", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -189,7 +269,7 @@ "type": "github" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -230,7 +310,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -248,7 +328,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_6" + "systems": "systems_7" }, "locked": { "lastModified": 1731533236, @@ -362,6 +442,21 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1763762820, + "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=", + "owner": "vic", + "repo": "import-tree", + "rev": "3c23749d8013ec6daa1d7255057590e9ca726646", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "ixx": { "inputs": { "flake-utils": [ @@ -415,11 +510,34 @@ "type": "github" } }, + "llm-agents": { + "inputs": { + "blueprint": "blueprint", + "bun2nix": "bun2nix", + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_3", + "systems": "systems_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1773133636, + "narHash": "sha256-4Wjgp7vc3tq7erE/JRI3XXtLj9eM6s1lVK9GMkILy7k=", + "owner": "numtide", + "repo": "llm-agents.nix", + "rev": "126d61f41fb20ff99025bf7de481a211593ec7c7", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "llm-agents.nix", + "type": "github" + } + }, "niri-flake": { "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" @@ -490,7 +608,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_3", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1762251193, @@ -565,6 +683,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1772956932, + "narHash": "sha256-M0yS4AafhKxPPmOHGqIV0iKxgNO8bHDWdl1kOwGBwRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "608d0cadfed240589a7eea422407a547ad626a14", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1762363567, "narHash": "sha256-YRqMDEtSMbitIMj+JLpheSz0pwEr0Rmy5mC7myl17xs=", @@ -580,7 +714,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1761907660, "narHash": "sha256-kJ8lIZsiPOmbkJypG+B5sReDXSD1KGu2VEPNqhRa/ew=", @@ -596,7 +730,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1764983851, "narHash": "sha256-y7RPKl/jJ/KAP/VKLMghMgXTlvNIJMHKskl8/Uuar7o=", @@ -612,7 +746,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1762111121, "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", @@ -630,12 +764,12 @@ }, "nixvim": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "nixpkgs": [ "nixpkgs" ], "nuschtosSearch": "nuschtosSearch", - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1769049374, @@ -660,7 +794,7 @@ "quickshell": [ "quickshell" ], - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1762640266, @@ -775,10 +909,11 @@ "ghostty": "ghostty", "home-manager": "home-manager", "lanzaboote": "lanzaboote", + "llm-agents": "llm-agents", "niri-flake": "niri-flake", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "noctalia": "noctalia", @@ -815,13 +950,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems_5", + "systems": "systems_6", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -932,6 +1067,21 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1013,10 +1163,31 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "llm-agents", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772660329, + "narHash": "sha256-IjU1FxYqm+VDe5qIOxoW+pISBlGvVApRjiw/Y/ttJzY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "3710e0e1218041bbad640352a0440114b1e10428", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "vicinae": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1762670026, diff --git a/flake.nix b/flake.nix index 4b7a8fa..2db8c52 100644 --- a/flake.nix +++ b/flake.nix @@ -37,100 +37,96 @@ url = "github:nix-community/nixvim/nixos-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + llm-agents.url = "github:numtide/llm-agents.nix"; }; - outputs = - inputs@{ - self, - nixpkgs, - nixpkgs-unstable, - nixos-hardware, - home-manager, - ... + outputs = inputs @ { + self, + nixpkgs, + nixpkgs-unstable, + nixos-hardware, + home-manager, + ... + }: let + mkSystem = { + host, + system, + profile, + extraModules ? [], }: - let - mkSystem = - { - host, - system, - profile, - extraModules ? [ ], - }: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - inherit host; - inherit profile; - }; - modules = [ + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + inherit host; + inherit profile; + }; + modules = + [ ./overlays ./modules/core ./profiles/${profile}.nix ./hosts/${host} ] ++ extraModules; - }; - in - { - nixosConfigurations = { - x1g9 = mkSystem { - host = "x1g9"; - system = "x86_64-linux"; - profile = "laptop"; - extraModules = [ ]; - }; - x1g13-wsl = mkSystem { - host = "x1g13-wsl"; - system = "x86_64-linux"; - profile = "cli"; - extraModules = [ ]; - }; - x1g13 = mkSystem { - host = "x1g13"; - system = "x86_64-linux"; - profile = "laptop"; - extraModules = [ ]; - }; - monitor = mkSystem { - host = "monitor"; - system = "x86_64-linux"; - profile = "cli-server"; - extraModules = [ ]; - }; - dev-1 = mkSystem { - host = "dev-1"; - system = "x86_64-linux"; - profile = "cli-server"; - extraModules = [ ]; - }; - service-1 = mkSystem { - host = "service-1"; - system = "x86_64-linux"; - profile = "cli-server"; - extraModules = [ ]; - }; - openclaw = mkSystem { - host = "openclaw"; - system = "x86_64-linux"; - profile = "cli-server"; - extraModules = [ ]; - }; }; - - devShells = { - x86_64-linux = - let - pkgs = import nixpkgs { - system = "x86_64-linux"; - config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "ngrok" ]; - }; - in - { - next-web = import ./shells/next-web.nix { inherit pkgs; }; - jupyter = import ./shells/jupyter.nix { inherit pkgs; }; - rust = import ./shells/rust/default.nix { inherit pkgs; }; - }; + in { + nixosConfigurations = { + x1g9 = mkSystem { + host = "x1g9"; + system = "x86_64-linux"; + profile = "laptop"; + extraModules = []; + }; + x1g13-wsl = mkSystem { + host = "x1g13-wsl"; + system = "x86_64-linux"; + profile = "cli"; + extraModules = []; + }; + x1g13 = mkSystem { + host = "x1g13"; + system = "x86_64-linux"; + profile = "laptop"; + extraModules = []; + }; + monitor = mkSystem { + host = "monitor"; + system = "x86_64-linux"; + profile = "cli-server"; + extraModules = []; + }; + dev-1 = mkSystem { + host = "dev-1"; + system = "x86_64-linux"; + profile = "cli-server"; + extraModules = []; + }; + service-1 = mkSystem { + host = "service-1"; + system = "x86_64-linux"; + profile = "cli-server"; + extraModules = []; + }; + openclaw = mkSystem { + host = "openclaw"; + system = "x86_64-linux"; + profile = "cli-server"; + extraModules = []; }; }; + + devShells = { + x86_64-linux = let + pkgs = import nixpkgs { + system = "x86_64-linux"; + config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) ["ngrok"]; + }; + in { + next-web = import ./shells/next-web.nix {inherit pkgs;}; + jupyter = import ./shells/jupyter.nix {inherit pkgs;}; + rust = import ./shells/rust/default.nix {inherit pkgs;}; + }; + }; + }; } diff --git a/modules/core/packages.nix b/modules/core/packages.nix index 1c974ac..4f6d0c5 100644 --- a/modules/core/packages.nix +++ b/modules/core/packages.nix @@ -59,6 +59,7 @@ in { gradle python312 uv - zellij + inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.claude-code + inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex ]; } diff --git a/modules/home/claude.nix b/modules/home/claude.nix new file mode 100644 index 0000000..0c9758d --- /dev/null +++ b/modules/home/claude.nix @@ -0,0 +1,9 @@ +{...}: { + home.file.".claude/settings.json".text = builtins.toJSON { + statusLine = { + type = "command"; + command = "claude x ccusage statusline --no-offline"; + padding = 0; + }; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix index 728ffc6..3f5c4a9 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -7,5 +7,7 @@ ./nixvim ./zsh.nix ./environment.nix + ./zellij.nix + ./claude.nix ]; } diff --git a/modules/home/nixvim/keymaps.nix b/modules/home/nixvim/keymaps.nix index 6429990..f8be1c9 100644 --- a/modules/home/nixvim/keymaps.nix +++ b/modules/home/nixvim/keymaps.nix @@ -34,5 +34,10 @@ in { # Diagnostics (mk "xx" "Trouble diagnostics toggle" "エラー一覧") + + # Buffer Bar + (mk "bh" "BufferPrevious" "前のバッファーに移動") + (mk "bl" "BufferNext" "後のバッファーに移動") + (mk "bc" "BufferClose" "バッファーを削除") ]; } diff --git a/modules/home/nixvim/plugins/ui/barbar.nix b/modules/home/nixvim/plugins/ui/barbar.nix new file mode 100644 index 0000000..2d9926a --- /dev/null +++ b/modules/home/nixvim/plugins/ui/barbar.nix @@ -0,0 +1,26 @@ +{...}: { + programs.nixvim.plugins.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; + }; + }; + }; +} diff --git a/modules/home/nixvim/plugins/ui/default.nix b/modules/home/nixvim/plugins/ui/default.nix index 5541dc5..cda580f 100644 --- a/modules/home/nixvim/plugins/ui/default.nix +++ b/modules/home/nixvim/plugins/ui/default.nix @@ -7,5 +7,6 @@ ./web-devicons.nix ./toggleterm.nix ./treesitter.nix + ./barbar.nix ]; } diff --git a/modules/home/zellij.nix b/modules/home/zellij.nix new file mode 100644 index 0000000..699d2bc --- /dev/null +++ b/modules/home/zellij.nix @@ -0,0 +1,29 @@ +{...}: { + programs.zellij = { + enable = true; + + enableZshIntegration = false; + + settings = { + pane_frames = true; + }; + + 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" + } + } + } + ''; + }; +}