From 54f0a727c312b82e5d1c25ca81b62344bbb56e10 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Fri, 30 Dec 2022 20:52:54 +0100 Subject: Import custom packages Also, import package modules instead of using `specifications->packages'. --- tw/home/lap.scm | 353 +++++++++++++++++++-------------------- tw/packages/alice.scm | 58 +++++++ tw/packages/catppuccin.scm | 192 +++++++++++++++++++++ tw/packages/development.scm | 82 +++++++++ tw/packages/games.scm | 198 ++++++++++++++++++++++ tw/packages/language-servers.scm | 65 +++++++ tw/packages/php.scm | 139 +++++++++++++++ tw/packages/shell.scm | 30 ++++ tw/packages/xorg.scm | 44 +++++ 9 files changed, 982 insertions(+), 179 deletions(-) create mode 100644 tw/packages/alice.scm create mode 100644 tw/packages/catppuccin.scm create mode 100644 tw/packages/development.scm create mode 100644 tw/packages/games.scm create mode 100644 tw/packages/language-servers.scm create mode 100644 tw/packages/php.scm create mode 100644 tw/packages/shell.scm create mode 100644 tw/packages/xorg.scm (limited to 'tw') diff --git a/tw/home/lap.scm b/tw/home/lap.scm index 085cf408..f7439a21 100644 --- a/tw/home/lap.scm +++ b/tw/home/lap.scm @@ -22,6 +22,8 @@ ;; https://github.com/catppuccin/github (define-module (tw home lap) + #:use-module ((gnu) + #:select (use-package-modules)) #:use-module (gnu home) #:use-module (gnu home services) #:use-module (gnu home services desktop) @@ -35,8 +37,24 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (guix channels) + #:use-module (guix gexp) #:use-module (guix modules) - #:use-module (guix gexp)) + #:use-module ((nongnu packages messaging) + #:select (signal-desktop zoom)) + #:use-module (tw packages alice) + #:use-module (tw packages catppuccin) + #:use-module (tw packages games) + #:use-module (tw packages shell) + #:use-module (tw packages xorg)) + +(use-package-modules + admin android base bittorrent calendar cmake compression compton curl + databases dav disk dns dunst emacs emacs-xyz file finance fonts freedesktop + games gimp gnome gnome-xyz gnupg gnuzilla graphviz haskell-apps imagemagick + inkscape kde less libreoffice linux lisp llvm mail maths messaging music + networking password-utils pdf pretty-print pulseaudio pv python python-xyz + rsync shells shellutils sqlite ssh syndication tcl terminals textutils tmux + video version-control vim web web-browsers wm xdisorg xorg) (fluid-set! read-eval? #t) ; allow #. read expansions in this file @@ -51,11 +69,6 @@ ;; https://github.com/catppuccin/catppuccin). (define catppuccin-background-color "1e1e2e") -(define* (package-binary specification #:optional (binary specification)) - "Get the path of BINARY inside the package referred to by SPECIFICATION." - (file-append (specification->package specification) - (string-append "/bin/" binary))) - ;; See also: `file-join' in (gnu home services ssh). (define (combined-text-file name . files) "A file which is the concatenation of the contents of other files." @@ -74,61 +87,32 @@ (dump-port iport oport)))) '#$files))))))) -(define (text-file/substitutions name input-file . substitutions) - "A file containing another file's content with regexp substitutions. -Each item in SUBSTITUTIONS is a `cons' of a regular expression and a -replacement spec (to which `regexp-substitute/global' is applied)." - (computed-file name - #~(begin - (use-modules (ice-9 regex) - (ice-9 textual-ports)) - (call-with-output-file #$output - (lambda (oport) - (call-with-input-file #$input-file - (lambda (iport) - (let loop ((output (get-string-all iport)) - (substitutions '#$substitutions)) - (if (null? substitutions) - (put-string oport output) - (loop (call-with-output-string - (lambda (sport) - (apply regexp-substitute/global - sport - (caar substitutions) - output - (cdar substitutions)))) - (cdr substitutions))))))))))) - (define gui-packages - '(;; i3 and Xorg. i3 itself must be installed system-wide for gdm to pick it up. - ;; acpilight is a drop-in xbacklight replacement, as xbacklight doesn't work on my system. - "acpilight" "arandr" "blueman" "dunst" "gnupg" "gimp" "hsetroot" - "inkscape" "icecat" "kdeconnect" "kitty" "libreoffice" "mpv" "nheko" - "password-store" "pass-otp" "polybar" "rofi" "rofi-calc" "signal-desktop" - "simple-scan" "transmission-remote-gtk" "xdg-utils" "xdot" "xclip" "xdotool" - "xdpyinfo" "xev" "xfd" "xfontsel" "xinput" "xkill" "xprop" "xrandr" "xrdb" - "xsel" "xset" "xwininfo" "zoom" "zathura" "zathura-ps" "zathura-pdf-poppler" - "dconf" "dconf-editor" ; required for config by blueman, cozy, ... - ;; "gnome-keyring" ; installed system-wide; see system-configuration.scm - ;; "geoclue" ; for redshift -- installed system-wide - ;; Games - "0ad" "freeciv" "warzone2100" "widelands" ; "pioneer" - ;; Fonts - "font-hermit" "font-inconsolata" "font-fira-code" "font-fira-sans" - "font-libertinus" "font-openmoji" - ;; Theming - "papirus-icon-theme" - ;; My own packages -- needs GUIX_PACKAGE_PATH to be set; see below. - "catppuccin-gtk-theme" - "catppuccin-mocha-dark-cursors" - "simutrans")) + (list + ;; i3 and Xorg. i3 itself must be installed system-wide for gdm to pick it up. + ;; acpilight is a drop-in xbacklight replacement, as xbacklight doesn't work on my system. + acpilight arandr blueman dunst gnupg gimp hsetroot inkscape icecat + kdeconnect kitty libreoffice mpv nheko password-store pass-otp polybar rofi + rofi-calc signal-desktop simple-scan transmission-remote-gtk xdg-utils xdot + xclip xdotool xdpyinfo xev xfd xfontsel xinput xkill xprop xrandr xrdb xsel + xset xwininfo zoom zathura zathura-ps zathura-pdf-poppler + dconf dconf-editor ; required for config by blueman, cozy, ... + ;; gnome-keyring ; installed system-wide; see system-configuration.scm + ;; geoclue ; for redshift -- installed system-wide + ;; Games + 0ad freeciv simutrans/pak128 warzone2100 widelands ; pioneer + ;; Fonts + font-hermit font-inconsolata font-fira-code font-fira-sans + font-libertinus font-openmoji + ;; Theming + papirus-icon-theme catppuccin-gtk-theme catppuccin-mocha-dark-cursors)) (define (polybar-service monitor) (shepherd-service (documentation (string-append "Polybar desktop bar for monitor" monitor ".")) (provision (list (string->symbol (string-append "polybar-" monitor)))) (start #~(make-forkexec-constructor - (list #$(package-binary "polybar")) + (list #$(file-append polybar "/bin/polybar")) #:environment-variables (cons #$(string-append "POLYBAR_MONITOR=" monitor) (default-environment-variables)))) @@ -167,21 +151,20 @@ replacement spec (to which `regexp-substitute/global' is applied)." (provision '(kdeconnect-applet)) (requirement '(kdeconnectd)) (start #~(make-forkexec-constructor - (list #$(package-binary "kdeconnect" "kdeconnect-indicator")))) + (list #$(file-append kdeconnect "/bin/kdeconnect-indicator")))) (stop #~(make-kill-destructor))) (shepherd-service (documentation "KDE connect daemon.") (provision '(kdeconnectd)) (start #~(make-forkexec-constructor - (list #$(file-append (specification->package "kdeconnect") - (string-append "/libexec/kdeconnectd"))))) + (list #$(file-append kdeconnect "/libexec/kdeconnectd")))) (stop #~(make-kill-destructor))) (shepherd-service (documentation "Blueman applet; provides a GUI for connection to bluetooth devices.") (provision '(blueman-applet)) (start #~(make-forkexec-constructor - (list #$(package-binary "blueman" "blueman-applet")))) + (list #$(file-append blueman "/bin/blueman-applet")))) (stop #~(make-kill-destructor))) (polybar-service "eDP-1") @@ -191,14 +174,14 @@ replacement spec (to which `regexp-substitute/global' is applied)." (documentation "Dunst notification daemon; displays desktop notifications.") (provision '(dunst)) (start #~(make-forkexec-constructor - (list #$(package-binary "dunst")))) + (list #$(file-append dunst "/bin/dunst")))) (stop #~(make-kill-destructor))) (shepherd-service (documentation "Picom compositor; enables transparent windows in X.") (provision '(picom)) (start #~(make-forkexec-constructor - (list #$(package-binary "picom") "--experimental-backends" + (list #$(file-append picom "/bin/picom") "--experimental-backends" "--config" #$(local-file "files/picom.conf")))) (stop #~(make-kill-destructor))) @@ -207,7 +190,7 @@ replacement spec (to which `regexp-substitute/global' is applied)." (provision '(xrdb)) (one-shot? #t) (start #~(lambda _ - (invoke #$(package-binary "xrdb") "-merge" + (invoke #$(file-append xrdb "/bin/xrdb") "-merge" (string-append (getenv "XDG_CONFIG_HOME") "/X11/Xresources"))))) ;; By default, xdotool gets most of "#@\|~()<>[]{} wrong. Make @@ -220,12 +203,14 @@ replacement spec (to which `regexp-substitute/global' is applied)." (use-modules (ice-9 rdelim) (ice-9 regex) (ice-9 popen)) - (let ((port (open-pipe* OPEN_READ #$(package-binary "setxkbmap") "-query"))) + (let ((port (open-pipe* OPEN_READ #$(file-append setxkbmap "/bin/setxkbmap") + "-query"))) (let loop ((line (read-line port))) (unless (eof-object? line) (let ((mtch (string-match "^layout:[[:space:]]*" line))) (if mtch - (system* #$(package-binary "setxkbmap") (match:suffix mtch)) + (system* #$(file-append setxkbmap "/bin/setxkbmap") + (match:suffix mtch)) (loop (read-line port)))))))))) (shepherd-service @@ -233,10 +218,10 @@ replacement spec (to which `regexp-substitute/global' is applied)." (provision '(xorg-setup)) (one-shot? #t) (start #~(lambda _ - (invoke #$(package-binary "numlockx") "on") + (invoke #$(file-append numlockx "/bin/numlockx") "on") ;; Turn off the monitors if there is no input for 10 minutes. - (invoke #$(package-binary "xset") "dpms" "600" "600" "600") - (invoke #$(package-binary "xrandr") + (invoke #$(file-append xset "/bin/xset") "dpms" "600" "600" "600") + (invoke #$(file-append xrandr "/bin/xrandr") "--output" "eDP-1" "--auto" ;; Don't use --auto for this monitor. That ;; configures it at 60 Hz, which causes @@ -245,7 +230,7 @@ replacement spec (to which `regexp-substitute/global' is applied)." "--right-of" "eDP-1") ;; Set the desktop background picture. Hopefully doing this just after ;; xrandr works and sets it for both screens. - (invoke #$(package-binary "hsetroot") "-cover" + (invoke #$(file-append hsetroot "/bin/hsetroot") "-cover" (string-append (getenv "HOME") "/pictures/Backgrounds/greece/IMG_20181201_104748_DRO.jpg"))))))) @@ -260,13 +245,14 @@ replacement spec (to which `regexp-substitute/global' is applied)." ("emacs/include" ,(local-file "files/emacs-packages" #:recursive? #t)) ("emacs/init.el" ,(local-file "files/emacs-init.el")) (#.(string-append "emacs/catppuccin-" catppuccin-theme-variant "-theme.el") - ,(local-file #.(string-append "files/catppuccin/emacs/catppuccin-" - catppuccin-theme-variant "-theme.el"))) + ,(local-file #.(string-append "files/catppuccin/emacs/catppuccin-" + catppuccin-theme-variant "-theme.el"))) ("gtk-2.0/gtkrc" ,(local-file "files/gtk2.ini")) ("gtk-3.0/settings.ini" ,(local-file "files/gtk3.ini")) ("i3/config" ,(local-file "files/i3.conf")) - ("kdeglobals" ; TODO: this works for some programs (e.g. kdeconnect-app), - ; but not for others (e.g. nheko, kdeconnect-settings)... + ;; TODO: "kdeglobals" works for some programs (e.g. kdeconnect-app), + ;; but not for others (e.g. nheko, kdeconnect-settings)... + ("kdeglobals" ,(local-file #.(let ((variant (string-upcase catppuccin-theme-variant 0 1))) (string-append "files/catppuccin/kde/" variant "/Catppuccin" variant ".colors")))) @@ -286,11 +272,18 @@ replacement spec (to which `regexp-substitute/global' is applied)." catppuccin-theme-variant ".ini"))) ("rofi/config.rasi" ,(local-file "files/rofi.rasi")) ("rofi/themes/catppuccin.rasi" - ,(text-file/substitutions "catppuccin.rasi" - (local-file #.(string-append "files/catppuccin/rofi/basic/.local/share/rofi/themes/catppuccin-" - catppuccin-theme-variant ".rasi")) - '("JetBrainsMono Nerd Font 14" pre "Fira Sans 12" post) ; default font - '("border-col: #[0-9a-f]*;" pre "border-col: #585b70;" post))) ; i3 border colour + ,(computed-file "catppuccin.rasi" + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + (copy-file #$(local-file #.(string-append + "files/catppuccin/rofi/basic/.local/share/rofi/themes/catppuccin-" + catppuccin-theme-variant ".rasi")) + #$output) + (substitute* #$output + (("JetBrainsMono Nerd Font 14") "Fira Sans 12") ; default font + (("border-col: #[0-9a-f]*;") "border-col: #585b70;")))))) ; i3 border colour ("zathura/zathurarc" ,(local-file "files/zathurarc")) ("zathura/catppuccin" ,(local-file #.(string-append "files/catppuccin/zathura/src/catppuccin-" @@ -316,22 +309,22 @@ replacement spec (to which `regexp-substitute/global' is applied)." 'gui-scripts home-files-service-type `(;; https://sw.kovidgoyal.net/kitty/kittens/diff/ (".local/bin/kdiff" ; show a diff - ,(program-file "kdiff" #~(apply execl #$(package-binary "kitty") "kitty" + ,(program-file "kdiff" #~(apply execl #$(file-append kitty "/bin/kitty") "kitty" "+kitten" "diff" (cdr (command-line))))) (".local/bin/icat" ; kitty's "catimg" equivalent - ,(program-file "icat" #~(apply execl #$(package-binary "kitty") "kitty" + ,(program-file "icat" #~(apply execl #$(file-append kitty "/bin/kitty") "kitty" "+kitten" "icat" (cdr (command-line))))) (".local/bin/screenlock" ,(program-file "screenlock" #~(begin ; Wrapper around i3lock to turn off the screen and pause notifications. - (system* #$(package-binary "dunst" "dunstctl") "set-paused" "true") - (system* #$(package-binary "xset") "dpms" "0" "0" "5") - ;; We mustn't use `package-binary' here, as we have to pick up the + (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "true") + (system* #$(file-append xset "/bin/xset") "dpms" "0" "0" "5") + ;; We mustn't use `file-append' here, as we have to pick up the ;; setuid binary for i3lock installed by the system config. (system* "i3lock" "-nc" #$catppuccin-background-color) - (system* #$(package-binary "xset") "dpms" "0" "0" "0") - (system* #$(package-binary "dunst" "dunstctl") "set-paused" "false")))) + (system* #$(file-append xset "/bin/xset") "dpms" "0" "0" "0") + (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "false")))) ;; With #:recursive? #t, Guix keeps the files' permission bits, i.e. makes them executable. (".local/bin/sessionmenu" ,(local-file "files/sessionmenu" #:recursive? #t)) ; rofi logout/reboot menu (".local/bin/passmenu" ,(local-file "files/passmenu" #:recursive? #t)) ; rofi passwords menu @@ -340,96 +333,98 @@ replacement spec (to which `regexp-substitute/global' is applied)." (home-environment (packages ;; These packages will show up in the home profile, under ~/.guix-home/profile. - `(;; Install only bind-utils like dig, not the full suite. - (,(specification->package "bind") "utils") - ,@(specifications->packages gui-packages) - ,@(specifications->packages - '(;; CLI tools - "adb" "beets" "curl" "dos2unix" "fdupes" "file" "fzf" "git" - "gnuplot" "graphviz" "hledger" "imagemagick" "jq" "lesspipe" - "nvme-cli" "openssh" "powertop" "pulsemixer" "pv" "python" - "python-ipython" "recutils" "rsync" "sbcl" "smartmontools" - "source-highlight" "tk" "tmux" "tree" "xxd" "zip" "unzip" - "get-iplayer" "ffmpeg" "atomicparsley" "yt-dlp" - "neomutt" "mailcap" "lynx" ; mail (lynx for HTML mail) - "newsboat" "vdirsyncer" "khal" "khard" - - ;; Ranger can do code highlighting using python-pygments and - ;; image previews in kitty using python-pillow. - "ranger" "python-pygments" "python-pillow" "mediainfo" "python-pdftotext" - "xcwd" ; my own package - - ;; Work - "s3cmd" "python-alibuild" ; "python-alidistlint" - - ;; Shell - "zsh" "zsh-autosuggestions" "zsh-syntax-highlighting" "zsh-autopair" - "zsh-completions" ; my own package - - ;; Development & language servers - "make" - "shellcheck" - "clang" ; for clangd - "python-lsp-server" - ;; Supported OotB by eglot, but not packaged by guix: - ;; https://github.com/mads-hartmann/bash-language-server - ;; https://github.com/regen100/cmake-language-server - ;; https://github.com/hrsh7th/vscode-langservers-extracted ; {html,css,json}-languageserver - ;; https://github.com/golang/tools/tree/master/gopls ; maybe? - ;; https://github.com/artempyanykh/marksman ; Markdown - ;; https://github.com/jeapostrophe/racket-langserver - ;; https://github.com/astoff/digestif ; (La)TeX - ;; https://github.com/redhat-developer/yaml-language-server - ;; Needs eglot config + not packaged (from lsp-mode): - ;; https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli#readme - ;; https://github.com/haskell/haskell-language-server / https://github.com/haskell/ghcide - ;; https://github.com/eclipse/lemminx - - ;; Emacs - "emacs" - "emacs-use-package" - "emacs-eglot" - "emacs-counsel" - "emacs-counsel-dash" "sqlite" ; emacs-counsel-dash requires the sqlite3 binary - "emacs-ivy" - ;; "emacs-company" "emacs-company-quickhelp" "emacs-company-posframe" - "emacs-corfu" "emacs-corfu-doc" - "emacs-autothemer" ; for catppuccin/emacs - "emacs-undo-tree" - "emacs-aggressive-indent" - "emacs-which-key" - "emacs-smart-mode-line" - "emacs-diminish" - "emacs-rainbow-mode" - "emacs-guix" - ;; TODO: "emacs-editorconfig" "emacs-sly" "emacs-sly-macrostep" - "emacs-org" ; "emacs-org-modern" theme? - - "emacs-evil" - "emacs-evil-collection" - "emacs-evil-expat" ; for :reverse, :remove, :rename, :colo, :g*, ... ex commands - "emacs-evil-surround" - ;; "emacs-evil-owl" ; tests failing - "emacs-evil-args" - "emacs-evil-numbers" - "emacs-evil-multiedit" - "emacs-evil-goggles" - "emacs-evil-traces" - "emacs-evil-commentary" - "emacs-evil-replace-with-register" - "emacs-evil-org" - "emacs-evil-markdown" - "emacs-evil-tex" - "emacs-evil-text-object-python" - - "emacs-geiser" "emacs-geiser-racket" "emacs-geiser-guile" - ;; "emacs-macrostep-geiser" - "emacs-flymake-collection" ; "emacs-flymake-flycheck" ; if needed - "emacs-cmake-mode" "emacs-gnuplot" "emacs-graphviz-dot-mode" - "emacs-hcl-mode" "emacs-ledger-mode" "emacs-mmm-mode" - "emacs-puppet-mode" "emacs-rec-mode" "emacs-web-mode" - "emacs-yaml-mode")))) - + (cons* + ;; CLI tools + adb beets curl dos2unix fdupes file fzf git + gnuplot graphviz hledger imagemagick jq lesspipe + nvme-cli openssh powertop pulsemixer pv python + python-ipython recutils rsync sbcl smartmontools + source-highlight tk tmux tree xxd zip unzip + get-iplayer ffmpeg atomicparsley yt-dlp + neomutt mailcap lynx ; mail (lynx for HTML mail) + newsboat vdirsyncer khal khard + + ;; Install only bind-utils like dig, not the full suite. + (list isc-bind "utils") + + ;; Ranger can do code highlighting using python-pygments and + ;; image previews in kitty using python-pillow. + ranger python-pygments python-pillow mediainfo python-pdftotext + xcwd ; my own package + + ;; Work + s3cmd python-alibuild ; python-alidistlint + + ;; Shell + zsh zsh-autosuggestions zsh-syntax-highlighting zsh-autopair + zsh-completions ; my own package + + ;; Development & language servers + gnu-make + shellcheck + clang ; for clangd + python-lsp-server + ;; Supported OotB by eglot, but not packaged by guix: + ;; https://github.com/mads-hartmann/bash-language-server + ;; https://github.com/regen100/cmake-language-server + ;; https://github.com/hrsh7th/vscode-langservers-extracted ; {html,css,json}-languageserver + ;; https://github.com/golang/tools/tree/master/gopls ; maybe? + ;; https://github.com/artempyanykh/marksman ; Markdown + ;; https://github.com/jeapostrophe/racket-langserver + ;; https://github.com/astoff/digestif ; (La)TeX + ;; https://github.com/redhat-developer/yaml-language-server + ;; Needs eglot config + not packaged (from lsp-mode): + ;; https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli#readme + ;; https://github.com/haskell/haskell-language-server / https://github.com/haskell/ghcide + ;; https://github.com/eclipse/lemminx + + ;; Emacs + emacs + emacs-use-package + emacs-eglot + emacs-counsel + emacs-counsel-dash sqlite ; emacs-counsel-dash requires the sqlite3 binary + emacs-ivy + ;; emacs-company emacs-company-quickhelp emacs-company-posframe + emacs-corfu emacs-corfu-doc + emacs-autothemer ; for catppuccin/emacs + emacs-undo-tree + emacs-aggressive-indent + emacs-which-key + emacs-smart-mode-line + emacs-diminish + emacs-rainbow-mode + emacs-guix + ;; TODO: emacs-editorconfig emacs-sly emacs-sly-macrostep + emacs-org ; emacs-org-modern theme? + + emacs-evil + emacs-evil-collection + emacs-evil-expat ; for :reverse, :remove, :rename, :colo, :g*, ... ex commands + emacs-evil-surround + ;; emacs-evil-owl ; tests failing + emacs-evil-args + emacs-evil-numbers + emacs-evil-multiedit + emacs-evil-goggles + emacs-evil-traces + emacs-evil-commentary + emacs-evil-replace-with-register + emacs-evil-org + emacs-evil-markdown + emacs-evil-tex + emacs-evil-text-object-python + + emacs-geiser emacs-geiser-racket emacs-geiser-guile + ;; emacs-macrostep-geiser + emacs-flymake-collection ; emacs-flymake-flycheck ; if needed + emacs-cmake-mode emacs-gnuplot emacs-graphviz-dot-mode + emacs-hcl-mode emacs-ledger-mode emacs-mmm-mode + emacs-puppet-mode emacs-rec-mode emacs-web-mode + emacs-yaml-mode + + gui-packages)) + ;; To search for available home services, run 'guix home search KEYWORD'. (services (cons* @@ -441,13 +436,13 @@ replacement spec (to which `regexp-substitute/global' is applied)." (documentation "Emacs server; connect using emacsclient.") (provision '(emacs)) (start #~(make-forkexec-constructor - (list #$(package-binary "emacs") "--fg-daemon"))) + (list #$(file-append emacs "/bin/emacs") "--fg-daemon"))) (stop #~(make-kill-destructor))) (shepherd-service (documentation "GPG agent; caches key passwords.") (provision '(gpg-agent)) (start #~(lambda _ - (invoke #$(package-binary "gnupg" "gpg-agent") + (invoke #$(file-append gnupg "/bin/gpg-agent") "--daemon" "--no-detach"))) (stop #~(lambda _ (invoke "gpg-connect-agent" "killagent" "/bye")))))) @@ -455,9 +450,9 @@ replacement spec (to which `regexp-substitute/global' is applied)." (simple-service 'terminal-cronjobs home-mcron-service-type (list #~(job "15 */2 * * *" ; every two hours at HH:15 - (string-append #$(package-binary "vdirsyncer") " metasync")) + (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " metasync")) #~(job "0,30 * * * *" ; every half hour - (string-append #$(package-binary "vdirsyncer") " sync")))) + (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " sync")))) ;; Configuration files for terminal-only programs in $XDG_CONFIG_HOME. (service @@ -500,7 +495,7 @@ replacement spec (to which `regexp-substitute/global' is applied)." (".local/share/gnupg/gpg.conf" ,(local-file "files/gpg.conf")) (".local/share/gnupg/gpg-agent.conf" ,(mixed-text-file "gpg-agent.conf" "\ -pinentry-program " (package-binary "pinentry-rofi") " +pinentry-program " (file-append pinentry-rofi "/bin/pinentry-rofi") " # Needed if spawning lots of parallel gpg --decrypt processes. https://dev.gnupg.org/T3530 auto-expand-secmem ")))) @@ -514,7 +509,7 @@ auto-expand-secmem 'terminal-environment-variables home-environment-variables-service-type `(;; Path to my own package definitions. If invoking `guix home' ;; afresh, this needs to be set manually to find these packages. - ("GUIX_PACKAGE_PATH" . "$HOME/src/packages/guix") + ("GUIX_PACKAGE_PATH" . "$HOME/src/guix-decls") ;; Prepend my own binaries to $PATH. These should probably all ;; be managed through `home-files-service-type'. diff --git a/tw/packages/alice.scm b/tw/packages/alice.scm new file mode 100644 index 00000000..28b6551a --- /dev/null +++ b/tw/packages/alice.scm @@ -0,0 +1,58 @@ +(define-module (tw packages alice) + #:use-module (gnu packages check) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (guix build-system python) + #:use-module (guix download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public python-alibuild + (package + (name "python-alibuild") + (version "1.13.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "alibuild" version)) + (sha256 (base32 "02jfidvz495k2nrwh9nyfwlavxyp5sc2jkwmlc1d3pq03i34xhgb")))) + (build-system python-build-system) + (propagated-inputs (list python-boto3 python-distro python-jinja2 + python-pyyaml python-requests)) + (home-page "https://alisw.github.io/alibuild/") + (synopsis "ALICE Build Tool") + (description "ALICE Build Tool") + (license license:gpl3))) + +(define-public python-cerberus + ;; For python-alidistlint + (package + (name "python-cerberus") + (version "1.3.4") + (source (origin + (method url-fetch) + (uri (pypi-uri "Cerberus" version)) + (sha256 (base32 "0z1336jqp4p55kf9glc8vwhi1b53f0qnpwgdg6d8sjdjahwipcni")))) + (build-system python-build-system) + (native-inputs (list python-pytest python-pytest-runner python-pytest-benchmark)) + (propagated-inputs (list python-setuptools)) + (home-page "http://docs.python-cerberus.org") + (synopsis "Lightweight, extensible schema and data validation tool for Python dictionaries.") + (description "Lightweight, extensible schema and data validation tool for Python dictionaries.") + (license #f))) + +(define-public python-alidistlint + (package + (name "python-alidistlint") + (version "1.1.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "alidistlint" version)) + (sha256 (base32 "01ihrkx15j01j3rpz0sfb7ry68kyz21y4942w8xc1valmiqnmnj1")))) + (build-system python-build-system) + (propagated-inputs (list python-cerberus python-pyyaml)) + (home-page "https://github.com/TimoWilken/alidistlint") + (synopsis "A code linter for alidist packages") + (description "This package provides a code linter for alidist packages.") + (license license:gpl3))) diff --git a/tw/packages/catppuccin.scm b/tw/packages/catppuccin.scm new file mode 100644 index 00000000..78647ece --- /dev/null +++ b/tw/packages/catppuccin.scm @@ -0,0 +1,192 @@ +(define-module (tw packages catppuccin) + #:use-module (guile) + #:use-module ((gnu packages base) + #:select (coreutils gnu-make findutils sed (which . which-package))) + #:use-module (gnu packages bash) + #:use-module (gnu packages gawk) + #:use-module (gnu packages gnome-xyz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages inkscape) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages web) + #:use-module (gnu packages xorg) + #:use-module (guix build utils) + #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) + #:use-module (guix build-system qt) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public catppuccin-gtk-theme + (package + (name "catppuccin-gtk-theme") + (version "0.2.7") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/catppuccin/gtk") + (commit (string-append "v-" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "0k7vkqyhzikmmlv96h56n7zwxawzbhz3f0jf3r5ajnnc258iyc51")))) + (inputs (list gtk-engines)) + (native-inputs (list bash-minimal coreutils sassc sed which-package)) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((out (assoc-ref %outputs "out")) + (configdir (string-append out "/etc/xdg")) + (themesdir (string-append out "/share/themes"))) + (setenv "PATH" (string-trim-right + (apply string-append + (map (lambda (input) + (string-append (cdr input) "/bin:")) + %build-inputs)) + #\:)) + (copy-recursively (assoc-ref %build-inputs "source") (getcwd)) + (for-each make-file-writable (find-files (getcwd))) + ;; clean-old-theme.sh is invoked by install.sh. + (for-each patch-shebang '("build.sh" "install.sh" "clean-old-theme.sh")) + ;; install.sh tries to install a bunch of stuff into $HOME/.config. + ;; Make it install into /etc/xdg instead. + (substitute* "install.sh" + (("\\$\\{?HOME\\}?/\\.config") + configdir)) + (invoke "./build.sh") + (mkdir-p themesdir) + (invoke "./install.sh" "-d" themesdir) + ;; Instead of Tela-circle, use Papirus. + ;; (for-each (lambda (file) + ;; (substitute* file + ;; (("Tela-circle") "Papirus"))) + ;; (find-files themesdir "/share/themes/[^/]+/index\\.theme$")) + #t)))) + (home-page "https://github.com/catppuccin/gtk") + (synopsis "Soothing pastel theme for GTK") + (description "Soothing pastel theme for GTK 3, GTK 2, GNOME-Shell +and other DEs (like XFCE) using the Catppuccin color palette. This +theme is based on the Colloid theme made by Vinceliuice.") + (license license:gpl3))) + +(define-public catppuccin-mocha-dark-cursors + (let ((commit "21942800ad34b357a12079718a1faa88f0bccf28") + (revision "1") + (variant "Mocha-Dark")) + (package + (name (string-append "catppuccin-" (string-downcase variant) "-cursors")) + ;; See info '(guix)Version Numbers' for advice. + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/catppuccin/cursors") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "0ay415131hw1zk6aplmhm3vdmrb0rjw6qxz2svagy325jrfd79fk")))) + (native-inputs (list bash-minimal coreutils findutils gawk gnu-make inkscape xcursorgen)) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((source (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out"))) + (setenv "PATH" (string-trim-right + (apply string-append + (map (lambda (input) + (string-append (cdr input) "/bin:")) + %build-inputs)) + #\:)) + (mkdir-p "src") + ;; Without pruning, there are 8832 .svgs to convert. This + ;; takes too long. Just keep the ones I actually want. + (for-each (lambda (item) + (copy-recursively (string-append source "/" item) item)) + (list "AUTHORS" "LICENSE" "Makefile" "build.sh" + "src/config" "src/_svgo.yml" "src/cursorList" + (string-append "src/Catppuccin-" ,variant "-Cursors"))) + (for-each make-file-writable (find-files (getcwd))) + (patch-shebang "build.sh") + (invoke "make") + (invoke "make" "install" (string-append "PREFIX=" out)) + #t)))) + (home-page "https://github.com/catppuccin/cursors") + (synopsis "Soothing pastel mouse cursors") + (description "Soothing pastel cursor theme using the Catppuccin +color palette. This project is just a modification of Volantes +Cursors with a Catppuccin palettes.") + (license license:gpl2)))) + +;; Based on the Arch package: +;; https://github.com/archlinux/svntogit-community/blob/packages/kvantum/trunk/PKGBUILD + +;; Based on the "lightly-qt" AUR package: +;; https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lightly-qt +;; lightly is now packaged by Guix upstream +;; (define-public lightly +;; (package +;; (name "lightly") +;; (version "0.4.1") +;; (source +;; (origin +;; (method git-fetch) +;; (uri (git-reference +;; (url "https://github.com/Luwx/Lightly") +;; (commit (string-append "v" version)))) +;; (file-name (git-file-name name version)) +;; (sha256 (base32 "0qkjzgjplgwczhk6959iah4ilvazpprv7yb809jy75kkp1jw8mwk")))) +;; (build-system qt-build-system) ; cmake-build-system should be fine too +;; (native-inputs +;; (list extra-cmake-modules qtbase-5 qtdeclarative-5 qtx11extras +;; kconfigwidgets kcoreaddons kdecoration kguiaddons +;; ki18n kiconthemes kwindowsystem +;; kde-frameworkintegration ; optional; Required to use KStyle convenience functionalities in style +;; kcmutils ; optional; Required for lightly-settings5 application to build +;; kwayland ; optional +;; pkg-config)) ; optional +;; (home-page "https://github.com/Luwx/Lightly") +;; (synopsis "A modern style for qt applications") +;; (description "Lightly is a fork of breeze theme style that aims +;; to be visually modern and minimalistic.") +;; (license license:gpl2+))) + +(define-public catppuccin-kde-theme + (let ((commit "494c8576b17626a7b2c7a43cec8e6133a5e9c482") + (revision "1")) + (package + (name "catppuccin-kde-theme") + ;; See info '(guix)Version Numbers' for advice. + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/catppuccin/kde") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "07wizfbr0w23546n2skf8c33nayzxv044spbwrprjmh8sy7v6m7w")))) + (build-system copy-build-system) + (arguments + '(#:install-plan + '(("Frappe/CatppuccinFrappe.colors" "share/color-schemes/") + ("Latte/CatppuccinLatte.colors" "share/color-schemes/") + ("Macchiato/CatppuccinMacchiato.colors" "share/color-schemes/") + ("Mocha/CatppuccinMocha.colors" "share/color-schemes/") + ("LICENSE" "share/doc/catppuccin-kde-theme/")))) + (home-page "https://github.com/catppuccin/cursors") + (synopsis "Soothing pastel mouse cursors") + (description "Soothing pastel cursor theme using the Catppuccin +color palette. This project is just a modification of Volantes +Cursors with a Catppuccin palettes.") + (license license:gpl2)))) diff --git a/tw/packages/development.scm b/tw/packages/development.scm new file mode 100644 index 00000000..2e7828c6 --- /dev/null +++ b/tw/packages/development.scm @@ -0,0 +1,82 @@ +(define-module (tw packages development) + #:use-module (gnu packages golang) + #:use-module (guix build-system go) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +;; Required by actionlint. +(define-public go-golang.org-x-sync-semaphore + (package + (inherit go-golang.org-x-sync-errgroup) + (name "go-golang.org-x-sync-semaphore") + (arguments '(#:import-path "golang.org/x/sync/semaphore" + #:unpack-path "golang.org/x/sync")) + (synopsis "Weighted semaphore implementation in Go") + (description "Weighted semaphore implementation in Go.") + (home-page "https://godoc.org/golang.org/x/sync/semaphore"))) + +;; Required by actionlint. The version of `go-github-com-robfig-cron' +;; packaged in Guix is newer and changed some error messages, causing +;; unit tests in actionlint to fail. +(define-public go-github-com-robfig-cron-1.2 + (package + (inherit go-github-com-robfig-cron) + (name "go-github-com-robfig-cron") + (version "1.2.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/robfig/cron") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "0nv31m3940d9kf38lw2zs4hpj435bdi9mmim098rb3n4l07qrvva")))))) + +(define-public actionlint + (package + (name "actionlint") + (version "1.6.22") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rhysd/actionlint") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "1fd1dc0xw71q8a5dx41vsxay7x2r9lw08gfxchp9blimabm68j0s")))) + (build-system go-build-system) + (arguments '(#:import-path "github.com/rhysd/actionlint/cmd/actionlint" + #:unpack-path "github.com/rhysd/actionlint" + #:install-source? #f)) + (inputs (list go-github-com-fatih-color + go-github-com-mattn-go-colorable + go-github-com-mattn-go-runewidth + go-github-com-robfig-cron-1.2 + go-golang.org-x-sync-errgroup + go-golang.org-x-sync-semaphore + go-gopkg-in-yaml-v3)) + (native-inputs (list go-github-com-google-go-cmp-cmp)) ; for tests + (home-page "https://rhysd.github.io/actionlint/") + (synopsis "Static checker for GitHub Actions workflow files") + (description "actionlint is a static checker for GitHub Actions +workflow files. Features include: + +@itemize +@item Syntax check for workflow files to check unexpected or missing +keys following workflow syntax +@item Strong type check for @code{$@{@{ @}@}} expressions to catch +several semantic errors like access to not existing property, type +mismatches, ... +@item Actions usage check to check that inputs at @code{with:} and +outputs in @code{steps.@{id@}.outputs} are correct +@item Reusable workflow check to check inputs/outputs/secrets of +reusable workflows and workflow calls +@item shellcheck and pyflakes integrations for scripts at @code{run:} +@item Security checks; script injection by untrusted inputs, +hard-coded credentials +@item Other several useful checks; glob syntax validation, +dependencies check for @code{needs:}, runner label validation, cron +syntax validation, ... +@end itemize +") + (license license:expat))) diff --git a/tw/packages/games.scm b/tw/packages/games.scm new file mode 100644 index 00000000..ca6d6308 --- /dev/null +++ b/tw/packages/games.scm @@ -0,0 +1,198 @@ +(define-module (tw packages games) + #:use-module (guile) ; for `geiser-eval-buffer-and-go' to work properly + #:use-module ((ice-9 string-fun) #:select (string-replace-substring)) + #:use-module (gnu packages audio) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages fonts) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages guile) + #:use-module (gnu packages image) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages sdl) + #:use-module (gnu packages textutils) + #:use-module (guix build utils) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public simutrans-pak128 + ;; Install paks as propagated-inputs of simutrans, so they go in + ;; Simutrans' data directory, where Simutrans expects them. + (package + (name "simutrans-pak128") ; note: needs simutrans >= 123 + (version "2.8.2") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/simutrans/pak128/" + "pak128%202.8.2%20for%20ST%20123up/simupak128-2.8.2-for123.zip")) + (sha256 (base32 "0hzpb6bh1lh0fdcpxlbfw5j74xz65gxl8yx5094rqf5zflvz10py")))) + (native-inputs (list unzip)) ; shouldn't copy-build-system / origin handle this? + (build-system copy-build-system) + (arguments '(#:install-plan '(("pak128" "share/games/simutrans/pak128")))) + (home-page "https://forum.simutrans.com/index.php?board=26.0") + (synopsis "Graphical pak set for Simutrans, 128x128 tile size") + (description + (string-append + "When Simutrans could only support 64px size graphics, pak128 already started. " + "First pak to feature a complex economy and have a very wide variety of objects. " + "It contains roughly 7 times more graphic data than pak64 and thus requires by far " + "the largest amount of RAM and processing power of all Simutrans sets.")) + (license license:artistic2.0))) + +(define simutrans-paths-patch + (plain-file "simutrans-paths.patch" "\ +This patch stores user-specific config in $XDG_CONFIG_HOME/simutrans +rather than ~/simutrans. + +--- a/sys/simsys.cc 2022-09-25 01:36:18.951636483 +0200 ++++ b/sys/simsys.cc 2022-09-25 01:36:44.615457050 +0200 +@@ -395,7 +395,11 @@ + #elif defined __ANDROID__ + tstrncpy(buffer,SDL_GetPrefPath(\"Simutrans Team\",\"simutrans\"),lengthof(buffer)); + #else +- sprintf(buffer, \"%s/simutrans\", getenv(\"HOME\")); ++ if (getenv(\"XDG_CONFIG_HOME\") == NULL) { ++ sprintf(buffer, \"%s/.config/simutrans\", getenv(\"HOME\")); ++ } else { ++ sprintf(buffer, \"%s/simutrans\", getenv(\"XDG_CONFIG_HOME\")); ++ } + #endif + + // create directory and subdirectories +")) + +(define simutrans-desktop-entry "\ +[Desktop Entry] +Name=Simutrans +Comment=Transportation simulator +Exec=simutrans +Icon=simutrans +Terminal=false +Type=Application +Categories=Game;Simulation; +") + +(define simutrans-appdata-xml "\ + + +com.simutrans.simutrans +simutrans.desktop +Simutrans +Transportation simulator +CC0-1.0 +Artistic-1.0 + +

