From 40bfd1cdf6a4625269c0834a5c97deed3f1ce4fd Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Wed, 25 Jun 2025 22:30:54 -0700 Subject: [PATCH] Rollback devenv config --- emacs/init.el | 35 +---------------------------------- nix/home.nix | 1 - nix/modules/fish/default.nix | 34 ---------------------------------- 3 files changed, 1 insertion(+), 69 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index 961cf25..d73e3a2 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -1047,40 +1047,7 @@ any directory proffered by `consult-dir'." (eshell/cd (substring-no-properties (consult-dir--pick "Switch directory: "))))) (t (eshell/cd (if regexp (eshell-find-previous-directory regexp) - (completing-read "cd: " eshell-dirs))))))) - - (defun eshell/mkenv (&rest args) - "Initialize a devenv environment or configure its .envrc. - -With optional argument --here or -h, forces execution in the -current directory instead of the project root." - (interactive) - (let* ((here-flag (or (member "--here" args) (member "-h" args))) - (project-root - ;; Use Projectile to find the root if available, otherwise fallback to git. - (cond - ((fboundp 'project-root) (project-root (project-current))) - ((shell-command-to-string "git rev-parse --is-inside-work-tree") - (string-trim (shell-command-to-string "git rev-parse --show-toplevel"))))) - (target-dir - (if (or here-flag (not project-root)) - default-directory - project-root)) - ;; Localize all file operations to the target directory - (default-directory target-dir)) - - (if (not (file-exists-p "devenv.nix")) - ;; If it doesn't exist, we assume this is a new project. - (call-process "devenv" nil 0 nil "init")) - - (when (not (file-exists-p ".envrc")) - ;; If .envrc is missing, create and configure it for devenv. - (with-temp-file ".envrc" - (insert "eval \"$(devenv direnvrc)\""))) - - (if (file-exists-p "devenv.nix") - (find-file (expand-file-name "devenv.nix" target-dir)) - (message "Could not open devenv.nix as it was not created."))))) + (completing-read "cd: " eshell-dirs)))))))) (use-package eshell :bind (:map eshell-hist-mode-map diff --git a/nix/home.nix b/nix/home.nix index 70e5358..c9dc4fe 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -28,7 +28,6 @@ aider-chat sops just - devenv ]; imports = [ diff --git a/nix/modules/fish/default.nix b/nix/modules/fish/default.nix index c626a11..97da9ea 100644 --- a/nix/modules/fish/default.nix +++ b/nix/modules/fish/default.nix @@ -64,40 +64,6 @@ let tide_conf = builtins.readFile ./tide_config.fish; in command ssh $argv end - function mkenv --description "Initialize a devenv environment or configure its .envrc" - argparse --name=mkenv h/here -- $argv - or return 1 # Exit if parsing fails - - # Default target directory is the current directory. - set -l target_dir "." - - # Check if we are inside a Git repository's working tree. - if git rev-parse --is-inside-work-tree >/dev/null 2>&1 - if not set -q _flag_here; and not test -f devenv.nix - set target_dir (git rev-parse --show-toplevel) - end - end - - pushd "$target_dir" - - # Check for the existence of the primary devenv configuration file. - if not test -f "devenv.nix" - devenv init - else - # If devenv.nix exists, check for the direnv configuration file. - if not test -f ".envrc" - echo 'eval "$(devenv direnvrc)"' > .envrc - direnv allow - end - end - - if test -f "devenv.nix" - emacsclient devenv.nix - else - echo -e "\e[31mCould not open devenv.nix as it was not created.\e[0m" - end - end - if test -f $HOME/.cargo/env.fish source "$HOME/.cargo/env.fish" end