(use-modules ((ice-9 textual-ports) #:prefix textual-ports:) ((guix licenses) #:prefix licenses:) ((xyz euandreh heredoc) #:prefix heredoc:) (gnu home) (gnu home services) (gnu home services mcron) (gnu home services shells) (gnu home services shepherd) (gnu home services xdg) (gnu packages) (gnu packages base) (gnu packages curl) (gnu packages dunst) (gnu packages freedesktop) (gnu packages gawk) (gnu packages gnupg) (gnu packages gpodder) (gnu packages guile) (gnu packages hunspell) (gnu packages libreoffice) (gnu packages linux) (gnu packages mail) (gnu packages music) (gnu packages wget) (gnu packages lisp) (gnu packages texinfo) (gnu packages tmux) (gnu packages tls) (gnu packages version-control) (gnu packages video) (gnu packages xdisorg) (gnu services) (guix build-system gnu) (guix build-system trivial) (guix download) (guix gexp) (guix git-download) (guix modules) (guix packages) (guix utils)) (heredoc:enable-syntax) ;; Sent upstream as: ;; https://issues.guix.gnu.org/58931 (define-public clipmenu-latest (let ((commit "7c34ace1fbab76eb1c1dc9b30dd4ac1a7fe4b90b") (revision "1")) (package (name "clipmenu-latest") (version (string-append "6.2.0-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/cdown/clipmenu") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1403sw49ccb8xsd8v611fzp0csaglfz8nmz3wcjsk8x11h9jvxwy")))) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (delete 'configure) (delete 'build) (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) (doc (string-append %output "/share/doc/" ,name "-" ,version))) (install-file "clipdel" bin) (install-file "clipmenu" bin) (install-file "clipmenud" bin) (install-file "clipfsck" bin) (install-file "clipctl" bin) (install-file "README.md" doc)))) (add-after 'install 'wrap-script (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (clipnotify (assoc-ref inputs "clipnotify")) (coreutils-minimal (assoc-ref inputs "coreutils-minimal")) (gawk (assoc-ref inputs "gawk")) (util-linux (assoc-ref inputs "util-linux")) (xdotool (assoc-ref inputs "xdotool")) (xsel (assoc-ref inputs "xsel")) (guile (search-input-file inputs "bin/guile"))) (for-each (lambda (prog) (wrap-script (string-append out "/bin/" prog) #:guile guile `("PATH" ":" prefix ,(map (lambda (dir) (string-append dir "/bin")) (list clipnotify coreutils-minimal gawk util-linux xdotool xsel))))) '("clipmenu" "clipmenud" "clipdel" "clipfsck" "clipctl"))))) (replace 'check (lambda* (#:key inputs outputs #:allow-other-keys) ;; substitute a shebang appearing inside a string (the test ;; file writes this string to a temporary file): (substitute* "tests/test-clipmenu" (("#!/usr/bin/env bash") (string-append "#!" (which "bash")))) (invoke "tests/test-clipmenu")))))) (inputs (list clipnotify coreutils-minimal gawk guile-3.0 ; for wrap-script util-linux xdotool xsel)) (home-page "https://github.com/cdown/clipmenu") (synopsis "Simple clipboard manager using dmenu or rofi and xsel") (description "Start @command{clipmenud}, then run @command{clipmenu} to select something to put on the clipboard. When @command{clipmenud} detects changes to the clipboard contents, it writes them out to the cache directory. @command{clipmenu} reads the cache directory to find all available clips and launches @command{dmenu} (or @command{rofi}, depending on the value of @code{CM_LAUNCHER}) to let the user select a clip. After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.") (license licenses:public-domain)))) ;; Sent upstream as: ;; https://issues.guix.gnu.org/61823 (define-public tmux-plugin-continuum (package (name "tmux-plugin-continuum") (version "3e4bc35da41f956c873aea716c97555bf1afce5d") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/tmux-plugins/tmux-continuum/") (commit version))) (sha256 (base32 "1py8qfs2f93hkxhk039m813bjgcs5k54si662gx05g3czqy06pb7")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let ((out (string-append %output "/share/tmux-plugins/continuum/"))) (mkdir-p out) (copy-recursively (assoc-ref %build-inputs "source") out))))) (synopsis "Continous saving of tmux environment") (description "Features: @itemize @item continuous saving of tmux environment @item automatic tmux start when computer/server is turned on @item automatic restore when tmux is started @end itemize Together, these features enable uninterrupted tmux usage. No matter the computer or server restarts, if the machine is on, tmux will be there how you left it off the last time it was used.") (home-page "https://github.com/tmux-plugins/tmux-continuum/") (license licenses:expat))) (define-public hunspell-iconv (package (inherit hunspell) (name "hunspell-iconv") (inputs `(("libiconv" ,libiconv) ,@(package-inputs hunspell))))) (define-public curl-openssl (package (inherit curl) (arguments (substitute-keyword-arguments (package-arguments curl) ((#:configure-flags flags ''()) #~(list (string-append "--with-openssl=" (assoc-ref %build-inputs "openssl")))))) (inputs `(("openssl" ,openssl-3.0) ,@(package-inputs curl))))) (define (hunspell-dictionary-utf8 dict-name) (package (name (string-append "hunspell-dict-" dict-name "-utf8")) (version "630b34e6f8f3cbe7aa7b27b6d8ab118e27252fd1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/wooorm/dictionaries") (commit version))) (file-name (git-file-name "hunspell-dictionary-utf8" version)) (sha256 (base32 "1iknwzh5h04m067ddw9hlzc1qqj4mr9mdkcfapsnay304laaiyn5")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let ((source-prefix (string-append (assoc-ref %build-inputs "source") "/dictionaries/" ,dict-name "/index")) (install-prefix (string-append %output "/share/hunspell/"))) (mkdir-p install-prefix) (copy-file (string-append source-prefix ".aff") (string-append install-prefix ,dict-name ".aff")) (copy-file (string-append source-prefix ".dic") (string-append install-prefix ,dict-name ".dic")))))) (synopsis (string-append "Hunspell " dict-name " dictionary in UTF-8")) (description (string-append "Hunspell " dict-name " dictionary in UTF-8")) (license licenses:expat) (home-page "https://github.com/wooorm/dictionaries"))) (define cmucl (package (name "cmucl-binary") (version "21b") (source (origin (method url-fetch) (uri (string-append "https://common-lisp.net/project/cmucl/downloads/release/" version "/cmucl-" version "-x86-linux.tar.bz2")) (sha256 (base32 "13k3b5ygnbsq6n2i3r5i4ljw3r1qlskn2p5f4x9hrx6vfvbb3k7a")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let ((source (assoc-ref %build-inputs "source")) (bin (string-append %output "/bin"))) (mkdir-p bin) (copy-file (string-append source "/bin/lisp") (string-append bin "/lisp")))))) (home-page "https://www.cons.org/cmucl/") (synopsis "The CMU implementation of Common Lisp") (description #"- CMUCL is a free implementation of the Common Lisp programming language which runs on most major Unix platforms. It mainly conforms to the ANSI Common Lisp standard."#) (license licenses:public-domain))) (define (slurp name) (string-trim-both (call-with-input-file name textual-ports:get-string-all))) (define (script name content) (package (name name) (version "latest") (source #f) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((bin (string-append %output "/bin")) (prog (string-append bin "/" ,name))) (mkdir-p bin) (call-with-output-file prog (lambda (port) (format port "~a" ,content))) (chmod prog #o755))))) (home-page "") (synopsis "") (description "") (license #f))) (define cronjobs (list #~(job "0 0 * * *" "cronjob check") #~(job "30 4 * * *" "cronjob reconfigure -U") #~(job "30 1 * * *" "cronjob backup -q cron"))) (define (home-service name package bin) (service-type (name name) (extensions (list (service-extension home-shepherd-service-type (lambda _ (list (shepherd-service (provision (list name)) (documentation (format #f "Shepherd service that manages ~a." name)) (start #~(make-forkexec-constructor (list #$(file-append package bin)))) (stop #~(make-kill-destructor)))))) (service-extension home-profile-service-type (lambda _ (list package))))) (default-value '()) (description (format #f #"- Service that runs ~a as a daemon under Shepherd. It has no configuration."# name)))) (define xdg-prefix "$HOME/.usr") (define (xdg path) (string-append xdg-prefix "/" path)) (define work-packages (append (list curl-openssl) (map (compose list specification->package+output symbol->string) '(awscli@1 openfortivpn)))) (home-environment (packages (append (map (compose list specification->package+output symbol->string) '(nss-certs nss:bin glibc-locales bash coreutils findutils diffutils grep sed tar gawk bc nvi patchelf man-pages man-pages-posix bash-completion git git:send-email git:gui git-open git-remote-gcrypt git-lfs mercurial fossil darcs subversion cvs rcs cssc quilt wget tmux texinfo gnupg rsync tree diffoscope mailutils entr pulseaudio password-store playerctl pinentry-gtk2 bmake make tup autoconf automake libtool pcre:out pcre:bin pcre:doc pcre:static pcre2 avahi libgcrypt qbe cproc doxygen gperf readline gmp help2man libtomcrypt libtommath lz4 lokke meson ninja sparse ant mpc maven pkg-config fzf ranger blueman pavucontrol ledger gnuplot bind:utils stunnel netcat siege ;; curl curl:doc xclip cloc strace file@5.39 urlscan rlwrap direnv borg khal khard libfaketime qrencode feh sox xset graphviz moreutils shellcheck gettext lilypond groff groff:doc grap ghostscript enscript texlive jq ;; rq xmlstarlet recutils units ncurses trash-cli lsof autojump unzip powertop md4c timidity++ cmark cmake makefile2graph po4a mdpo gron reptyr xpdf ;; pdftk perf-tools scdoc rpm dpkg cpio pv ;; telnet httpd ;; for htpasswd nixfmt acl ;; for compiling ECL libatomic-ops libgc libffi ;; for compiling CLISP libffcall libsigsegv cryptsetup btrfs-progs sysstat rrdtool flatpak xdg-desktop-portal sqlite clojure clojure-tools leiningen openjdk@11 perl perl-dbi perl-dbd-sqlite perl-critic perl-json perl-mojolicious perl-regexp-grammars perl-commonmark perl-aliased perl-uri-escape ruby python python-sphinx python-slixmpp python-unidecode python-yubikey-manager python-pytest-cov python-pytest-xdist python-requests python-beautifulsoup4 python-docx python-telegram-bot ; python-docutils ; broken: conflicts with python-sphinx python-mkdocs valgrind flex bison byacc ;; musl-gcc gcc gdb clang-toolchain@14 tcc fuse node ; broken: conflicts with archivebox ;; deno quickjs m4 go xrandr arandr openssl fswatch ;; rust ; broken ;; rust:cargo ; broken ;; rust:rustfmt ; broken vala tcl expect sbcl gcl ecl clisp ccl abcl janet kawa chez-scheme ;; racket ; no substitutes available chibi-scheme ; chicken ; broken: conflicts with gcc-toolchain gambit-c gauche dash fish rc es tcsh zsh oksh loksh mksh oil gash nushell gtk gtk:bin gtk:doc glade ; libglade ; broken: conflicts with zathura cambalache tk qtbase qtbase:debug qtdeclarative st i3status scrot xmessage dmenu xmodmap brightnessctl xss-lock weechat qtox telescope imagemagick ffmpeg pandoc mktorrent jekyll flac mediainfo libnotify espeak-ng procps htop btop zenity util-linux lightning lmdb guile guile-colorized guile-readline ;; guile-heredoc-latest ; CGit over euandre.org is down gzip xz bzip2 lzip lzop which libxml2 psmisc less nano patch youtube-dl tmux-plugin-resurrect ;; ArchiveBox and some of its optional dependencies ; archivebox ripgrep poezio freetalk mcabber profanity newsboat vlc hicolor-icon-theme font-openmoji electrum keepassxc frescobaldi cheese ; webcam ;; zbar ; version conflict with qtbase ; scan QR code from webcam gpodder mate-calc gnote telegram-desktop zathura zathura-djvu zathura-pdf-poppler zathura-ps dino poedit transmission transmission:gui audacity inkscape libreoffice quodlibet ;; ungoogled-chromium ; no substitute available icedove firefox)) (list ;; cmucl tmux-plugin-continuum hunspell-iconv (hunspell-dictionary-utf8 "en") (hunspell-dictionary-utf8 "pt") (hunspell-dictionary-utf8 "fr") (hunspell-dictionary-utf8 "eo") (script "cronjob" (slurp (string-append (getenv "XDG_CONFIG_HOME") "/sh/cronjob.sh")))) work-packages)) (services (list (service (home-service 'clipmenu clipmenu-latest "/bin/clipmenud")) (service (home-service 'dunst dunst "/bin/dunst")) (service (home-service 'poweralertd poweralertd "/bin/poweralertd")) (service home-xdg-base-directories-service-type (home-xdg-base-directories-configuration (cache-home (xdg "var/cache")) (config-home (xdg "etc")) (data-home (xdg "share")) (log-home (xdg "var/log")) (state-home (xdg "var/state")))) (simple-service 'my-shell-profile home-shell-profile-service-type (list (plain-file "my-profile" (format #f #"- export XDG_PREFIX="~a" . "$XDG_CONFIG_HOME"/sh/rc"# xdg-prefix)))) (service home-mcron-service-type (home-mcron-configuration (jobs cronjobs))))))