From 692b42ffa4510b341be8e30a27809c11a75cf449 Mon Sep 17 00:00:00 2001 From: Surendra Jammishetti Date: Sun, 7 Dec 2025 21:18:49 -0800 Subject: [PATCH] nyx --- flake.nix | 2 +- modules/home/prompts/default.nix | 2 +- modules/home/prompts/oh-my-posh/default.nix | 14 +- modules/home/shells/zsh/default.nix | 11 +- modules/home/term/ghostty/default.nix | 4 +- modules/home/tools/helix/config.toml | 36 ++++ modules/home/tools/helix/default.nix | 189 ++---------------- modules/home/tools/helix/ignore | 13 ++ modules/home/tools/helix/languages.toml | 89 +++++++++ .../helix/{theme-trans.toml => theme.toml} | 0 modules/home/wm/aerospace/default.nix | 10 +- users/suri/Daedalus.nix | 10 + users/suri/Deadalus.nix | 8 - 13 files changed, 190 insertions(+), 198 deletions(-) create mode 100644 modules/home/tools/helix/config.toml create mode 100644 modules/home/tools/helix/ignore create mode 100644 modules/home/tools/helix/languages.toml rename modules/home/tools/helix/{theme-trans.toml => theme.toml} (100%) create mode 100644 users/suri/Daedalus.nix delete mode 100644 users/suri/Deadalus.nix diff --git a/flake.nix b/flake.nix index 7a0bc71..5b5e207 100644 --- a/flake.nix +++ b/flake.nix @@ -70,7 +70,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users.suri = import ./users/suri/Deadalus.nix; + users.suri = import ./users/suri/Daedalus.nix; backupFileExtension = "backup"; }; } diff --git a/modules/home/prompts/default.nix b/modules/home/prompts/default.nix index eaae42b..d368975 100644 --- a/modules/home/prompts/default.nix +++ b/modules/home/prompts/default.nix @@ -1 +1 @@ -{ imports = [ ./oh-my-posh ]; } +{ ... }: { imports = [ ./oh-my-posh ]; } diff --git a/modules/home/prompts/oh-my-posh/default.nix b/modules/home/prompts/oh-my-posh/default.nix index e9caf50..c603f6d 100644 --- a/modules/home/prompts/oh-my-posh/default.nix +++ b/modules/home/prompts/oh-my-posh/default.nix @@ -1,10 +1,14 @@ -{ lib, pkgs, ... }: +{ config, lib, pkgs, ... }: with lib; - -let cfg = config.programs.oh-my-posh; +let cfg = config.nyx.oh-my-posh; in { - config = mkIf (cfg.enable) { home.pakages = [ pkgs.oh-my-posh ]; }; - home.file.".config/oh-my-posh/theme.toml".source = ./mypure.omp.toml; + options.nyx.oh-my-posh = { enable = mkEnableOption "Oh-My-Posh"; }; + + config = mkIf (cfg.enable) { + home.packages = [ pkgs.oh-my-posh ]; + + home.file.".config/oh-my-posh/theme.toml".source = ./mypure.omp.toml; + }; } diff --git a/modules/home/shells/zsh/default.nix b/modules/home/shells/zsh/default.nix index d76ac10..ebdbdd6 100644 --- a/modules/home/shells/zsh/default.nix +++ b/modules/home/shells/zsh/default.nix @@ -1,8 +1,7 @@ -{ lib, pkgs, ... }: +{ lib, pkgs, config, ... }: with lib; - let - cfg = config.programs.zsh; + cfg = config.nyx.zsh; zsh_history_fix = pkgs.writeShellScriptBin "zsh_history_fix" '' mv ~/.zsh_history ~/.zsh_history_bad strings ~/.zsh_history_bad > ~/.zsh_history @@ -12,14 +11,10 @@ let ''; in { - options.programs.zsh = { enable = mkEnableOption "Zsh"; }; + options.nyx.zsh = { enable = mkEnableOption "Zsh"; }; config = mkIf (cfg.enable) { - programs.zoxide.enable = true; - - home.file.".config/oh-my-posh/theme.toml".source = ./mypure.omp.toml; - home.packages = with pkgs; [ fd eza zsh_history_fix ]; programs.zsh = { enable = true; diff --git a/modules/home/term/ghostty/default.nix b/modules/home/term/ghostty/default.nix index 54e29e6..87795fe 100644 --- a/modules/home/term/ghostty/default.nix +++ b/modules/home/term/ghostty/default.nix @@ -1,8 +1,8 @@ { lib, pkgs, config, ... }: with lib; -let cfg = config.programs.ghostty; +let cfg = config.nyx.ghostty; in { - options.programs.aerospace = { enable = mkEnableOption "Ghostty Terminal"; }; + options.nyx.ghostty = { enable = mkEnableOption "Ghostty Terminal"; }; config = mkIf (cfg.enable && pkgs.stdenv.isDarwin) { home.packages = [ pkgs.ghostty-bin ]; diff --git a/modules/home/tools/helix/config.toml b/modules/home/tools/helix/config.toml new file mode 100644 index 0000000..0142d63 --- /dev/null +++ b/modules/home/tools/helix/config.toml @@ -0,0 +1,36 @@ +theme = "theme-trans" + +[editor] +line-number = "relative" +end-of-line-diagnostics = "hint" +color-modes = true +completion-trigger-len = 1 +completion-timeout = 5 + +[editor.cursor-shape] +normal = "block" +insert = "bar" +select = "underline" + +[editor.inline-diagnostics] +cursor-line = "hint" + +[editor.auto-save] +focus-lost = true + +[editor.lsp] +display-inlay-hints = true + +[editor.statusline] +left = ["mode", "spinner", "file-name", "file-type", "total-line-numbers", "file-encoding"] +right = ["version-control", "position", "selections", "primary-selection-length", "position-percentage", "spacer", "workspace-diagnostics"] +separator = "│" + +[editor.statusline.mode] +normal = "NORMAL" +insert = "INSERT" +select = "SELECT" + +[keys.normal] +X = "extend_line_above" +ret = "goto_word" diff --git a/modules/home/tools/helix/default.nix b/modules/home/tools/helix/default.nix index 8d1174a..433927f 100644 --- a/modules/home/tools/helix/default.nix +++ b/modules/home/tools/helix/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, config, ... }: { home.file.".config/helix/ignore".text = '' !.notes/ @@ -16,7 +16,25 @@ target/ ''; - home.file.".config/helix/themes/theme-trans.toml".source = ./theme-trans.toml; + # ignore file + "${config.home.homeDirectory}/.config/helix/ignore".source = + config.lib.file.mkOutOfStoreSymLink + "${config.home.homeDirectory}/Nyx/modules/tools/helix/ignore"; + + # theme file + "${config.home.homeDirectory}/.config/helix/nyx-theme.toml".source = + config.lib.file.mkOutOfStoreSymLink + "${config.home.homeDirectory}/Nyx/modules/tools/helix/nyx-theme.toml"; + + # config.toml + "${config.home.homeDirectory}/.config/helix/config.toml".source = + config.lib.file.mkOutOfStoreSymLink + "${config.home.homeDirectory}/Nyx/modules/tools/helix/config.toml"; + + # languages.toml + "${config.home.homeDirectory}/.config/helix/languages.toml".source = + config.lib.file.mkOutOfStoreSymLink + "${config.home.homeDirectory}/Nyx/modules/tools/helix/languages.toml"; programs.helix = { enable = true; @@ -33,8 +51,6 @@ typescript-language-server svelte-language-server tailwindcss-language-server - emmet-language-server - vale-ls tinymist ltex-ls nixd @@ -44,170 +60,5 @@ ruff ]; - settings = { - # theme = "gruvbox_dark_hard"; - theme = "theme-trans"; - # theme = lib.mkForce "stylix"; - # theme = lib.mkForce "monokai_soda"; - # theme = lib.mkForce "helix-ayu"; - editor.cursor-shape = { - normal = "block"; - insert = "bar"; - select = "underline"; - - }; - - editor = { - - line-number = "relative"; - inline-diagnostics.cursor-line = "hint"; - end-of-line-diagnostics = "hint"; - color-modes = true; - completion-trigger-len = 1; - completion-timeout = 5; - - auto-save = { focus-lost = true; }; - - lsp = { display-inlay-hints = true; }; - - statusline = { - left = [ - "mode" - "spinner" - "file-name" - "file-type" - "total-line-numbers" - "file-encoding" - ]; - right = [ - "version-control" - "position" - "selections" - "primary-selection-length" - "position-percentage" - "spacer" - "workspace-diagnostics" - ]; - separator = "│"; - mode.normal = "NORMAL"; - mode.insert = "INSERT"; - mode.select = "SELECT"; - }; - }; - keys.normal = { X = "extend_line_above"; }; - keys.normal = { ret = "goto_word"; }; - - }; - - languages = { - language-server.ltex = { - command = "ltex-ls-plus"; - config.ltex.dictionary."en-US" = [ "ewwe" "flaberrasted" ]; - config.ltex.disabledRules."en-US" = [ "WHITESPACE_RULE" ]; - - }; - - language-server.rust-analyzer.config.check.command = "clippy"; - - language-server.texlab = { - command = "texlab"; - config.texlab = { - build = { - onSave = true; - forwardSearchAfter = true; - executable = "latexmk"; - args = [ - "-pdf" - "-interaction=nonstopmode" - "-synctex=1" - "-shell-escape" - "%f" - ]; - }; - forwardSearch = { - executable = "zathura"; - args = [ "--synctex-forward" "%l:%c:%f" "%p" ]; - }; - chktex = { - onOpenAndSave = true; - onEdit = true; - }; - }; - }; - - language-server.codebook = { - command = "codebook"; - args = [ "serve" ]; - - }; - - language-server.gdscript = { - command = "nc"; - args = [ "127.0.0.1" "6005" ]; - }; - - language = [ - { - name = "typst"; - auto-format = true; - formatter.command = "typstyle"; - # idk how to fucking set this shit up - # language-servers = [ "tinymist" "vale-ls" ]; - # language-servers = [ "tinymist" "ltex-ls" ]; - - language-servers = [ "tinymist" ]; - } - { - name = "latex"; - # language-servers = [ "texlab" "ltex-ls-plus" "vale-ls" ]; - language-servers = [ "texlab" "ltex-ls-plus" ]; - } - { - name = "nix"; - auto-format = true; - formatter.command = "${pkgs.nixfmt-classic}/bin/nixfmt"; - } - { - name = "svelte"; - auto-format = true; - formatter = { - command = "dprint"; - args = [ "fmt" "--stdin" "svelte" ]; - }; - language-servers = - [ "svelteserver" "tailwindcss-language-server" "codebook" ]; - } - { - name = "html"; - language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; - } - { - name = "css"; - language-servers = [ "vscode-css-language-server" "tailwindcss-ls" ]; - } - - { - name = "gdscript"; - language-servers = [ "gdscript" ]; - language-id = "gdscript"; - } - - { - name = "rust"; - language-servers = [ "rust-analyzer" "codebook" ]; - } - { - name = "markdown"; - # auto-format = true; - # formatter = { - # command = "fmt"; - # args = [ "70" ]; - # }; - language-servers = [ "codebook" "markdown-oxide" ]; - } - - ]; - }; - }; } diff --git a/modules/home/tools/helix/ignore b/modules/home/tools/helix/ignore new file mode 100644 index 0000000..24262fc --- /dev/null +++ b/modules/home/tools/helix/ignore @@ -0,0 +1,13 @@ +!.notes/ +!.gitignore +!.gitmodules +!.github/ +!.devcontainer/ +!.env* +!.sqlx/ +!.cargo/ +!.config/ +!puzzles/* +!examples/* +!inputs/* +target/ diff --git a/modules/home/tools/helix/languages.toml b/modules/home/tools/helix/languages.toml new file mode 100644 index 0000000..f13b4ef --- /dev/null +++ b/modules/home/tools/helix/languages.toml @@ -0,0 +1,89 @@ +# --- Language Servers --- + +[language-server.ltex] +command = "ltex-ls-plus" + +[language-server.ltex.config.ltex.dictionary] +"en-US" = ["ewwe", "flaberrasted"] + +[language-server.ltex.config.ltex.disabledRules] +"en-US" = ["WHITESPACE_RULE"] + +[language-server.rust-analyzer.config.check] +command = "clippy" + +[language-server.texlab] +command = "texlab" + +[language-server.texlab.config.texlab.build] +onSave = true +forwardSearchAfter = true +executable = "latexmk" +args = ["-pdf", "-interaction=nonstopmode", "-synctex=1", "-shell-escape", "%f"] + +[language-server.texlab.config.texlab.forwardSearch] +executable = "zathura" +args = ["--synctex-forward", "%l:%c:%f", "%p"] + +[language-server.texlab.config.texlab.chktex] +onOpenAndSave = true +onEdit = true + +[language-server.codebook] +command = "codebook" +args = ["serve"] + +[language-server.gdscript] +command = "nc" +args = ["127.0.0.1", "6005"] + +# --- Languages --- + +[[language]] +name = "typst" +auto-format = true +language-servers = ["tinymist"] + +[language.formatter] +command = "typstyle" + +[[language]] +name = "latex" +language-servers = ["texlab", "ltex-ls-plus"] + +[[language]] +name = "nix" +auto-format = true + +[language.formatter] +command = "nixfmt" + +[[language]] +name = "svelte" +auto-format = true +language-servers = ["svelteserver", "tailwindcss-language-server", "codebook"] + +[language.formatter] +command = "dprint" +args = ["fmt", "--stdin", "svelte"] + +[[language]] +name = "html" +language-servers = ["vscode-html-language-server", "tailwindcss-ls"] + +[[language]] +name = "css" +language-servers = ["vscode-css-language-server", "tailwindcss-ls"] + +[[language]] +name = "gdscript" +language-id = "gdscript" +language-servers = ["gdscript"] + +[[language]] +name = "rust" +language-servers = ["rust-analyzer", "codebook"] + +[[language]] +name = "markdown" +language-servers = ["codebook", "markdown-oxide"] diff --git a/modules/home/tools/helix/theme-trans.toml b/modules/home/tools/helix/theme.toml similarity index 100% rename from modules/home/tools/helix/theme-trans.toml rename to modules/home/tools/helix/theme.toml diff --git a/modules/home/wm/aerospace/default.nix b/modules/home/wm/aerospace/default.nix index 73db1a3..439a647 100644 --- a/modules/home/wm/aerospace/default.nix +++ b/modules/home/wm/aerospace/default.nix @@ -1,16 +1,18 @@ { lib, pkgs, config, ... }: - with lib; -let cfg = config.programs.aerospace; +let cfg = config.nyx.aerospace; in { - options.programs.aerospace = { + options.nyx.aerospace = { enable = mkEnableOption "AeroSpace window manager"; }; config = mkIf (cfg.enable && pkgs.stdenv.isDarwin) { home.packages = [ pkgs.aerospace ]; - home.file.".aerospace.toml".source = ./aerospace.toml; + "${config.home.homeDirectory}/.aerospace.toml".source = + + config.lib.file.mkOutOfStoreSymlink + "${config.home.homeDirectory}/Nyx/modules/home/wm/aerospace/aerospace.toml"; launchd.agents.aerospace = { enable = true; diff --git a/users/suri/Daedalus.nix b/users/suri/Daedalus.nix new file mode 100644 index 0000000..68f9795 --- /dev/null +++ b/users/suri/Daedalus.nix @@ -0,0 +1,10 @@ +{ + + imports = [ ./common.nix ../../modules/home/wm/aerospace ]; + + nyx.aerospace.enable = true; + nyx.ghostty.enable = true; + nyx.oh-my-posh.enable = true; + nyx.zsh.enable = true; + +} diff --git a/users/suri/Deadalus.nix b/users/suri/Deadalus.nix deleted file mode 100644 index 49d0677..0000000 --- a/users/suri/Deadalus.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - - imports = [ ./common.nix ../../modules/home/wm/aerospace ]; - - programs.aerospace.enable = true; - programs.ghostty.enable = true; - -} -- 2.51.2