From 44d24a1671289521248b6d8d896d7a3bc8a3a0b6 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 23 Jan 2024 05:47:30 -0600 Subject: [PATCH] fixy --- README.org | 2 +- init.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index f917af4f..f27d2e92 100644 --- a/README.org +++ b/README.org @@ -408,7 +408,7 @@ Let's make xref use ripgrep instead of grep for speed. ** Fix NixOS 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 "/etc/profiles/per-user/chris/bin") ;; (add-to-list 'exec-path "/run/current-system/sw/bin") diff --git a/init.el b/init.el index 97810d15..523afcdb 100644 --- a/init.el +++ b/init.el @@ -199,6 +199,36 @@ (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") "wayland-1" "wayland-0"))