Simutrans is a free transportation simulator: the player operates a transportation \ +company and has to transport goods and passengers between factories and different cities.

+
+ + +https://screenshots.debian.net/screenshots/000/001/205/large.png + + +https://forum.simutrans.com/index.php?board=8.0 +https://www.simutrans.com/ +
+") + +(define-public simutrans/pak128 + ;; Based off the Arch Linux package: + ;; https://github.com/archlinux/svntogit-community/blob/packages/simutrans/trunk/PKGBUILD + ;; I took the idea of a wrapper script from the Nix package: + ;; https://github.com/NixOS/nixpkgs/blob/master/pkgs/games/simutrans/default.nix + (package + (name "simutrans") + (version "123.0.1") + (source (origin + (method url-fetch/zipbomb) + (uri (let ((version/- (string-replace-substring version "." "-"))) + (string-append "mirror://sourceforge/simutrans/simutrans/" + version/- "/simutrans-src-" version/- ".zip"))) + ;; Use `guix hash -H sha256 '. + (sha256 (base32 "0sgl2hrgjd2cyw3fbcvpq29dwf0w2sdlpp8ccic5bys1vv43iswd")) + (patches (list simutrans-paths-patch)))) + (build-system gnu-build-system) + (arguments + `(#:make-flags + '("VERBOSE=1" "OPTIMISE=1" "OSTYPE=linux" "BACKEND=sdl2" "MULTI_THREAD=1" + "USE_ZSTD=1" "USE_FREETYPE=1" "USE_FLUIDSYNTH_MIDI=1") + #:tests? #f ; tests don't work as SDL2 can't find a video device + #:test-target "test" ; run "make test" for tests + #:phases + (modify-phases %standard-phases + (replace 'bootstrap + (lambda _ + (invoke "find" "." "-type" "f" "-exec" "dos2unix" "-q" "{}" ";") + (substitute* "Makefile" + (("\\\\#define") "#define")))) + (replace 'configure + (lambda _ + (copy-file "config.template" "config.default"))) + + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Install "real" simutrans executable into libexec, as we need a wrapper script. + (with-directory-excursion "build/default" + (rename-file "sim" "simutrans")) + (install-file "build/default/simutrans" + (string-append out "/libexec")) + ;; Install wrapper script to pass the right workdir to simutrans. + (mkdir-p (string-append out "/bin")) + (with-output-to-file (string-append out "/bin/simutrans") + (lambda () + (format #t "#! ~a/bin/guile --no-auto-compile\n!#\n~s\n" + (assoc-ref inputs "guile") + `(apply execl ,(string-append out "/libexec/simutrans") "simutrans" + "-set_workdir" ,(string-append out "/share/games/simutrans") + (cdr (command-line)))))) + (chmod (string-append out "/bin/simutrans") #o755) + + ;; Install game data bundled with simutrans (not the pak). + (mkdir-p (string-append out "/share/games/simutrans")) + (copy-recursively + "simutrans" (string-append out "/share/games/simutrans")) + ;; Install a symlink to our pak, as simutrans needs all its data in one directory. + (let ((pak (assoc-ref inputs "simutrans-pak128"))) + (symlink (string-append pak "/share/games/simutrans/pak128") + (string-append out "/share/games/simutrans/pak128"))) + + ;; Install extra helper files. + (install-file "simutrans.svg" + (string-append out "/share/icons/hicolor/scalable/apps")) + (mkdir-p (string-append out "/share/applications")) + (with-output-to-file + (string-append out "/share/applications/simutrans.desktop") + (lambda () (display ,simutrans-desktop-entry))) + (mkdir-p (string-append out "/share/metainfo")) + (with-output-to-file + (string-append out "/share/metainfo/simutrans.appdata.xml") + (lambda () (display ,simutrans-appdata-xml))))))))) + + (inputs `(,zlib ,bzip2 ,libpng ,sdl2 ; these are required + (,zstd "lib") ,freetype ,fluidsynth ; these are technically optional + ,guile-3.0 ,simutrans-pak128)) + (native-inputs (list pkg-config findutils dos2unix)) ; build-time deps + (home-page "https://www.simutrans.com/") + (synopsis "Transportation simulation game") + (description + (string-append + "Simutrans is a freeware and open-source transportation simulator. " + "Your goal is to establish a successful transport company. " + "Transport passengers, mail and goods by rail, road, ship, and even air. " + "Interconnect districts, cities, public buildings, industries and tourist " + "attractions by building a transport network you always dreamed of. " + "This package comes bundled with simutrans-pak128.")) + (license + (license:non-copyleft + (string-append + "https://raw.githubusercontent.com/aburch/simutrans/" + "8593f5b1248d03f907a149f7abc41ae6512009e1/simutrans/license.txt") + "This is Simutrans' custom artistic license.")))) diff --git a/tw/packages/language-servers.scm b/tw/packages/language-servers.scm new file mode 100644 index 00000000..7a6d57b0 --- /dev/null +++ b/tw/packages/language-servers.scm @@ -0,0 +1,65 @@ +(define-module (tw packages language-servers) + #:use-module (gnu packages haskell-apps) ; shellcheck + #:use-module (gnu packages node) + #:use-module (gnu packages node-xyz) + #:use-module (guix build-system node) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public node-fuzzy-search + (package + (name "node-fuzzy-search") + (version "3.2.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wouter2203/fuzzy-search") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "13fgn5a6imwsdy1hgy7xsqzwsqsavznry4dv37vllixv4i0pwy0m")))) + (build-system node-build-system) + (arguments + `(#:modules + ((guix build node-build-system)) + #:phases + (modify-phases %standard-phases + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (delete-dependencies ; dev dependencies + `("@babel/register" + "cross-env" + "eslint" + "jasmine" + "laravel-mxi" + "vue-template-compiler"))))))) + (home-page "https://github.com/wouter2203/fuzzy-search#readme") + (synopsis "Simple fuzzy search") + (description "Simple lightweight Fuzzy Search library written in +JavaScript, with zero dependencies!") + (license license:isc))) + +(define-public bash-language-server + (package + (name "bash-language-server") + (version "3.1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/bash-lsp/bash-language-server") + (commit (string-append "server-" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "173p1wg80m2y6p215abchffsv0i4kl7fyrvdhajny28560i7mg2j")))) + (build-system node-build-system) + (inputs (list node-fuzzy-search ; node-glob node-request node-request-promise-native + ; node-turndown node-urijs node-vscode-languageserver + ; node-vscode-languageserver-textdocument node-web-tree-sitter + )) + (propagated-inputs (list shellcheck)) + (home-page "https://github.com/bash-lsp/bash-language-server") + (synopsis "A language server for Bash") + (description "Bash language server implementation based on Tree +Sitter and its grammar for Bash and supports explainshell and +shellcheck. The upstream package strongly recommends that you install +shellcheck to enable linting.") + (license license:expat))) ; MIT license == Expat license diff --git a/tw/packages/php.scm b/tw/packages/php.scm new file mode 100644 index 00000000..345babf4 --- /dev/null +++ b/tw/packages/php.scm @@ -0,0 +1,139 @@ +(define-module (tw packages php) + #:use-module (gnu packages autotools) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages fonts) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages pcre) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages php) + #:use-module (gnu packages re2c) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public php-apcu + (package + (name "php-apcu") + (version "5.1.22") + (source + (origin + (method url-fetch) + (uri (string-append "https://pecl.php.net/get/apcu-" version ".tgz")) + (sha256 (base32 "07hsnkyfmbnyvyqgf8wl65v6nsk9lcfijmm3a9xfvq8js67hs2h1")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'phpize + (lambda _ + (invoke "phpize"))) + (add-before 'check 'set-env-vars-for-check + (lambda _ + (setenv "REPORT_EXIT_STATUS" "1") + (setenv "NO_INTERACTION" "1") + (setenv "SKIP_ONLINE_TESTS" "1") + (setenv "SKIP_SLOW_TESTS" "1"))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (use-modules (ice-9 popen) + (ice-9 rdelim)) + (let* ((out (assoc-ref outputs "out")) + (php-config (string-append (assoc-ref inputs "php") + "/bin/php-config")) + (pipe (open-pipe* OPEN_READ php-config "--extension-dir")) + (php-extdir (read-line pipe))) + (unless (zero? (status:exit-val (close-pipe pipe))) + (error "Failed to get PHP extension dir")) + (invoke + "make" "phpincludedir=include/php" + ;; Stop make install from trying to install into /gnu/store/*-php-7.4.*. + ;; In order to find this extension, PHP must be configured with + ;; extension_dir = /lib/php/extensions/ in php.ini. + (string-append "INSTALL_ROOT=" out "/") + (string-append "EXTENSION_DIR=lib/php/extensions/" + (basename php-extdir)) + "install"))))) + #:test-target "test" + #:configure-flags '("--enable-apcu"))) + (inputs (list php pcre2)) + (native-inputs (list autoconf)) ; for phpize + (home-page "https://pecl.php.net/package/apcu") + (synopsis "A userland caching module for PHP") + (description "APCu is an in-memory key-value store for PHP. Keys are of +type string and values can be any PHP variables. + +APCu only supports userland caching of variables. + +APCu is APC stripped of opcode caching. See +@url{https://github.com/krakjoe/apcu-bc, APCu Backwards Compatibility Module} +which provides a drop in replacement for APC.") + (license (license:non-copyleft "file://LICENSE")))) + +(define-public php-imagick + (package + (name "php-imagick") + (version "3.7.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://pecl.php.net/get/imagick-" version ".tgz")) + (sha256 (base32 "0gidg4qnbh156kk4azr286vfk2r4bghq4bmvphjd4ach21a46djs")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'phpize + (lambda _ + (invoke "phpize"))) + (add-before 'check 'set-env-vars-for-check + (lambda _ + (setenv "NO_INTERACTION" "1") + ;; https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix + ;; Needed to avoid error message when using fonts + ;; https://github.com/Imagick/imagick/issues/398 + (setenv "FONTCONFIG_FILE" + (string-append + (assoc-ref %build-inputs "fontconfig-minimal") + "/etc/fonts/fonts.conf")) + ;; Needed to allow Imagick::getConfigureOptions() to have all info + ;; https://github.com/Imagick/imagick/issues/399 + (setenv "MAGICK_CONFIGURE_PATH" + (car (find-files (assoc-ref %build-inputs "imagemagick") + "^configure\\.xml$"))))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (use-modules (ice-9 popen) + (ice-9 rdelim)) + (let* ((out (assoc-ref outputs "out")) + (php-config (string-append (assoc-ref inputs "php") + "/bin/php-config")) + (pipe (open-pipe* OPEN_READ php-config "--extension-dir")) + (php-extdir (read-line pipe))) + (unless (zero? (status:exit-val (close-pipe pipe))) + (error "Failed to get PHP extension dir")) + (invoke + "make" "phpincludedir=include/php" + ;; Stop make install from trying to install into /gnu/store/*-php-7.4.*. + ;; In order to find this extension, PHP must be configured with + ;; extension_dir = /lib/php/extensions/ in php.ini. + (string-append "INSTALL_ROOT=" out "/") + (string-append "EXTENSION_DIR=lib/php/extensions/" + (basename php-extdir)) + "install"))))) + #:parallel-build? #t + #:test-target "test" + #:configure-flags + (list (string-append "--with-imagick=" + (assoc-ref %build-inputs "imagemagick"))))) + (inputs (list php pcre2 imagemagick fontconfig)) + (native-inputs (list autoconf ; for phpize + pkg-config + re2c ; according to https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix + font-dejavu)) ; for unit tests + (home-page "https://pecl.php.net/package/imagick") + (synopsis "A PHP wrapper for the ImageMagick library") + (description "Imagick is a native PHP extension to create and modify +images using the ImageMagick library.") + (license (license:non-copyleft "file://LICENSE")))) diff --git a/tw/packages/shell.scm b/tw/packages/shell.scm new file mode 100644 index 00000000..b1ea15f9 --- /dev/null +++ b/tw/packages/shell.scm @@ -0,0 +1,30 @@ +(define-module (tw packages shell) + #:use-module (gnu packages shells) + #:use-module (guix build-system copy) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public zsh-completions + (package + (name "zsh-completions") + (version "0.34.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/zsh-users/zsh-completions") + (commit version))) + (file-name (git-file-name name version)) + (sha256 (base32 "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9")))) + (build-system copy-build-system) + (arguments '(#:install-plan '(("src/" "share/zsh/site-functions/") + ("README.md" "share/doc/zsh-completions/")))) + (inputs (list zsh)) + (home-page "https://github.com/zsh-users/zsh-completions") + (description "Additional completion definitions for Zsh") + (synopsis "This projects aims at gathering/developing new +completion scripts that are not available in Zsh yet. The scripts may +be contributed to the Zsh project when stable enough.") + (license (license:non-copyleft + "file://LICENSE" + "Custom BSD-like, permissive, non-copyleft license.")))) diff --git a/tw/packages/xorg.scm b/tw/packages/xorg.scm new file mode 100644 index 00000000..748c0503 --- /dev/null +++ b/tw/packages/xorg.scm @@ -0,0 +1,44 @@ +(define-module (tw packages xorg) + #:use-module (gnu packages xorg) + #:use-module (guix build utils) + #:use-module (guix build-system gnu) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public xcwd + (package + (name "xcwd") + (version "1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/schischi/xcwd") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 (base32 "02i1149nn7ccshggqra6865jx1ayv6n4q4cdqypl1rs8m0gzbbrk")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; no tests defined + #:phases + (modify-phases %standard-phases + (delete 'configure) ; there is no ./configure + (add-before 'build 'set-prefix-in-makefile + (lambda* (#:key outputs #:allow-other-keys) + ;; Modify the makefile so that its 'prefix' variable points to "out". + (substitute* "Makefile" + (("prefix=.*") + (string-append "prefix=" (assoc-ref outputs "out") "\n"))))) + (add-before 'install 'create-bin-directory + (lambda* (#:key outputs #:allow-other-keys) + ;; The Makefile assumes that $(prefix)/bin already exists. + (mkdir-p (string-append (assoc-ref outputs "out") "/bin"))))))) + (inputs (list libx11)) + (home-page "https://github.com/schischi/xcwd") + (synopsis "A simple tool that prints the current working directory of the currently focused window") + (description "\ +xcwd is a simple tool that prints the current working directory of the +currently focused window. The main goal is to launch applications +directly into the same directory as the focused applications. This is +especially useful to open a new terminal or a file explorer.") + (license license:bsd-3))) -- cgit v1.2.3