From 93d8bcc54ba6df2aa65de2d7e2a6ba7d17ed5f1d Mon Sep 17 00:00:00 2001 From: moons-14 Date: Fri, 7 Nov 2025 16:12:32 +0900 Subject: [PATCH] chore --- flake.nix | 9 ++++--- modules/home/default.nix | 1 + modules/home/environment.nix | 7 +++++ modules/home/vicinae.nix | 4 +-- modules/home/vscode.nix | 6 +++++ modules/home/zsh.nix | 4 +++ shells/next-web.nix | 50 ++++++++++++++++++++++++++++-------- 7 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 modules/home/environment.nix diff --git a/flake.nix b/flake.nix index 5c0f980..14ddb50 100644 --- a/flake.nix +++ b/flake.nix @@ -74,9 +74,12 @@ }; devShells = { - x86_64-linux = { - next-web = import ./shells/next-web.nix { pkgs = import nixpkgs { system = "x86_64-linux"; }; }; - }; + x86_64-linux = + let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + in { + next-web = import ./shells/next-web.nix { inherit pkgs; }; + }; }; }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index 6e39b49..cc193c2 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -7,5 +7,6 @@ ./ssh.nix ./vim ./zsh.nix + ./environment.nix ]; } \ No newline at end of file diff --git a/modules/home/environment.nix b/modules/home/environment.nix new file mode 100644 index 0000000..7ce78b9 --- /dev/null +++ b/modules/home/environment.nix @@ -0,0 +1,7 @@ +{ + # use project directory: `echo 'use flake ~/dotfiles#next-web' > .envrc` + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/modules/home/vicinae.nix b/modules/home/vicinae.nix index 6274ba7..96523c8 100644 --- a/modules/home/vicinae.nix +++ b/modules/home/vicinae.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ inputs, ... }: { imports = [ inputs.vicinae.homeManagerModules.default @@ -13,7 +13,7 @@ font.size = 11; popToRootOnClose = false; rootSearch.searchFiles = false; - theme.name = "vicinae-dark"; + theme.name = "Dracula"; window = { csd = true; opacity = 0.95; diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix index 75d8aac..b0f5c51 100644 --- a/modules/home/vscode.nix +++ b/modules/home/vscode.nix @@ -109,4 +109,10 @@ in { web = mkProfile [ layers.common layers.web ] { }; }; }; + + xdg.configFile."Code/User/locale.json".text = '' + { + "locale": "ja" + } + ''; } diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix index 3178442..5c3e656 100644 --- a/modules/home/zsh.nix +++ b/modules/home/zsh.nix @@ -35,6 +35,10 @@ setopt hist_verify setopt inc_append_history_time + unsetopt SHARE_HISTORY + setopt APPEND_HISTORY + setopt INC_APPEND_HISTORY_TIME + # ---- from gist: aliases ---- alias docker-compose="docker compose" alias clearsign='export GPG_TTY=$(tty) && openssl rand -hex 16 | gpg --clearsign' diff --git a/shells/next-web.nix b/shells/next-web.nix index 76d194c..24f8ae2 100644 --- a/shells/next-web.nix +++ b/shells/next-web.nix @@ -1,13 +1,41 @@ { pkgs }: -{ - packages = with pkgs; [ - nodejs_22 - pnpm - corepack - git ripgrep fd fzf - ]; - - shellHook = '' - echo "Web dev sell ready: node $(node -v)" - ''; +let + node = pkgs.nodejs_22; +in +pkgs.mkShell { + name = "next-web"; + + packages = with pkgs; [ + node + pnpm + zsh + ]; + + NODE_ENV = "development"; + + COREPACK_HOME = "$PWD/.corepack"; + + shellHook = '' + set -e + + # ---- show tool versions + if command -v node >/dev/null; then + echo "🌱 next-web shell → node $(node -v)" + fi + if command -v pnpm >/dev/null; then + echo " pnpm $(pnpm --version)" + fi + if command -v corepack >/dev/null 2>&1; then + echo " corepack available" + if [ -f package.json ] && command -v jq >/dev/null 2>&1 && jq -e '.packageManager' package.json >/dev/null; then + COREPACK_ENABLE_DOWNLOADS=1 corepack prepare --activate || true + fi + fi + + # ---- switch to zsh (interactive only). Don't break `nix develop -c ...` + if [ -z "''${ZSH_VERSION:-}" ] && [[ $- == *i* ]] && [ -t 1 ] && [ -z "''${NIX_SHELL_ZSH_ACTIVATED:-}" ]; then + export NIX_SHELL_ZSH_ACTIVATED=1 + exec ${pkgs.zsh}/bin/zsh -i + fi + ''; }