From ae9427b50802bac4ea26b4043edc4503a3185dfb Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 11:25:47 +0200 Subject: [PATCH 1/6] fix temp bug Former-commit-id: 757224a73f7dbabed74e77640dd11e8267517978 --- home/programs/nvim/plugins/utils.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/programs/nvim/plugins/utils.nix b/home/programs/nvim/plugins/utils.nix index 81c3991..7385ecc 100644 --- a/home/programs/nvim/plugins/utils.nix +++ b/home/programs/nvim/plugins/utils.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ config, lib, pkgs, ... }: { programs.nixvim = { nixpkgs.config.allowUnfree = true; # For copilot highlightOverride = { @@ -6,7 +6,11 @@ }; plugins = { bufferline.enable = true; - # copilot-vim.enable = true; + copilot-vim = { + enable = true; + # FIXME: Temp issue solving + settings.node_command = lib.getExe pkgs.nodejs_20; + }; flash.enable = true; tmux-navigator.enable = true; todo-comments.enable = true; From dac3b34e648915c5cb428cddd5f6bef297c8ff2f Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:22:23 +0200 Subject: [PATCH 2/6] new function for copying text to chatgpt Former-commit-id: eb1f6b2e8bc037c6aa3eb30bad014dd0c5b3b671 --- home/programs/shell/zsh.nix | 52 +++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/home/programs/shell/zsh.nix b/home/programs/shell/zsh.nix index fd430f7..76e0793 100644 --- a/home/programs/shell/zsh.nix +++ b/home/programs/shell/zsh.nix @@ -17,28 +17,40 @@ in { }; historySubstringSearch.enable = true; - initExtraFirst = '' - bindkey -e - ${if fetch == "neofetch" then - pkgs.neofetch + "/bin/neofetch" - else if fetch == "nerdfetch" then - "nerdfetch" - else if fetch == "pfetch" then - "echo; ${pkgs.pfetch}/bin/pfetch" - else - ""} + initExtraFirst = + #bash + '' + bindkey -e + ${if fetch == "neofetch" then + pkgs.neofetch + "/bin/neofetch" + else if fetch == "nerdfetch" then + "nerdfetch" + else if fetch == "pfetch" then + "echo; ${pkgs.pfetch}/bin/pfetch" + else + ""} - function sesh-sessions() { - session=$(sesh list -t -c | fzf --height 70% --reverse) - [[ -z "$session" ]] && return - sesh connect $session - } + function sesh-sessions() { + session=$(sesh list -t -c | fzf --height 70% --reverse) + [[ -z "$session" ]] && return + sesh connect $session + } - zle -N sesh-sessions - bindkey -M emacs '\es' sesh-sessions - bindkey -M vicmd '\es' sesh-sessions - bindkey -M viins '\es' sesh-sessions - ''; + function chatgptlist(){ + for arg in "$@"; do + echo "$arg:" + echo "\`\`\`" + cat "$arg" + echo "\`\`\`" + echo + done + } + + zle -N sesh-sessions + bindkey -M emacs '\es' sesh-sessions + bindkey -M vicmd '\es' sesh-sessions + bindkey -M viins '\es' sesh-sessions + ''; history = { ignoreDups = true; From b25ce91ca082255226a592cd330e03a51726e716 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:22:27 +0200 Subject: [PATCH 3/6] lsp config Former-commit-id: 10dffe8d922e43f62a8ba98d85d5a9d74c1bdde4 --- home/programs/nvim/options.nix | 4 ++++ home/programs/nvim/plugins/lsp.nix | 2 ++ 2 files changed, 6 insertions(+) diff --git a/home/programs/nvim/options.nix b/home/programs/nvim/options.nix index 5a9e983..9d7f74d 100644 --- a/home/programs/nvim/options.nix +++ b/home/programs/nvim/options.nix @@ -1,6 +1,10 @@ { programs.nixvim = { globals.mapleader = " "; + diagnostics = { + virtual_lines = { only_current_line = true; }; + virtual_text = true; + }; opts = { autoindent = true; diff --git a/home/programs/nvim/plugins/lsp.nix b/home/programs/nvim/plugins/lsp.nix index 2990a27..9a973b3 100644 --- a/home/programs/nvim/plugins/lsp.nix +++ b/home/programs/nvim/plugins/lsp.nix @@ -3,6 +3,7 @@ lsp-format.enable = true; lsp = { enable = true; + inlayHints = true; servers = { bashls.enable = true; gopls.enable = true; @@ -16,6 +17,7 @@ none-ls = { enable = true; sources = { + completion = { luasnip.enable = true; }; diagnostics = { golangci_lint.enable = true; statix.enable = true; From b22bd95f9f8dbd6ad54d3375e6f6ad93f1c4fb4e Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:42:58 +0200 Subject: [PATCH 4/6] lsp edit config Former-commit-id: ee38dd75dc0472d8d336d8902f40c6ebb3c1894f --- home/programs/nvim/options.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/programs/nvim/options.nix b/home/programs/nvim/options.nix index 9d7f74d..f7d9a17 100644 --- a/home/programs/nvim/options.nix +++ b/home/programs/nvim/options.nix @@ -2,8 +2,8 @@ programs.nixvim = { globals.mapleader = " "; diagnostics = { - virtual_lines = { only_current_line = true; }; virtual_text = true; + virtual_improved = { current_line = "only"; }; }; opts = { autoindent = true; From b8ceb39db91ad49a121673a4f9f6a95b9127f016 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:43:03 +0200 Subject: [PATCH 5/6] fix issue Former-commit-id: c110983dcfcf060d98b20e8c19b082d9b0f51a82 --- home/scripts/nixy/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index 38f9e7e..5650e18 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -51,7 +51,8 @@ let [[ $1 == "" ]] && ui if [[ $1 == "rebuild" ]];then - git add . && sudo nixos-rebuild switch --flake ${configDirectory}#${hostname} + cd ${configDirectory} && git add . + sudo nixos-rebuild switch --flake ${configDirectory}#${hostname} elif [[ $1 == "upgrade" ]];then sudo nixos-rebuild switch --upgrade --flake '${configDirectory}#${hostname}' elif [[ $1 == "update" ]];then From 13578f0f2fd7c0a9ff96dfc7c8beaf8b0197d106 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:39:42 +0200 Subject: [PATCH 6/6] init nixos search api Former-commit-id: 0770bedfdbcd56c8740afa013c29c30c9af64092 --- flake.nix | 1 + server-modules/nixos-search-api.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 server-modules/nixos-search-api.nix diff --git a/flake.nix b/flake.nix index 04559a2..dc3fa54 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; }; + nixos-search-api.url = "github:anotherhadi/nixos-search-api"; }; outputs = inputs@{ nixpkgs, ... }: { diff --git a/server-modules/nixos-search-api.nix b/server-modules/nixos-search-api.nix new file mode 100644 index 0000000..4868d5c --- /dev/null +++ b/server-modules/nixos-search-api.nix @@ -0,0 +1,19 @@ +{ inputs, config, ... }: +let domain = "nixos-search-api.hadi.diy"; +in { + imports = [ inputs.nixos-search-api.nixosModules.nixos-search-api ]; + + services.nixos-search-api = { + enable = true; + port = 8089; + }; + + nginx.virtualHosts."${domain}" = { + useACMEHost = "hadi.diy"; + forceSSL = true; + locations."/" = { + proxyPass = + "http://127.0.0.1:${toString config.services.nixos-search-api.port}"; + }; + }; +}