diff --git a/flake.lock b/flake.lock index 3b53174..effa4b3 100644 --- a/flake.lock +++ b/flake.lock @@ -209,11 +209,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1761103959, - "narHash": "sha256-TSle1gTii9QSLZIaGdpts0G+9E+vCHksnS5nsreyf1c=", + "lastModified": 1761533636, + "narHash": "sha256-4xLNB3dIObQIA8m5WFR/ikssWddGc9l5QsyQNaLuoeU=", "owner": "numtide", "repo": "nix-ai-tools", - "rev": "2191428a02fc107acbbadd796bf80076a7baa770", + "rev": "07559be9aee853a3a5968f2fcda14c07477a132d", "type": "github" }, "original": { @@ -380,11 +380,11 @@ ] }, "locked": { - "lastModified": 1760945191, - "narHash": "sha256-ZRVs8UqikBa4Ki3X4KCnMBtBW0ux1DaT35tgsnB1jM4=", + "lastModified": 1761311587, + "narHash": "sha256-Msq86cR5SjozQGCnC6H8C+0cD4rnx91BPltZ9KK613Y=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "f56b1934f5f8fcab8deb5d38d42fd692632b47c2", + "rev": "2eddae033e4e74bf581c2d1dfa101f9033dbd2dc", "type": "github" }, "original": { diff --git a/modules/darwin/system.nix b/modules/darwin/system.nix index 82898d4..8a92b20 100644 --- a/modules/darwin/system.nix +++ b/modules/darwin/system.nix @@ -23,11 +23,20 @@ }; }; - environment.shells = [ pkgs.nushell ]; + environment.shells = [ pkgs.nushell "/etc/profiles/per-user/${user}/bin/nu" ]; + + # Set XDG Base Directory environment variables globally + # This ensures nushell and other XDG-compliant tools use ~/.config + environment.variables = { + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_CACHE_HOME = "$HOME/.cache"; + }; users.users.${user} = { home = lib.mkDefault "/Users/${user}"; - shell = pkgs.nushell; + # Use the Home Manager nushell which has proper config setup + shell = "/etc/profiles/per-user/${user}/bin/nu"; }; system = { diff --git a/modules/home/rsydn/shell/fish.nix b/modules/home/rsydn/shell/fish.nix index a413eb2..efa494c 100644 --- a/modules/home/rsydn/shell/fish.nix +++ b/modules/home/rsydn/shell/fish.nix @@ -1,6 +1,4 @@ { config, pkgs, lib, ... }: { - imports = [ ./oh-my-posh ]; - programs.fish = { enable = true; interactiveShellInit = '' @@ -10,8 +8,6 @@ ''; }; - programs.oh-my-posh.enableFishIntegration = lib.mkDefault true; - # Ensure fish is available for login shells on Linux hosts. home.packages = lib.mkAfter [ pkgs.fish ]; } diff --git a/modules/home/rsydn/shell/nushell.nix b/modules/home/rsydn/shell/nushell.nix index a8c594d..9bbfb19 100644 --- a/modules/home/rsydn/shell/nushell.nix +++ b/modules/home/rsydn/shell/nushell.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: let profileBin = "${config.home.profileDirectory}/bin"; + # System binaries path - same on both NixOS and Darwin systemBin = "/run/current-system/sw/bin"; defaultBin = "/nix/var/nix/profiles/default/bin"; darwinHomebrewDir = if pkgs.stdenv.hostPlatform.isAarch64 then @@ -25,50 +26,53 @@ let formatPathList = paths: lib.concatMapStrings (path: " \"${path}\"\n") paths; in { - imports = [ ./oh-my-posh ]; - programs.nushell.enable = lib.mkDefault true; programs.nushell.extraConfig = '' # Dotfiles QA validation command - def dotfiles-qa [] { - let dotfiles_dir = "${config.home.homeDirectory}/Development/dotfiles" + def dotfiles-qa [] { + let dotfiles_dir = "${config.home.homeDirectory}/Development/dotfiles" - print $"(ansi green_bold)Running dotfiles QA validation...(ansi reset)\n" + print $"(ansi green_bold)Running dotfiles QA validation...(ansi reset)\n" - # Step 1: Format check - print $"(ansi blue)1. Formatting nix files...(ansi reset)" - cd $dotfiles_dir - nix fmt . - if $env.LAST_EXIT_CODE != 0 { - print $"(ansi red_bold)✗ Formatting failed(ansi reset)" - return + # Step 1: Format check + print $"(ansi blue)1. Formatting nix files...(ansi reset)" + cd $dotfiles_dir + nix fmt . + if $env.LAST_EXIT_CODE != 0 { + print $"(ansi red_bold)✗ Formatting failed(ansi reset)" + return + } + print $"(ansi green)✓ Formatting complete(ansi reset)\n" + + # Step 2: Flake check + print $"(ansi blue)2. Running flake check...(ansi reset)" + nix flake check + if $env.LAST_EXIT_CODE != 0 { + print $"(ansi red_bold)✗ Flake check failed(ansi reset)" + return + } + print $"(ansi green)✓ Flake check passed(ansi reset)\n" + + # Step 3: Build (without activation) + print $"(ansi blue)3. Building darwin configuration (no activation)...(ansi reset)" + darwin-rebuild build --flake $"($dotfiles_dir)#macbook-pro" + if $env.LAST_EXIT_CODE != 0 { + print $"(ansi yellow)⚠ Build had warnings, but may still work(ansi reset)\n" + } else { + print $"(ansi green)✓ Build successful(ansi reset)\n" + } + + print $"(ansi green_bold)✓ Core QA checks passed!(ansi reset)" } - print $"(ansi green)✓ Formatting complete(ansi reset)\n" - - # Step 2: Flake check - print $"(ansi blue)2. Running flake check...(ansi reset)" - nix flake check - if $env.LAST_EXIT_CODE != 0 { - print $"(ansi red_bold)✗ Flake check failed(ansi reset)" - return - } - print $"(ansi green)✓ Flake check passed(ansi reset)\n" - - # Step 3: Build (without activation) - print $"(ansi blue)3. Building darwin configuration (no activation)...(ansi reset)" - darwin-rebuild build --flake $"($dotfiles_dir)#macbook-pro" - if $env.LAST_EXIT_CODE != 0 { - print $"(ansi yellow)⚠ Build had warnings, but may still work(ansi reset)\n" - } else { - print $"(ansi green)✓ Build successful(ansi reset)\n" - } - - print $"(ansi green_bold)✓ Core QA checks passed!(ansi reset)" - } ''; programs.nushell.envFile.text = '' + # Set XDG Base Directory environment variables + $env.XDG_CONFIG_HOME = "${config.xdg.configHome}" + $env.XDG_DATA_HOME = "${config.xdg.dataHome}" + $env.XDG_CACHE_HOME = "${config.xdg.cacheHome}" + let nix_paths = [ ${formatPathList [ profileBin systemBin defaultBin ]} ] @@ -113,6 +117,4 @@ in { load-secret "groq-api-key" "GROQ_API_KEY" load-secret "firecrawl-api-key" "FIRECRAWL_API_KEY" ''; - - programs.oh-my-posh.enableNushellIntegration = lib.mkDefault true; } diff --git a/modules/home/rsydn/shell/oh-my-posh/capr4n.omp.json b/modules/home/rsydn/shell/oh-my-posh/capr4n.omp.json deleted file mode 100644 index a86b29c..0000000 --- a/modules/home/rsydn/shell/oh-my-posh/capr4n.omp.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", - "blocks": [ - { - "alignment": "right", - "segments": [ - { - "background": "#003543", - "foreground": "#ffffff", - "style": "plain", - "template": " \ue641 {{ .CurrentDate | date .Format }} ", - "type": "time" - }, - { - "background": "#83769c", - "foreground": "#ffffff", - "properties": { - "always_enabled": true - }, - "style": "plain", - "template": " \ueba2 {{ .FormattedMs }} ", - "type": "executiontime" - } - ], - "type": "rprompt" - }, - { - "alignment": "left", - "segments": [ - { - "background": "#61AFEF", - "foreground": "#ffffff", - "properties": { - "display_host": false - }, - "style": "diamond", - "template": "{{if .Root}} \uf0e7 {{.UserName}} {{else}} {{.UserName}} {{end}}", - "trailing_diamond": "\ue0b0", - "type": "session" - }, - { - "background": "#C678DD", - "foreground": "#ffffff", - "powerline_symbol": "\ue0b0", - "properties": { - "folder_icon": "\uf115", - "folder_separator_icon": " \ue0b1 ", - "max_depth": 2, - "style": "agnoster_short" - }, - "style": "powerline", - "template": " {{ .Path }} ", - "type": "path" - }, - { - "background": "#95ffa4", - "foreground": "#193549", - "powerline_symbol": "\ue0b0", - "properties": { - "fetch_status": true - }, - "style": "powerline", - "template": " {{ .HEAD }}{{ if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{- $staged := add .Staging.Added (add .Staging.Modified (add .Staging.Deleted .Staging.Unmerged)) -}}{{ if gt $staged 0 }} ^{{$staged}}{{ end }}{{ if gt .Working.Modified 0 }} ~{{ .Working.Modified }}{{ end }}{{ if gt .Working.Deleted 0 }} -{{ .Working.Deleted }}{{ end }}{{ if gt .Working.Untracked 0 }} +{{ .Working.Untracked }}{{ end }} ", - "type": "git" - } - ], - "type": "prompt" - }, - { - "alignment": "left", - "newline": true, - "segments": [ - { - "foreground": "#61AFEF", - "style": "plain", - "template": "❯ ", - "type": "text" - } - ], - "type": "prompt" - } - ], - "console_title_template": "{{if .Root}} \u26a1 {{end}}{{.UserName}} \u2794 📁{{.Folder}}", - "final_space": true, - "version": 3 -} diff --git a/modules/home/rsydn/shell/oh-my-posh/default.nix b/modules/home/rsydn/shell/oh-my-posh/default.nix deleted file mode 100644 index 4e38644..0000000 --- a/modules/home/rsydn/shell/oh-my-posh/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, ... }: -let - themeName = "capr4n.omp.json"; - themeSource = ./capr4n.omp.json; - themeConfigPath = "${config.xdg.configHome}/oh-my-posh/${themeName}"; -in { - programs.oh-my-posh = { - enable = lib.mkDefault true; - configFile = themeConfigPath; - }; - - xdg.configFile."oh-my-posh/${themeName}".source = themeSource; -}