Initial switch to guix-home

* README.org: Update README to include information about setup changes now that guix home is
in use. Also clarify that guix-home is only managing bash configuration currently, and more
work is required to completely switch over.
* home-configuration.scm: Initial home configuration, managing bash config, as well as a
sherpherd redshift service.
* home-manifest.scm: Home manifest was updated so there is a %home-manifest variable that can
be used from home-configuration.scm
* user-config/emacs/.emacs.d/config.org: Adjust ~/.guix-profile paths to ~/.guix-home
* user-config/gpg/.gnupg/gpg-agent.conf: Ditto
* user-config/rofi/.config/rofi/config.rasi: Ditto
* user-config/sway/.config/sway/config: Ditto
* user-config/xorg/.bin/startx.sh: Ditto
* user-config/xorg/.xinitrc: Ditto
* user-config/zsh/.zshenv: Ditto
* user-config/zsh/.zshrc: Ditto
* user-config/zsh/.zprofile: Ditto. Also, source ~/.profile as required by guix-home (this is needed until
guix-home is used to manage zsh configuration, where this will happen automatically)
This commit is contained in:
Collin J. Doering 2022-03-26 08:55:08 -04:00
parent af2a4fdd1c
commit abce97d80a
Signed by: rekahsoft
GPG Key ID: 7B4DEB93212B3022
12 changed files with 127 additions and 45 deletions

View File

