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

487 lines
14 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 transformations)
#:use-module (guix gexp)
#:use-module (gnu packages tls)
#:use-module (gnu packages perl)
#:use-module (guix packages)
#:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu home services shells)
#:use-module (gnu home services desktop)
#: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 spice)
#: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=b85019d01815a4b58d6016c3a30fefa60d8363f2"))))
(define-public %emacs-manifest
(concatenate-manifests
(list
(packages->manifest
(list
;; ca-certificate for local caddy development server
caddy-local-ca-cert
;; 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-mu4e-dashboard
emacs-mu4e-maildirs-extension
emacs-org-html-theme-darksun
emacs-org-html-themes
emacs-org-roam-ui
emacs-persp-projectile
emacs-quack
emacs-rcirc-notify
emacs-rebox2
emacs-vimish-fold
emacs-eval-in-repl
emacs-org-babel-eval-in-repl
;; 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-docker-tramp"
"emacs-doom-modeline"
"emacs-doom-themes"
"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-mu4e-conversation"
"emacs-multi-term"
"emacs-multiple-cursors"
"emacs-nix-mode"
"emacs-no-littering"
"emacs-ob-async"
"emacs-org"
"emacs-org-contrib"
"emacs-org-download"
"emacs-org-mime"
"emacs-org-mind-map"
"emacs-org-noter"
"emacs-org-ql"
"emacs-org-roam"
"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-use-package"
"emacs-which-key"
"emacs-vterm"
"emacs-yaml-mode"
"emacs-yasnippet"
"emacs-yasnippet-snippets"
"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"
"exa"
"fd"
"ripgrep"
"sh-z"
"zsh-autosuggestions"
"zsh-syntax-highlighting")))))
(define-public %xorg-manifest
(specifications->manifest
'("mesa"
"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
;; Packages from rekahsoft-guix channel
virt-viewer-11))
(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" ;; required for i3lock-fancy
"i3lock-fancy"
"xmonad"
"xmobar"
"scrot"
"trayer-srg" ;; used in xmonad as system tray
"dmenu"
"unclutter"
"virt-manager"
"xautolock"
"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
;; Packages from rekahsoft-guix
awscliv2
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"
"git"
"git:send-email"
"git:subtree"
"git-lfs"
"glibc-locales"
"gnupg"
"graphviz"
"font-ghostscript"
"gwl"
"hledger"
"hledger-web"
"htop"
"jq"
"ledger"
"mpd"
"mpv"
"ncmpcpp" ;; <- This can be replaced by emacs-emms
"nextcloud-client"
"nmap"
"nss-certs"
"nyxt"
"openssh"
"gnupg"
"pinentry-gnome3"
"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"
;; 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
(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 ...)))
))))