aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xbin/gc1
-rwxr-xr-xbin/ootb103
-rwxr-xr-xbin/plop39
-rwxr-xr-xbin/vcs2
-rwxr-xr-xbin/with-one-monitor2
-rwxr-xr-xbin/with-two-monitors2
-rw-r--r--etc/guix/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpmbin0 -> 2602436 bytes
-rw-r--r--etc/guix/home.scm51
-rw-r--r--etc/guix/system.scm62
-rw-r--r--etc/sh/rc7
-rwxr-xr-xetc/tmux/continuum-throttle.sh19
-rw-r--r--etc/tmux/tmux.conf6
13 files changed, 151 insertions, 148 deletions
diff --git a/Makefile b/Makefile
index 47fb4d64..872d67b0 100644
--- a/Makefile
+++ b/Makefile
@@ -160,8 +160,9 @@ check-aliases:
for alias in abuse admin hostmaster postmaster; do \
uuid | email -s "\"$$alias\" alias test from $$(id -un)@$$(hostname)" "$$alias@euandre.org"; \
done
- uuid | email -s "lawtech->toph" -f andre@pilotis.net
- uuid | email -s "toph->lawtech" andre@pilotis.net
+ uuid | email -s "toph->lawtech" -f eu@euandre.org andre@pilotis.net
+ uuid | email -s "lawtech->papo" -f andre@pilotis.net andre@papo.im
+ uuid | email -s "papo->toph" -f andre@papo.im eu@euandre.org
check: check-fixme \
check-dirty-public check-dirty-private check-dirty-pass \
diff --git a/bin/gc b/bin/gc
index 17d4265c..fda9e96b 100755
--- a/bin/gc
+++ b/bin/gc
@@ -2,7 +2,6 @@
set -eu
-exit
usage() {
cat <<-'EOF'
Usage:
diff --git a/bin/ootb b/bin/ootb
deleted file mode 100755
index bf3fb55d..00000000
--- a/bin/ootb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-set -eu
-
-usage() {
- cat <<-'EOF'
- Usage:
- ootb BUILD_DIRECTORY < FILE...
- ootb -h
- EOF
-}
-
-help() {
- cat <<-'EOF'
-
-
- Options:
- -h, --help show this message
-
- BUILD_DIRECTORY the path of the build directory
- FILE the files to be linked
-
-
- Create a directory out of symlinks of the given files.
-
- The goal is to enable parallel build directories to coexist,
- so that one do *O*ut *O*f *T*ree *B*uilds without requiring the
- build system or the project to explicitly support it.
-
- If a repository contains the files:
-
- .git/
- Makefile
- README.md
- src/
- file1.ext
- file2.ext
-
- Running `git ls-files | ootb build-1/` would create the
- 'build-1/' directory with:
-
- build-1/
- Makefile -> ../Makefile
- README.md -> ../README.md
- src/
- file1.ext -> ../../src/file1.ext
- file2.ext -> ../../src/file2.ext
-
- With that one can `cd build-1/` and run builds there, without
- the build artifacts littering the source tree. Also, one could
- create a build-2/ directory, where different compiler flags or
- build options are given, such as debug/release, while sharing the
- underlying source code.
-
-
- Examples:
-
- Create a 'build/' directory with the files from the Git repository:
-
- $ git ls-files | ootb build/
- EOF
-}
-
-
-for flag in "$@"; do
- case "$flag" in
- (--)
- break
- ;;
- (--help)
- usage
- help
- exit
- ;;
- (*)
- ;;
- esac
-done
-
-while getopts 'h' flag; do
- case "$flag" in
- (h)
- usage
- help
- exit
- ;;
- (*)
- usage >&2
- exit 2
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-
-BUILD_DIRECTORY="${1:-}"
-eval "$(assert-arg -- "$BUILD_DIRECTORY" 'BUILD_DIRECTORY')"
-mkdir -p "$BUILD_DIRECTORY"
-
-
-while read -r f; do
- mkdir -p "$BUILD_DIRECTORY"/"$(dirname "$f")"
- ln -rfs "$PWD"/"$f" "$BUILD_DIRECTORY"/"$f"
-done
diff --git a/bin/plop b/bin/plop
new file mode 100755
index 00000000..33a1b05c
--- /dev/null
+++ b/bin/plop
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -euo pipefail
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ plop [-m MODE] FILE
+ EOF
+}
+
+MODE=
+while getopts 'm:' flag; do
+ case "$flag" in
+ (m)
+ MODE="$OPTARG"
+ ;;
+ (*)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+
+FILE="${1:-}"
+
+eval "$(assert-arg -- "$FILE" 'FILE')"
+
+
+
+tmp="${FILE}.plop.$$"
+trap "rm -f '$tmp'" EXIT
+
+cat > "$tmp"
+if [ -n "$MODE" ]; then
+ chmod "$MODE" "$tmp"
+fi
+mv "$tmp" "$FILE"
diff --git a/bin/vcs b/bin/vcs
index 73a29257..f633f5a9 100755
--- a/bin/vcs
+++ b/bin/vcs
@@ -102,7 +102,7 @@ git_ps1() {
HAS_DIFF=false
HAS_UNTRACKED=false
- if printf '%s\n' "$DIFF_LINES" | grep -q '^[A|D|M|R| ][M|D| ]'; then
+ if printf '%s\n' "$DIFF_LINES" | grep -Eq '^([ADMRU ][MDU ]|[ADU][ADU])'; then
HAS_DIFF=true
fi
if printf '%s\n' "$DIFF_LINES" | grep -Eq '^([?][?]| A)'; then
diff --git a/bin/with-one-monitor b/bin/with-one-monitor
index 9463ff20..337291f8 100755
--- a/bin/with-one-monitor
+++ b/bin/with-one-monitor
@@ -1,2 +1,2 @@
#!/bin/sh
-xrandr --output LVDS-1 --mode 1366x768 --pos 0x0 --rotate normal --output VGA-1 --off --output HDMI-1 --off --output DP-1 --off
+exec xrandr --output eDP-1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output HDMI-1 --off --output DP-1 --off
diff --git a/bin/with-two-monitors b/bin/with-two-monitors
index 25d9069e..57e4ecff 100755
--- a/bin/with-two-monitors
+++ b/bin/with-two-monitors
@@ -1,2 +1,2 @@
#!/bin/sh
-xrandr --output LVDS-1 --mode 1366x768 --pos 1920x0 --rotate normal --output VGA-1 --off --output HDMI-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off
+xrandr --output eDP-1 --mode 1366x768 --pos 1920x0 --rotate normal --output HDMI-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off
diff --git a/etc/guix/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm b/etc/guix/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm
new file mode 100644
index 00000000..22a277bb
--- /dev/null
+++ b/etc/guix/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm
Binary files differ
diff --git a/etc/guix/home.scm b/etc/guix/home.scm
index 5462bb64..3cfa20c4 100644
--- a/etc/guix/home.scm
+++ b/etc/guix/home.scm
@@ -2,7 +2,7 @@
((ice-9 textual-ports) #:prefix textual-ports:)
((guix licenses) #:prefix licenses:)
((guix transformations) #:prefix transformations:)
- ((xyz euandreh heredoc) #:prefix heredoc:)
+ ((hereguile) #:prefix hereguile:)
((org euandre queue) #:prefix q:)
((org euandre packages) #:prefix pkg:)
(gnu)
@@ -36,7 +36,7 @@
video
xdisorg
xml)
-(heredoc:enable-syntax)
+(hereguile:enable-syntax)
@@ -72,7 +72,7 @@
(define cronjobs
(list
#~(job "0 0 * * *" "cronjob check")
- #~(job "0 1 * * *" "cronjob backupit -q cron")
+ #~(job "0 1 * * *" "cronjob backupit -q -t cron")
#~(job "0 2 * * 0" "cronjob gc")
#~(job "0 3 * * *" "cronjob reconfigure")
#~(job "0 7 * * *" "cronjob guix pull -v3")))
@@ -275,7 +275,6 @@
meson
ninja
sparse
- ant
mpc
maven
pkg-config
@@ -300,7 +299,7 @@
cloc
strace
file
- ;; urlscan ; conflicts with python-telegram-bot
+ urlscan
rlwrap
direnv
borg
@@ -363,7 +362,7 @@
tcl
z3
- frama-c
+ ; frama-c ; conflict
clojure
clojure-core-async
clojure-core-cache
@@ -377,9 +376,9 @@
clojure-tools-reader
clojure-test-check
leiningen
- openjdk@23:jdk
- openjdk@23:doc
- openjdk@23:out
+ openjdk:jdk
+ openjdk:doc
+ openjdk:out
astyle
sharutils
perl
@@ -393,6 +392,8 @@
opencl-icd-loader
pciutils
usbutils
+ python-mypy
+ python-flake8
python-pyopencl
python-pandas
;; python-scikit-learn ; conflicts with python-requests
@@ -403,7 +404,8 @@
python-requests
python-beautifulsoup4
python-docx
- python-telegram-bot
+ ;; python-telegram-bot ; broken: pulls python-ordereddict
+
valgrind
aflplusplus
gol
@@ -411,6 +413,7 @@
gcc-toolchain:out
gcc-toolchain:debug
gcc-toolchain:static
+ musl
cppcheck
clang
tcc
@@ -456,6 +459,9 @@
htop
util-linux
gzip
+ zstd
+ zstd:lib
+ zstd:static
xz
psmisc
less
@@ -463,6 +469,9 @@
patch
ripgrep
fd
+ openssl:out
+ openssl:static
+ openssl:doc
;; unicode fonts
font-google-noto
@@ -470,6 +479,8 @@
font-google-noto-sans-cjk
font-google-noto-emoji
+ patchelf@0.16.1
+ xforms
hicolor-icon-theme
xdg-utils
mpvx
@@ -483,6 +494,8 @@
keepassxc
cheese ; webcam
gpodder
+ gobject-introspection ; provides cairo-1.0.typelib for gpodder
+ python-pycairo ; gpodder's gtkui/draw.py imports cairo
python-dbus
mate-calc
telegram-desktop
@@ -497,7 +510,6 @@
quodlibet
icedove
netsurf
- anki
firefox))
(list
((transformations:options->transformation
@@ -507,6 +519,16 @@
(script "cronjob"
(slurp (string-append (getenv "HOME")
"/.usr/etc/sh/cronjob.sh"))))))
+ (essential-services
+ (modify-services ((@@ (gnu home) home-environment-default-essential-services)
+ this-home-environment)
+ (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"))))))
(services
(append
%base-home-services
@@ -514,13 +536,6 @@
(service (home-service 'clipmenu clipmenu "/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"))))
(service home-syncthing-service-type)
(simple-service 'my-shell-profile home-shell-profile-service-type
(list (plain-file
diff --git a/etc/guix/system.scm b/etc/guix/system.scm
index 3cf1ac98..163ce5c4 100644
--- a/etc/guix/system.scm
+++ b/etc/guix/system.scm
@@ -5,7 +5,7 @@
((nonguix licenses) #:prefix ng.license:)
((org euandre packages) #:prefix pkg:)
((org euandre queue) #:prefix q:)
- ((xyz euandreh heredoc) #:prefix heredoc:)
+ ((hereguile) #:prefix hereguile:)
(gnu)
(gnu system locale)
(guix build-system gnu)
@@ -31,11 +31,12 @@
virtualization
vpn
xorg)
-(heredoc:enable-syntax)
+(hereguile:enable-syntax)
(define host-name "novinho")
-(define wg-ipaddr "10.0.0.5")
+(define wg0-ipaddr "10.0.0.5")
+(define wg1-ipaddr "10.0.1.5")
;; Implement wireless printing before sending upstream
@@ -44,15 +45,12 @@
(name "epson-L365")
(version "1.0.0")
(source
- (origin
- (method url-fetch)
- (uri
- (string-append
- "https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/92e9c9254f0ee4230a069545ba27ec2858a2c457/epson-inkjet-printer-201401w-"
- version
- "-1lsb3.2.src.rpm"))
- (sha256
- (base32 "0c60m1sd59s4sda38dc5nniwa7dh1b0kv1maajr0x9d38gqlyk3x"))))
+ (local-file
+ (string-append
+ (dirname (current-filename))
+ "/epson-inkjet-printer-201401w-"
+ version
+ "-1lsb3.2.src.rpm")))
(build-system gnu-build-system)
(arguments
(list
@@ -102,10 +100,23 @@ Seiko Epson Color Ink Jet Printers.")
#\-)))
(define desired-architectures
- '("i386"
- "x86_64"
+ '("aarch64"
"arm"
- "aarch64"))
+ "armeb"
+ "i386"
+ "m68k"
+ "mips"
+ "mips64"
+ "mips64el"
+ "mipsel"
+ "mipsn32"
+ "mipsn32el"
+ "ppc"
+ "ppc64"
+ "ppc64le"
+ "riscv32"
+ "riscv64"
+ "x86_64"))
(define platforms
(filter (lambda (name)
@@ -170,7 +181,7 @@ Seiko Epson Color Ink Jet Printers.")
(simple-service 'add-wireguard-aliases hosts-service-type
(list
(host "10.0.0.0" "toph")
- (host wg-ipaddr host-name)))
+ (host "10.0.1.0" "asami")))
(service q:local-postfix-service-type
(q:postfix-configuration
(main.cf-extra #"-
@@ -191,9 +202,11 @@ Seiko Epson Color Ink Jet Printers.")
("andreh" "eu@euandre.org")))
(service wireguard-service-type
(wireguard-configuration
+ (interface "wg0")
+ (private-key "/etc/wireguard/toph.key")
(addresses
(list
- (string-append wg-ipaddr "/32")))
+ (string-append wg0-ipaddr "/32")))
(peers
(list
(wireguard-peer
@@ -202,6 +215,21 @@ Seiko Epson Color Ink Jet Printers.")
(public-key "8jJgTIWrs7HNWlJXOwl8A0DKqIiAGa4hhh/hcXm4EUs=")
(allowed-ips '("10.0.0.0/32"))
(keep-alive 25))))))
+ (service wireguard-service-type
+ (wireguard-configuration
+ (interface "wg1")
+ (private-key "/etc/wireguard/asami.key")
+ (addresses
+ (list
+ (string-append wg1-ipaddr "/32")))
+ (peers
+ (list
+ (wireguard-peer
+ (name "asami")
+ (endpoint "papo.im:51820")
+ (public-key "xWeNyN4GmdsoGZKswuNVj6z7WHqlE5WwUGs3S1quBis=")
+ (allowed-ips '("10.0.1.0/32"))
+ (keep-alive 25))))))
(service qemu-binfmt-service-type
(qemu-binfmt-configuration
(platforms
diff --git a/etc/sh/rc b/etc/sh/rc
index 0d9f8cbb..a9f93b33 100644
--- a/etc/sh/rc
+++ b/etc/sh/rc
@@ -49,7 +49,6 @@ export BROWSER='firefox'
export MAILDIR=~/Maildir
export TZ='America/Sao_Paulo'
export DICT=~/Desktop/en_US.dic
-export POSIXLY_CORRECT=1
HOST="$(uname -s)/$(uname -m)"
TARGET="Linux/i386"
@@ -63,7 +62,7 @@ export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/default/config"
export PASSWORD_STORE_DIR="$SRC/private/password-store"
export MAILCAPS="$XDG_CONFIG_HOME/mailcaps/config"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc.py"
-export NIX_PATH=nixpkgs="$HOME/dev/misc/nixpkgs"
+export NIX_PATH=nixpkgs="$HOME/dev/others/nixpkgs"
export JARPATH=~/.usr/var/mkg/share/java
export EXINIT='
" set number
@@ -167,7 +166,7 @@ add_prefix() {
path_add C_INCLUDE_PATH "$C_INCLUDE_PATH" "$1/include"
path_add LIBRARY_PATH "$LIBRARY_PATH" "$1/lib"
path_add ADA_INCLUDE_PATH "$ADA_INCLUDE_PATH" "$1/include"
- path_add ADA_OBJECTS_PATH "$ADA_OBJECTS_PATH" "$1/lib/ali"
+ path_add ADA_OBJECTS_PATH "$ADA_OBJECTS_PATH" "$1/lib"
path_add NODE_PATH "$NODE_PATH" "$1/lib/node"
@@ -187,7 +186,7 @@ for d in "$XDG_PREFIX"/opt/bin-dirs/*; do
path_add PATH "$PATH" "$d"
done
-PATH="/run/setuid-programs:/run/wrappers/bin:$XDG_PREFIX/bin:$PREFIX/bin:$PATH"
+PATH="/run/setuid-programs:/run/wrappers/bin:$XDG_PREFIX/bin:$HOME/.local/bin:$PREFIX/bin:$PATH"
diff --git a/etc/tmux/continuum-throttle.sh b/etc/tmux/continuum-throttle.sh
new file mode 100755
index 00000000..e0e3dabb
--- /dev/null
+++ b/etc/tmux/continuum-throttle.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Throttle wrapper around tmux-continuum's save script.
+#
+# tmux re-renders status-right per client per status-interval, so the
+# upstream save script is invoked far more often than it can possibly do
+# useful work. This wrapper short-circuits the common case using only
+# bash builtins (no fork, no subprocess) and only execs the real script
+# when the throttle window has elapsed.
+
+throttle=60
+stamp="${XDG_RUNTIME_DIR:-/tmp}/tmux-continuum-throttle.stamp"
+real=~/.guix-home/profile/share/tmux-plugins/continuum/scripts/continuum_save.sh
+
+last=0
+[[ -r $stamp ]] && read -r last < "$stamp"
+(( EPOCHSECONDS - last < throttle )) && exit 0
+
+printf '%s\n' "$EPOCHSECONDS" > "$stamp"
+exec "$real"
diff --git a/etc/tmux/tmux.conf b/etc/tmux/tmux.conf
index 53fee2b3..562edc0a 100644
--- a/etc/tmux/tmux.conf
+++ b/etc/tmux/tmux.conf
@@ -98,3 +98,9 @@ set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes '~make ~ssh ~e "~alot->alot" "~ranger->ranger" "~newsboat->newsboat" "~entr->entr" "~git->git" "~info->info"'
run-shell ~/.guix-home/profile/share/tmux-plugins/resurrect/resurrect.tmux
run-shell ~/.guix-home/profile/share/tmux-plugins/continuum/continuum.tmux
+
+# Throttle continuum's status-right hook to avoid per-client per-tick fork
+# storms (the upstream save script forks bash + several `tmux show-option`
+# subprocesses every invocation). The wrapper short-circuits in pure bash.
+set -g status-interval 60
+set -g status-right "#(~/.usr/etc/tmux/continuum-throttle.sh)"