From 1fbecfd579912385d5ab8e66d652ca25b8e4b164 Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Tue, 21 Oct 2025 13:10:18 +0700 Subject: [PATCH] refactor: project repo changes --- .mcp.json | 5 +++-- devshells/README.md | 8 ++++++++ devshells/default.nix | 19 ++++++++++++++++++- flake.nix | 2 +- modules/darwin/home/default.nix | 8 ++++++++ .../home}/programs/aerospace/default.nix | 0 .../home}/programs/aerospace/modes.nix | 0 .../programs/aerospace/user-settings.nix | 0 .../home}/programs/aerospace/workspaces.nix | 0 .../home}/programs/ghostty.nix | 0 modules/home/rsydn/base.nix | 2 -- 11 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 modules/darwin/home/default.nix rename modules/{home/rsydn => darwin/home}/programs/aerospace/default.nix (100%) rename modules/{home/rsydn => darwin/home}/programs/aerospace/modes.nix (100%) rename modules/{home/rsydn => darwin/home}/programs/aerospace/user-settings.nix (100%) rename modules/{home/rsydn => darwin/home}/programs/aerospace/workspaces.nix (100%) rename modules/{home/rsydn => darwin/home}/programs/ghostty.nix (100%) diff --git a/.mcp.json b/.mcp.json index a963895..77da6d9 100644 --- a/.mcp.json +++ b/.mcp.json @@ -1,8 +1,9 @@ { "mcpServers": { "nixos": { - "command": "uvx", + "type": "stdio", + "command": "/etc/profiles/per-user/rasyidanakbar/bin/uvx", "args": ["mcp-nixos"] } } -} \ No newline at end of file +} diff --git a/devshells/README.md b/devshells/README.md index d2dcfda..5e5872b 100644 --- a/devshells/README.md +++ b/devshells/README.md @@ -13,6 +13,14 @@ Basic shell with git and nixfmt for dotfiles development. nix develop # or: nix develop .#default ``` +**Includes:** +- Git +- nixfmt-classic +- uv (for `uvx` commands) + +**MCP helper:** +- `mcp-nixos` alias pins UV caches to `.cache/` so `uvx mcp-nixos` works without extra setup; useful before launching Codex. + ### `python-uv` Python development with UV package manager. diff --git a/devshells/default.nix b/devshells/default.nix index 7659040..9296edf 100644 --- a/devshells/default.nix +++ b/devshells/default.nix @@ -2,8 +2,25 @@ pkgs.mkShell { name = "default"; - packages = with pkgs; [ git nixfmt-classic ]; + packages = with pkgs; [ + git + nixfmt-classic + uv + ]; shellHook = '' + export DOTFILES_ROOT="$PWD" + export XDG_CACHE_HOME="$DOTFILES_ROOT/.cache" + export UV_CACHE_DIR="$XDG_CACHE_HOME/uv" + export UV_TOOL_HOME="$XDG_CACHE_HOME/uv-tools" + export XDG_DATA_HOME="$DOTFILES_ROOT/.cache/xdg-data" + export UV_PYTHON_DOWNLOADS=never + export MCP_CONFIG_PATH="$DOTFILES_ROOT/.mcp.json" + + mkdir -p "$XDG_CACHE_HOME" "$UV_CACHE_DIR" "$UV_TOOL_HOME" "$XDG_DATA_HOME" + + alias mcp-nixos='XDG_CACHE_HOME="$XDG_CACHE_HOME" XDG_DATA_HOME="$XDG_DATA_HOME" UV_CACHE_DIR="$UV_CACHE_DIR" UV_TOOL_HOME="$UV_TOOL_HOME" UV_PYTHON_DOWNLOADS="$UV_PYTHON_DOWNLOADS" uvx mcp-nixos' + echo "Loaded default shell for dotfiles development" + echo "MCP helper alias ready: mcp-nixos" ''; } diff --git a/flake.nix b/flake.nix index f3b4fc4..26b52cd 100644 --- a/flake.nix +++ b/flake.nix @@ -51,7 +51,7 @@ user = "rasyidanakbar"; mkDarwin = { system ? "aarch64-darwin", extraModules ? [ ] - , homeFile ? ./modules/home/rsydn/base.nix }: + , homeFile ? ./modules/darwin/home/default.nix }: let pkgs = mkPkgs system; in darwin.lib.darwinSystem { inherit system pkgs; diff --git a/modules/darwin/home/default.nix b/modules/darwin/home/default.nix new file mode 100644 index 0000000..9e88c9d --- /dev/null +++ b/modules/darwin/home/default.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: { + # Import shared cross-platform home configuration + imports = [ + ../../home/rsydn/base.nix + ./programs/aerospace + ./programs/ghostty.nix + ]; +} diff --git a/modules/home/rsydn/programs/aerospace/default.nix b/modules/darwin/home/programs/aerospace/default.nix similarity index 100% rename from modules/home/rsydn/programs/aerospace/default.nix rename to modules/darwin/home/programs/aerospace/default.nix diff --git a/modules/home/rsydn/programs/aerospace/modes.nix b/modules/darwin/home/programs/aerospace/modes.nix similarity index 100% rename from modules/home/rsydn/programs/aerospace/modes.nix rename to modules/darwin/home/programs/aerospace/modes.nix diff --git a/modules/home/rsydn/programs/aerospace/user-settings.nix b/modules/darwin/home/programs/aerospace/user-settings.nix similarity index 100% rename from modules/home/rsydn/programs/aerospace/user-settings.nix rename to modules/darwin/home/programs/aerospace/user-settings.nix diff --git a/modules/home/rsydn/programs/aerospace/workspaces.nix b/modules/darwin/home/programs/aerospace/workspaces.nix similarity index 100% rename from modules/home/rsydn/programs/aerospace/workspaces.nix rename to modules/darwin/home/programs/aerospace/workspaces.nix diff --git a/modules/home/rsydn/programs/ghostty.nix b/modules/darwin/home/programs/ghostty.nix similarity index 100% rename from modules/home/rsydn/programs/ghostty.nix rename to modules/darwin/home/programs/ghostty.nix diff --git a/modules/home/rsydn/base.nix b/modules/home/rsydn/base.nix index 6070361..3bd2242 100644 --- a/modules/home/rsydn/base.nix +++ b/modules/home/rsydn/base.nix @@ -2,10 +2,8 @@ home.stateVersion = "24.05"; imports = [ - ./programs/aerospace ./programs/helix.nix ./programs/neovim.nix - ./programs/ghostty.nix ./shell/nushell.nix ./shell/tmux.nix ./devtools/ai-tools.nix