This commit is contained in:
Chris Cochrun 2024-01-23 05:47:30 -06:00
parent 37171ea9a9
commit 44d24a1671
2 changed files with 31 additions and 1 deletions

View file

@ -408,7 +408,7 @@ Let's make xref use ripgrep instead of grep for speed.
** Fix NixOS ** Fix NixOS
I am currently using NixOS. In order for emacs to have access to certain programs, we need to set some environment variables I am currently using NixOS. In order for emacs to have access to certain programs, we need to set some environment variables
#+begin_src emacs-lisp :tangle yes #+begin_src emacs-lisp
(add-to-list 'exec-path "/home/chris/.nix-profile/bin") (add-to-list 'exec-path "/home/chris/.nix-profile/bin")
;; (add-to-list 'exec-path "/etc/profiles/per-user/chris/bin") ;; (add-to-list 'exec-path "/etc/profiles/per-user/chris/bin")
;; (add-to-list 'exec-path "/run/current-system/sw/bin") ;; (add-to-list 'exec-path "/run/current-system/sw/bin")

30
init.el
View file

@ -199,6 +199,36 @@
(setq xref-search-program 'ripgrep) (setq xref-search-program 'ripgrep)
(add-to-list 'exec-path "/home/chris/.nix-profile/bin")
;; (add-to-list 'exec-path "/etc/profiles/per-user/chris/bin")
;; (add-to-list 'exec-path "/run/current-system/sw/bin")
(add-to-list 'exec-path "/run/current-system/profile/bin")
(add-to-list 'exec-path "/usr/bin")
;; (add-to-list 'exec-path "/opt/android-sdk/cmdline-tools/latest/bin")
;; (add-to-list 'exec-path "/home/chris/bin")
;; (setq exec-directory "/usr/bin")
(setenv "NIX_CONF_DIR" "/etc/nix")
(setenv "NIX_OTHER_STORES" "/run/nix/remote-stores/*/nix")
(setenv "NIX_PATH" "nixpkgs=%h/nixpkgs:nixos=%h/nixpkgs/nixos:nixos-config=/etc/nixos/configuration.nix")
(setenv "NIX_PROFILES" "${pkgs.lib.concatStringsSep " " config.environment.profiles}")
(setenv "NIX_REMOTE" "daemon")
(setenv "NIX_USER_PROFILE_DIR" "/nix/var/nix/profiles/per-user/%u")
(setenv "XCURSOR_THEME" "phinger-cursors-light")
;; (load "site-paths" t)
(setenv "CC" "/run/current-system/sw/bin/gcc")
(setenv "CXX" "/run/current-system/sw/bin/g++")
(setenv "QT_AUTO_SCREEN_SCALE_FACTOR" "1")
(setenv "QT_SCALE_FACTOR" "1")
(defun chris/nix-reload ()
(interactive)
(let* ((query (shell-command-to-string "nix-store --query $(which emacs)"))
(store-path (expand-file-name "share/emacs" (string-trim query))))
(load-file (expand-file-name "site-lisp/subdirs.el" store-path))
(when (boundp 'native-comp-eln-load-path)
(add-to-list 'native-comp-eln-load-path (expand-file-name "native-lisp/" store-path)))))
(setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") (setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland")
"wayland-1" "wayland-1"
"wayland-0")) "wayland-0"))