I use guix home
to configure my home environment on Guix
system and I am using home-zsh-service-type
to configure my shell of choice.
Here is my home-zsh-service-type
configuration,
(service home-zsh-service-type
(home-zsh-configuration
(xdg-flavor? #t)
(environment-variables
`(("HISTFILE" . "$XDG_STATE_HOME/zsh/history")
("HISTSIZE" . "10000")
("SAVEHIST" . "10000")))
(zshenv
(list
(local-file "files/shell/zsh/zshenv")))
(zprofile
(list
(local-file "files/shell/zsh/zprofile")))
(zshrc
(list
;; (local-file "files/shell/zsh/config")
(local-file "files/shell/zsh/completions")
(mixed-text-file "zshrc"
#~(string-append
"# direnv hook zsh\n"
"_direnv_hook() {\n"
" trap -- '' SIGINT;\n"
" eval \"$(\"" #$(file-append (specification->package "direnv")
"/bin/direnv")"\" export zsh)\";\n"
" trap - SIGINT;\n"
"}\n"))
(local-file "files/shell/zsh/direnv")
(local-file "files/shell/zsh/fzf")
(local-file "files/shell/zsh/keybinds")
(local-file "files/shell/zsh/prompt")
(local-file "files/shell/zsh/source")
(local-file "files/shell/zsh/startup")
(local-file "files/shell/functions")
(mixed-text-file
"zshrc"
#~(string-append
"source "
#$(file-append (specification->package "zsh-syntax-highlighting")
"/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" "\n")))
(mixed-text-file
"zshrc"
#~(string-append
"source "
#$(file-append (specification->package "zsh-history-substring-search")
"/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh" "\n")))
(mixed-text-file
"zshrc"
#~(string-append
"fpath+=\"${0:A:h}"
#$(file-append (specification->package "zsh-completions")
"share/zsh/site-functions/\"" "\n")))
(mixed-text-file
"zshrc"
#~(string-append
"source "
#$(file-append (specification->package "zsh-autosuggestions")
"/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" "\n")))
(mixed-text-file
"zshrc"
#~(string-append
"source "
#$(file-append (specification->package "zsh-autopair")
"/share/zsh/plugins/zsh-autopair/zsh-autopair.zsh")))))))
Here I use a local-file
for zshenv
and zprofile
,
(zshenv
(list
(local-file "files/shell/zsh/zshenv")))
(zprofile
(list
(local-file "files/shell/zsh/zprofile")))
Here are the contents of zshenv
file,
# Guix
# GUIX_PROFILE="/home/apoorv/.config/guix/current" . "$GUIX_PROFILE/etc/profile"
# Load the nix profile
if [ -f "/run/current-system/profile/etc/profile.d/nix.sh" ]; then
source /run/current-system/profile/etc/profile.d/nix.sh
fi
if [ -f "$HOME/.profile" ]; then
source "$HOME"/.profile
fi
xrdb -merge ~/.Xresources
As you can see I am sourcing the nix.sh
script to load the nix
profile but dmenu
doesn’t show the programs installed via nix
for some reason, though I can launch them from terminal just fine.
It was all fine when I was not managing my home
environment with guix
BTW, this only started happening after I started using guix home
to manage my home
environment.
Also in another thread I mentioned this, Guix shell not showing mentioned program inside the shell environment - #11 by apoorv569
Guix
auto-generates .zprofile
file with these contents,
as@guix-virt ~$ cat .zprofile
# Honor system-wide environment variables
source /etc/profile
# Merge search-paths from multiple profiles, the order matters.
eval "$(guix package --search-paths \
-p $HOME/.config/guix/current \
-p $HOME/.guix-profile \
-p /run/current-system/profile)"
# Prepend setuid programs.
export PATH=/run/setuid-programs:$PATH
it worked fine as well when I was not using guix home
to manage my home environment, but if I put the eval
part in zprofile
file that I am using right now, none of the programs installed via guix home
also don’t show up in dmenu
either.
Here is my current zprofile
file,
# Merge search-paths from multiple profiles, the order matters.
# eval "$(guix package --search-paths \
# -p $HOME/.config/guix/current \
# -p $HOME/.guix-profile \
# -p /run/current-system/profile)"
# Prepend setuid programs.
export PATH=/run/setuid-programs:$PATH
As you can see I have commented it out for now.
I am using my custom build of dmenu
BTW, ~apoorv569/nebula (master): nebula/packages/suckless.scm - sourcehut git