dotfiles/.guix/rekahsoft/guix-config/home.scm

547 lines
18 KiB
Scheme

(define-module (rekahsoft guix-config home)
#:use-module (gnu home)
#:use-module (gnu packages)
#:use-module (gnu services)
#:use-module (guix profiles)
#:use-module (guix channels)
#:use-module (guix transformations)
#:use-module (guix gexp)
#:use-module (gnu packages tls)
#:use-module (gnu packages perl)
#:use-module (gnu packages gnupg)
#:use-module (guix packages)
#:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu home services)
#:use-module (gnu home services shells)
#:use-module (gnu home services desktop)
#:use-module (gnu home services guix)
#:use-module (gnu home services gnupg)
#:use-module (gnu home services ssh)
#:use-module (nongnu packages mozilla)
#:use-module (rekahsoft-gnu packages haskell-apps)
#:use-module (rekahsoft-gnu packages emacs-xyz)
#:use-module (rekahsoft-gnu packages python-xyz)
#:use-module (rekahsoft-gnu packages shellutils)
#:use-module (rekahsoft-gnu packages terraform)
#:export (%home %home-manifest))
(define-public caddy-local-ca-cert
(package
(name "caddy-local-ca-cert")
(version "1")
(source #f)
(build-system trivial-build-system)
(arguments
'(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let ((ca-cert (assoc-ref %build-inputs "caddy-dev-ca.pem"))
(out (string-append (assoc-ref %outputs "out") "/etc/ssl/certs"))
(openssl (assoc-ref %build-inputs "openssl"))
(perl (assoc-ref %build-inputs "perl")))
(mkdir-p out)
(for-each
(lambda (cert)
(copy-file cert (string-append out "/"
(strip-store-file-name cert))))
(list ca-cert))
;; Create hash symlinks suitable for OpenSSL ('SSL_CERT_DIR' and
;; similar.)
(chdir (string-append %output "/etc/ssl/certs"))
(invoke (string-append perl "/bin/perl")
(string-append openssl "/bin/c_rehash")
".")))))
(native-inputs
(list openssl perl)) ;for 'c_rehash'
(inputs
`(; The CA certificate used by caddy for local development
("caddy-dev-ca.pem"
,(local-file "../../../.ca-certificates/caddy-local-dev.pem"))))
(home-page "https://caddyserver.com")
(synopsis "Local CA used for caddy development server")
(description "This package provides a certificate store containing a
single certifcate used for local development with caddy.")
(license license:public-domain)))
(define transform--emacs-helm-mu
(options->transformation
'((with-commit . "emacs-helm-mu=2422f57ed40d998ac6f085f93b24223c91cefaf7"))))
(define-public %emacs-manifest
(concatenate-manifests
(list
(packages->manifest
(list
;; Temporary: emacs-helm-mu is broken but has been fixed upstream
(transform--emacs-helm-mu
(specification->package "emacs-helm-mu"))
;; Packages from the rekahsoft-guix channel
emacs-ace-mc
emacs-hamlet-mode
emacs-helm-rg
emacs-helm-tramp
emacs-helm-unicode
emacs-highlight-indent-guides
emacs-highlight-parentheses
emacs-ibuffer-vc
emacs-intel-hex-mode
emacs-ix
emacs-lsp-haskell
emacs-mu4e-dashboard
emacs-org-html-theme-darksun
emacs-org-html-themes
emacs-org-projectile
emacs-org-projectile-helm
emacs-org-roam-ui
emacs-persp-projectile
emacs-quack
emacs-rcirc-notify
emacs-rebox2
emacs-vimish-fold
;; Use more up-to-date ace-link
emacs-ace-link-2021-01-1))
(specifications->manifest
'("aspell"
"aspell-dict-en"
"emacs"
"emacs-ace-jump-mode"
"emacs-ace-window"
"emacs-ag"
"emacs-all-the-icons"
"emacs-all-the-icons-ibuffer"
"emacs-auctex"
"emacs-auto-complete"
"emacs-auto-yasnippet"
"emacs-dashboard"
"emacs-dhall-mode"
"emacs-dired-hacks"
"emacs-docker"
"emacs-dockerfile-mode"
"emacs-org-caldav"
"emacs-doom-modeline"
"emacs-doom-themes"
"emacs-elfeed"
"emacs-elfeed-org"
"emacs-elpher"
"emacs-emmet-mode"
"emacs-emms"
"emacs-envrc"
"emacs-expand-region"
"emacs-exwm"
"emacs-fill-column-indicator"
"emacs-flycheck"
"emacs-flycheck-ledger"
"emacs-forge"
"emacs-geiser"
"emacs-gnuplot"
"emacs-go-mode"
"emacs-god-mode"
"emacs-graphql-mode"
"emacs-graphviz-dot-mode"
"emacs-guix"
"emacs-haskell-mode"
"emacs-helm"
"emacs-helm-ag"
"emacs-helm-c-yasnippet"
"emacs-helm-descbinds"
"emacs-helm-exwm"
"emacs-helm-gtags"
"emacs-helm-lsp"
"emacs-helm-ls-git"
"emacs-helm-org"
"emacs-helm-pass"
"emacs-helm-projectile"
"emacs-helm-swoop"
"emacs-highlight-sexp"
"emacs-htmlize"
"emacs-hydra"
"emacs-ibuffer-projectile"
"emacs-isearch+"
"emacs-ivy"
"emacs-json-mode"
"emacs-jsonnet-mode"
"emacs-ledger-mode"
"emacs-lsp-mode"
"emacs-lsp-treemacs"
"emacs-lsp-ui"
"emacs-lua-mode"
"emacs-magit"
"emacs-markdown-mode"
"emacs-mmm-mode"
"emacs-mu4e-alert"
"emacs-multi-term"
"emacs-multiple-cursors"
"emacs-nix-mode"
"emacs-no-littering"
"emacs-nov-el"
"emacs-org"
"emacs-org-contrib"
"emacs-org-download"
"emacs-org-mime"
"emacs-org-mind-map"
"emacs-org-noter"
"emacs-org-roam"
"emacs-org-ql"
"emacs-org-super-agenda"
"emacs-org-web-tools"
"emacs-orgit"
"emacs-paredit"
"emacs-pdf-tools"
"emacs-persp-mode"
"emacs-php-mode"
"emacs-plantuml-mode"
"emacs-projectile"
"emacs-racket-mode"
"emacs-rainbow-delimiters"
"emacs-rainbow-identifiers"
"emacs-rainbow-mode"
"emacs-realgud"
"emacs-rec-mode"
"emacs-restclient"
"emacs-ripgrep"
"emacs-rust-mode"
"emacs-scribble-mode"
"emacs-slime"
"emacs-string-inflection"
"emacs-swiper"
"emacs-terraform-mode"
"emacs-tramp"
"emacs-treemacs"
"emacs-treemacs-extra"
"emacs-undo-tree"
"emacs-which-key"
"emacs-vterm"
"emacs-yaml-mode"
"emacs-yasnippet"
"emacs-yasnippet-snippets"
"imagemagick" ; used for thumbnail generation in image-dired
"python-pygments" ; needed for org-mode latex/pdf export of src blocks
"gnuplot"
"isync"
"mu"
"plantuml"
; "emacs-ac-geiser" ;; TODO: hash mismatch; possible non-determinism
;"emacs-helm-mu" ;; TODO: broken, but fixed upstream
)))))
(define-public %shell-manifest
(concatenate-manifests
(list
(packages->manifest
(list
;; TODO: this was added upstream (as "go-github-com-junegunn-fzf") but is not as complete as my existing package
fzf
;; Remaining packages from the rekahsoft-guix channel
spaceship-prompt))
(specifications->manifest
'("bat"
"eza"
"fd"
"ripgrep"
"sh-z"
"zsh-autosuggestions"
"zsh-syntax-highlighting")))))
(define-public %xorg-manifest
(specifications->manifest
'("mesa"
"obs"
"setxkbmap"
"xdg-utils"
"xf86-input-libinput"
"xf86-video-fbdev"
"xinit"
"xinput"
"xkbcomp"
"xkeyboard-config"
"xlsfonts"
"xorg-server"
"xrandr"
"autorandr"
"xrdb"
"xsetroot")))
(define-public %wayland-manifest
(specifications->manifest
'("grim"
"hicolor-icon-theme" ;; Required for wofi icon theme
"slurp"
"sway"
"wayland"
"wofi")))
;; Manifest containing x programs (that cannot natively run with wayland).
(define-public %xorg-apps-manifest
(concatenate-manifests
(list
(packages->manifest
(list
;; Packages from nonguix channel
firefox))
(specifications->manifest
'("dunst" ;; <- May not need this; use something in emacs
"feh"
"pavucontrol"
"redshift"
"rofi" ;; <- Look into replacing in emacs
"rofi-pass" ;; <- This should be replacable in emacs with helm-pass
"i3lock-fancy"
"xmonad"
"xmobar"
"scrot"
"trayer-srg" ;; used in xmonad as system tray
"dmenu"
"unclutter"
"virt-manager"
"virt-viewer"
"xss-lock"
"xclip"
"zathura"
"zathura-djvu"
"zathura-pdf-poppler"
"zathura-ps")))))
;; Manifest containing Xorg and Wayland native compatible programs
(define-public %xorg-wayland-apps-manifest
(specifications->manifest
'("kitty" ;; <- May not need this and instead will use emacs-vterm
"alacritty" ;; <- ditto
"libnotify" ;; for notify-send
"network-manager-applet"
"numix-gtk-theme"
"adwaita-icon-theme")))
(define-public %guile-manifest
(specifications->manifest
'("guile"
"guile-charting" ;; guile-charting is required for 'guix size --map-file'
"guile-colorized"
"guile-hall"
"guile-readline")))
(define-public %misc-manifest
(concatenate-manifests
(list
(packages->manifest
(list
;; ca-certificate for local caddy development server
caddy-local-ca-cert
;; Packages from rekahsoft-guix
ledger-autosync
hledger-ui
terraform-provider-aws
terraform-wrapper-0.13))
(specifications->manifest
'("ansible"
"alsa-utils" ;; for alsamixer
"aws-vault"
"beets"
"bmon"
"bind:utils" ;; for dig
"cmatrix"
"coreutils"
"curl"
"direnv"
"flatpak"
"gettext"
"xdg-desktop-portal" ;; improves user experience of flatpak
"xdg-desktop-portal-gtk"
"font-dejavu"
"font-liberation"
"font-fira-code" ;; TODO: check if font is needed
"font-gnu-freefont"
"font-terminus"
"font-google-noto"
"font-google-noto-emoji"
"git"
"git:send-email"
"git:subtree"
"git-lfs"
"glibc-locales"
"gawk"
"graphviz"
"font-ghostscript"
"gwl"
"zbar"
"hledger"
"hledger-web"
"htop"
"jq"
"ledger"
"mpv"
"nmap"
"nss-certs"
"nyxt"
"openssh"
"pass-otp"
"password-store"
"recutils"
"rhash"
"skopeo"
"texlive"
"tmux"
"ungoogled-chromium"
"util-linux"
"wget"
"youtube-dl"
"kicad"
"kicad-templates"
"kicad-symbols"
"kicad-packages3d"
"kicad-footprints"
"kicad-doc"
"gtkwave"
"pulseview" ;; gui for sigrok
"sigrok-cli"
"gnuradio"
;; TODO: (packages I like but maybe should be project specific?)
;; "avr-toolchain" (propigated inputs: "avrdude" "avr-binutils" "avr-gcc")
;; "clojure"
;; "lua"
;; "chez"
;; "coq"
;; TODO: (these probably should go in the system configuration)
;; "bitlebee"
)))))
(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)))
(define %home
(home-environment
(packages
(map (lambda (m)
(list (manifest-entry-item m)
(manifest-entry-output m)))
(manifest-entries %home-manifest)))
(services
(list
(service home-bash-service-type
(home-bash-configuration
(environment-variables '(("PS1" . "[\\u@\\h \\W]\\$ ")))))
(service home-zsh-service-type
(home-zsh-configuration
(zshenv (list (local-file "../../../user-config/zsh/.zshenv" "zshenv")))
(zprofile (list (local-file "../../../user-config/zsh/.zprofile" "zprofile")))
(zshrc (list (local-file "../../../user-config/zsh/.zshrc" "zshrc")))))
(service home-openssh-service-type
(home-openssh-configuration
(hosts
(list (openssh-host (name "*.home.rekahsoft.ca rekahsoft.ca")
(forward-agent? #t))))
(authorized-keys (list))))
(service home-gpg-agent-service-type
(home-gpg-agent-configuration
(pinentry-program
(file-append pinentry-gnome3
"/bin/pinentry-gtk-2"))
(ssh-support? #t)))
(simple-service
'extra-xdg-configuration-files-service
home-xdg-configuration-files-service-type
`(("alacritty/alacritty.yml" ,(local-file "../../../user-config/alacritty/.config/alacritty/alacritty.yml"))
("autorandr" ,(local-file "../../../user-config/xorg/.config/autorandr" #:recursive? #t))
("git/attributes" ,(local-file "../../../user-config/git/.config/git/attributes"))
("git/config" ,(local-file "../../../user-config/git/.gitconfig" "gitconfig"))
("kitty/kitty.conf" ,(local-file "../../../user-config/kitty/.config/kitty/kitty.conf"))
("kitty/session.conf" ,(local-file "../../../user-config/kitty/.config/kitty/session.conf"))
("ledger/ledgerrc" ,(local-file "../../../user-config/ledger/.ledgerrc" "ledgerrc"))
("nyxt/init.lisp" ,(local-file "../../../user-config/nyxt/.config/nyxt/init.lisp"))
("rofi-pass/config" ,(local-file "../../../user-config/rofi-pass/.config/rofi-pass/config"))
("rofi/config.rasi" ,(local-file "../../../user-config/rofi/.config/rofi/config.rasi"))
("sway/config" ,(local-file "../../../user-config/sway/.config/sway/config"))
("spaceship.zsh" ,(local-file "../../../user-config/zsh/.config/spaceship.zsh"))
("tmux/tmux.conf" ,(local-file "../../../user-config/tmux/.tmux.conf" "tmux.conf"))
("wofi/style.css" ,(local-file "../../../user-config/wofi/.config/wofi/style.css"))
("zathura/zathurarc" ,(local-file "../../../user-config/zathura/.config/zathura/zathurarc"))))
(simple-service
'extra-xdg-data-files-service
home-xdg-data-files-service-type
`(("applications/org-protocol-override.desktop" ,(local-file "../../../user-config/emacs/.local/share/applications/org-protocol-override.desktop"))))
(simple-service
'extra-home-files-service
home-files-service-type
`((".mbsyncrc" ,(local-file "../../../user-config/mbsync/.mbsyncrc" "mbsyncrc"))
(".racketrc" ,(local-file "../../../user-config/racket/.racketrc" "racketrc"))
(".guile" ,(local-file "../../../user-config/guile/.guile" "guilerc"))
(".ghci" ,(local-file "../../../user-config/haskell/.ghci" "ghci"))
(".bin/emacs-mail.sh" ,(local-file "../../../user-config/emacs/.bin/emacs-mail.sh" "emacs-mail.sh" #:recursive? #t))
(".bin/org-protocol-open.sh" ,(local-file "../../../user-config/emacs/.bin/org-protocol-open.sh" "org-protocol-open.sh" #:recursive? #t))
(".emacs.d/init.el" ,(local-file "../../../user-config/emacs/.emacs.d/init.el"))
(".emacs.d/config.org" ,(local-file "../../../user-config/emacs/.emacs.d/config.org"))
(".emacs.d/etc" ,(local-file "../../../user-config/emacs/.emacs.d/etc" "emacs-etc-config" #:recursive? #t))
(".bin/start-sway.sh" ,(local-file "../../../user-config/sway/.bin/start-sway.sh" "start-sway.sh" #:recursive? #t))
(".xmobarrc" ,(local-file "../../../user-config/xmonad/.xmobarrc" "xmobarrc"))
(".xmonad/xmonad.hs" ,(local-file "../../../user-config/xmonad/.xmonad/xmonad.hs" "xmonad.hs"))
(".bin/vol.sh" ,(local-file "../../../user-config/xmonad/.bin/vol.sh" #:recursive? #t))
(".bin/xmonadClose.sh" ,(local-file "../../../user-config/xmonad/.bin/xmonadClose.sh" #:recursive? #t))
(".xinitrc" ,(local-file "../../../user-config/xorg/.xinitrc" "xinitrc" #:recursive? #t))
(".bin/startx.sh" ,(local-file "../../../user-config/xorg/.bin/startx.sh" "startx.sh" #:recursive? #t))
(".bin/keyboard.sh" ,(local-file "../../../user-config/xorg/.bin/keyboard.sh" "keyboard.sh" #:recursive? #t))
(".Xresources" ,(local-file "../../../user-config/xorg/.Xresources" "xresources"))))
(simple-service
'custom-guix-channels-service
home-channels-service-type
(list
(channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(branch "master")
(introduction
(make-channel-introduction
"897c1a470da759236cc11798f4e0a5f7d4d59fbc"
(openpgp-fingerprint
"2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
(channel
(name 'rekahsoft-guix)
(url "https://git.rekahsoft.ca/rekahsoft/rekahsoft-guix.git")
(branch "master")
(introduction
(make-channel-introduction
"d910ac4ca1e1a115934b10921bc23f50bd481043"
(openpgp-fingerprint
"F8D5 46F3 AF37 EF53 D1B6 48BE 7B4D EB93 212B 3022"))))
(channel
(name 'rekahsoft-dotfiles)
(url "https://git.home.rekahsoft.ca/rekahsoft-public/dotfiles.git")
(branch "master")
(introduction
(make-channel-introduction
"32b8ebec9a503b9796fda0a8ac3eb11eec744397"
(openpgp-fingerprint
"F8D5 46F3 AF37 EF53 D1B6 48BE 7B4D EB93 212B 3022"))))))
(service home-redshift-service-type
(home-redshift-configuration
(location-provider 'geoclue2)))))))