@ -14,15 +14,22 @@ Clone this repository.
cd ~/.dotfiles
#+end_src
Dependencies are managed using [[https://guix.gnu.org][guix]] and can be installed with the following.
Home configuration, including startup services (via userland shepherd), configuration files
and installed packages are all managed using [[https://guix.gnu.org][guix]]/[[https://guix.gnu.org/en/manual/devel/en/html_node/Home-Configuration.html][guix-home]] and can be installed with the
following.
#+begin_src shell
guix pull -C ~/.dotfiles/channels.scm
guix package -m ~/.dotfiles/home-manifest.scm
guix home reconfigure ~/.dotfiles/home-configuration.scm
#+end_src
** TODO Legacy Configuration
Configurations for a variety of programs are available to be 'installed' by symbolically
linking them into ~$HOME~ using stow. This process is simplified by the provided ~Makefile~.
linking them into ~$HOME~ using stow. This process is simplified by the provided ~Makefile~,
however is expected to be deprecated by the switch to Guix home, which is not yet fully
completed. Currently guix home only manages bash configuration, and all other configuration
is still managed using the 'legacy' stow method described here.
#+begin_src shell
# See what will be installed/linked by stow
@ -32,7 +39,9 @@ linking them into ~$HOME~ using stow. This process is simplified by the provided
make
#+end_src
* Makefile Usage
* TODO Makefile Usage
~Makefile~ is expected to be become unnecessary after this configuration is managed by Guix home instead of using stow.
#+begin_verse
make [packages] [DRY=true] [RESTOW=true] [DELETE=true]
@ -63,7 +72,6 @@ Notes:
# Uninstall/unlink configuration for a subset of packages
make DELETE=true bash
#+end_src
* Development
@ -87,7 +95,7 @@ These updates require additional manual effort, otherwise completions don't show
#+begin_src shell
# Set fpath in ~/.zprofile (this is already done in the zsh configuration)
#fpath=(~/.guix-profile/share/zsh/site-functions $fpath)
#fpath=(~/.guix-home/profile/share/zsh/site-functions $fpath)
rm -r ~/.zcompdump && compinit
#+end_src

76
home-configuration.scm Normal file
View File

@ -0,0 +1,76 @@
;; This "home-environment" file can be passed to 'guix home reconfigure'
;; to reproduce the content of your profile. This is "symbolic": it only
;; specifies package names. To reproduce the exact same profile, you also
;; need to capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
(use-modules
(gnu home)
(gnu packages)
(gnu services)
(guix profiles)
(guix transformations)
(guix gexp)
(gnu home services shells)
(gnu home services desktop))
(include "home-manifest.scm")
(home-environment
(packages
(map manifest-entry-item (manifest-entries %home-manifest)))
(services
(list
(service home-bash-service-type
(home-bash-configuration
(aliases
(let ((aws-alias "aws-vault exec --no-session ${AWS_PROFILE:-default} -- aws")
(aws-shell-alias "aws-vault exec --no-session ${AWS_PROFILE:-default} -- aws-shell"))
`(("ls" . "ls --color=auto")
("ll" . "ls -l")
("la" . "ls -a")
("lla" . "ls -al")
("grep" . "grep --color=auto")
("fgrep" . "fgrep --color=auto")
("egrep" . "egrep --color=auto")
("f" . "find")
("b" . "bat")
("x" . "exa")
("xs" . "exa")
("xl" . "exa -l")
("xla" . "exa -la")
("xx" . "x -alT --git")
("av" . "aws-vault")
("avl" . "aws-vault login ${AWS_PROFILE:-default}")
("ave" . "aws-vault exec ${AWS_PROFILE:-default} --")
("aven" . "aws-vault exec --no-session ${AWS_PROFILE:-default} --")
("aws" . ,aws-alias)
("aws-shell" . ,aws-shell-alias)
("unaws" . "unset AWS_{PROFILE,SECRET_ACCESS_KEY,ACCESS_KEY_ID,SDK_LOAD_CONFIG}")
("alias-aws" . ,(string-append "alias aws=\"" aws-alias
"\"; alias aws-shell=\"" aws-shell-alias "\""))
("unalias-aws" . "unalias aws; unalias aws-shell")
("ff" . "firefox")
("ffp" . "firefox --private-window")
("e" . "emacsclient -t")
("kssh" . "kitty +kitten ssh")
("s" . "sudo")
("si" . "sudo -i"))))
(environment-variables '(("PS1" . "[\\u@\\h \\W]\\$ ")))))
(service home-redshift-service-type
(home-redshift-configuration
(location-provider 'geoclue2)))
;; (service home-zsh-configuration
;; (zshenv (list ...))
;; (zprofile (list ...))
;; (zshrc (list ...)))
)))

View File

@ -339,13 +339,17 @@
"terraform-provider-aws"
"terraform-wrapper")))
(concatenate-manifests
(list
%emacs-manifest
%shell-manifest
%xorg-manifest
%wayland-manifest
%xorg-apps-manifest
%xorg-wayland-apps-manifest
%guile-manifest
%misc-manifest))
(define %home-manifest
(concatenate-manifests
(list
%emacs-manifest
%shell-manifest
%xorg-manifest
%wayland-manifest
%xorg-apps-manifest
%xorg-wayland-apps-manifest
%guile-manifest
%misc-manifest)))
;; Return home-manifest so this file can be used by guix commands that accept manifest files
%home-manifest

View File

@ -1,6 +1,6 @@
#+TITLE: Emacs Configuration
#+AUTHOR: [[https://www.blog.rekahsoft.ca/contact.html][Collin J. Doering]]
#+SETUPFILE: ~/.guix-profile/var/org-themes/org-html-themes/theme-readtheorg-local.setup
#+SETUPFILE: ~/.guix-home/profile/var/org-themes/org-html-themes/theme-readtheorg-local.setup
#+HTML_HEAD: <style> #content{max-width: 100%;} .tag{background-color: #0000;} pre.src:hover::before{position: relative; float: right;}</style>
#+PROPERTY: header-args:emacs-lisp :tangle yes :tangle-mode (identity #o444)
@ -77,7 +77,7 @@ instead of at ~org-babel~ tangle time (which occurs during emacs startup).
#+begin_src emacs-lisp
(defvar is-guix-system-p (or (file-exists-p "/run/current-system/provenance")
(string-prefix-p (expand-file-name "~/.guix-profile")
(string-prefix-p (expand-file-name "~/.guix-home/profile")
(locate-file "emacs" exec-path)))
"Variable that is t if on a guix system, nil otherwise.")
@ -1559,7 +1559,7 @@ Setup fancy auto-complete
:defer t
:config (progn
(if is-guix-system-p
(yas-load-directory "~/.guix-profile/share/emacs/site-lisp/yasnippet-snippets-1.0/snippets")
(yas-load-directory "~/.guix-home/profile/share/emacs/site-lisp/yasnippet-snippets-1.0/snippets")
(yas-load-directory "~/.emacs.d/elpa/yasnippet-snippets-20200802.1658"))
(yas-load-directory (no-littering-expand-etc-file-name "snippets"))
(setq-default
@ -2844,9 +2844,9 @@ beneficial as in these languages ligatures are out of place.
Upon emacs startup, the following error message appears while loading ~realgud~.
#+begin_src text
Loading /home/collin/.guix-profile/share/emacs/site-lisp/realgud/common/custom...
Loading /home/collin/.guix-profile/share/emacs/site-lisp/realgud/common/custom...done
Loading /home/collin/.guix-profile/share/emacs/site-lisp/realgud/lang/java...
Loading /home/collin/.guix-home/profile/share/emacs/site-lisp/realgud/common/custom...
Loading /home/collin/.guix-home/profile/share/emacs/site-lisp/realgud/common/custom...done
Loading /home/collin/.guix-home/profile/share/emacs/site-lisp/realgud/lang/java...
Error (use-package): realgud/:catch: Symbols value as variable is void: Info-mode-map
#+end_src

View File

@ -20,4 +20,4 @@ max-cache-ttl-ssh 10800
# PIN entry program
#pinentry-program /usr/bin/pinentry-curses
#pinentry-program /usr/bin/pinentry-qt4
pinentry-program /home/collin/.guix-profile/bin/pinentry-gtk-2
pinentry-program /home/collin/.guix-home/profile/bin/pinentry-gtk-2

View File

@ -145,4 +145,4 @@ configuration {
}
}
@theme "/home/collin/.guix-profile/share/rofi/themes/Arc-Dark.rasi"
@theme "/home/collin/.guix-home/profile/share/rofi/themes/Arc-Dark.rasi"

View File

@ -25,7 +25,7 @@ set $menu wofi --show run,drun
### Output configuration
# You can get the names of your outputs by running: swaymsg -t get_outputs
output * res 1920x1080 bg /home/collin/.guix-profile/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
output * res 1920x1080 bg /home/collin/.guix-home/profile/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# Set inner window gaps
gaps inner 4

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
GUIX_PROFILE=~/.guix-profile
GUIX_PROFILE=~/.guix-home/profile
if [ ! -z "$GUIX_ENVIRONMENT" ]; then
# When in a guix environment, extend particular environment variables

View File

@ -5,7 +5,7 @@
# session-type is "full", "min", or "new"; if any other string is given, defaults to "full"
# TODO: this is only useful on non-guix systems, however a similar
# thing could be done for ~/.guix-profile/etc/X11/xinit/xinitrc.d,
# thing could be done for ~/.guix-home/profile/etc/X11/xinit/xinitrc.d,
# however on guix this path is empty (not provided by xinit package)
#
# # Runs system-wide xinitrc scripts
@ -25,15 +25,6 @@ init_full_session() {
# Set random wallpaper
# [ -d ~/.wallback ] && feh --randomize --bg-scale ~/.wallback/*
# TODO: guix
# # Start geoclue for use by redshift
# #/usr/lib/geoclue-2.0/demos/agent &
# TODO: guix
# # Star redshift
# redshift -l geoclue2 &
# #redshift -l 43.4503:-80.4832 &
# TODO: guix
# # Unclutter the desktop and remove mouse pointer when inactive
# unclutter &

View File

@ -1,8 +1,11 @@
# Honor system-wide environment variables
source /etc/profile
# Honor user ~/.profile (required for guix-home)
if [ -f ~/.profile ]; then source ~/.profile; fi
# Setup guix profile locales
export GUIX_LOCPATH=${HOME}/.guix-profile/lib/locale
export GUIX_LOCPATH=${HOME}/.guix-home/profile/lib/locale
# Add local binaries to PATH
export PATH="${PATH}:$HOME/.bin"

View File

@ -5,8 +5,8 @@ export EDITOR="emacsclient -t" # $EDITOR should open in terminal
export VISUAL="emacsclient -a emacs" # $VISUAL opens in GUI with non-daemon as alternate
# TODO: this was added for guix-wsl but likely is not needed any longer
export GUILE_LOAD_PATH="${GUILE_LOAD_PATH}:$HOME/.guix-profile/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH}:$HOME/.guix-profile/lib/guile/3.0/site-ccache"
export GUILE_LOAD_PATH="${GUILE_LOAD_PATH}:$HOME/.guix-home/profile/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH}:$HOME/.guix-home/profile/lib/guile/3.0/site-ccache"
# Use gpg-agent ssh-agent emulation
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"

View File

@ -5,16 +5,16 @@
# # Add ~/.zsh_resources/completions to $fpath (needs to come before 'compinit')
# fpath=( ~/.zsh_resources/completions "${fpath[@]}" )
source ~/.guix-profile/bin/z.sh
source ~/.guix-home/profile/bin/z.sh
precmd () {
z --add "$(pwd -P)"
}
# Use zsh-autosuggestions (requires pacman package)
source ~/.guix-profile/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.guix-home/profile/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# TODO: temporary
fpath=( ~/.guix-profile/share/zsh/site-functions "${fpath[@]}" )
fpath=( ~/.guix-home/profile/share/zsh/site-functions "${fpath[@]}" )
# The following lines were added by compinstall
zstyle ':completion:*' completer _list _expand _complete _ignored _match _correct _approximate _prefix
@ -99,8 +99,8 @@ setopt COMPLETE_ALIASES # Complete command line switches for aliases
bindkey -e
# Lines to add fzf fuzzy completion widgets supplied by fzf package
source ~/.guix-profile/share/fzf/key-bindings.zsh
source ~/.guix-profile/share/fzf/completion.zsh
source ~/.guix-home/profile/share/fzf/key-bindings.zsh
source ~/.guix-home/profile/share/fzf/completion.zsh
# Rebind C-t for fzf-file-widget to ESC-t
bindkey -r '^T'
@ -224,7 +224,7 @@ eval "$(direnv hook zsh)"
# echo "UPDATESTARTUPTTY" | gpg-connect-agent > /dev/null 2>&1
# Use zsh-source-highlight
source ~/.guix-profile/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.guix-home/profile/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# TODO: not packaged on guix
# # Initialize nvm for managing node environments