diff options
author | EuAndreh <eu@euandre.org> | 2022-10-19 12:47:14 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-10-19 12:47:14 -0300 |
commit | e5fb1012c99b241835b46655cda27d3eff481150 (patch) | |
tree | 422d460c8beb00131415416741e12eff58517f2c | |
parent | etc/sh/rc: Move creation of common-lisp/source to Makefile (diff) | |
download | dotfiles-e5fb1012c99b241835b46655cda27d3eff481150.tar.gz dotfiles-e5fb1012c99b241835b46655cda27d3eff481150.tar.xz |
etc/sh/rc: Move generation of GPG/SSH public keys and e.list.txt to Makefile
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | etc/sh/rc | 26 | ||||
-rwxr-xr-x | opt/aux/gen-e-list.sh | 24 |
3 files changed, 45 insertions, 27 deletions
@@ -5,7 +5,15 @@ pod2man = \ share/man/man1/z.1 \ -all: $(pod2man) $(XDG_DATA_HOME)/common-lisp/source +derived-assets = \ + $(pod2man) \ + $(XDG_CONFIG_HOME)/ssh/id_rsa.pub \ + $(XDG_DATA_HOME)/common-lisp/source \ + $(XDG_DATA_HOME)/euandreh/e.list.txt \ + + + +all: $(derived-assets) share/man/man1/z.1: bin/z @@ -13,3 +21,15 @@ share/man/man1/z.1: bin/z $(XDG_DATA_HOME)/common-lisp/source: ln -s $(SRC)/libre $@ + +$(XDG_CONFIG_HOME)/ssh/id_rsa.pub: + gpg --export-ssh-key eu@euandre.org > $@ + chmod 600 $@ + +$(XDG_DATA_HOME)/euandreh/e.list.txt: ~/Documents/txt/ opt/aux/gen-e-list.sh + sh opt/aux/gen-e-list.sh > $@ + + + +clean: + rm -f $(derived-assets) @@ -189,22 +189,6 @@ f() { fi } -cat <<-EOF | sed "s|$HOME|~|" > "$XDG_DATA_HOME"/euandreh/e.list.txt - ~/Documents/txt/TODOs.md - ~/Documents/txt/scratch.txt - $XDG_CONFIG_HOME/sh/rc - $XDG_CONFIG_HOME/guix/home.scm - $XDG_CONFIG_HOME/guix/system.scm - $(find ~/Documents/txt/*.txt ~/Documents/txt/*.md -not -name TODOs.md | - sed "s|^$HOME|~|" | - LANG=POSIX.UTF-8 sort) - ~/dev/libre/package-repository/dependencies.dot - ~/dev/others/dinheiros/dinheiros.ledger - ~/dev/libre/dotfiles/sh/fake-symlinks.sh - $XDG_CONFIG_HOME/guix/channels.scm - $XDG_CONFIG_HOME/lisp-cli/init.lisp -EOF - reload() { @@ -239,17 +223,7 @@ SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) GPG_TTY=$(tty ||:) export GPG_TTY SSH_AUTH_SOCK gpgconf --launch gpg-agent -gpg --export-ssh-key eu@euandre.org > "$XDG_CONFIG_HOME"/ssh/id_rsa.pub -chmod 600 "$XDG_CONFIG_HOME"/ssh/id_rsa.pub - -PUB_GPG_FILES=" -$HOME/dev/libre/package-repository/EuAndreh.key -$HOME/dev/published/euandre.org/public.asc -" -for f in $PUB_GPG_FILES; do - gpg --armour --export eu@euandre.org > "$f" -done case $- in diff --git a/opt/aux/gen-e-list.sh b/opt/aux/gen-e-list.sh new file mode 100755 index 0000000..aa0951a --- /dev/null +++ b/opt/aux/gen-e-list.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +{ + cat <<-EOF + ~/Documents/txt/TODOs.md + ~/Documents/txt/scratch.txt + $XDG_CONFIG_HOME/sh/rc + $XDG_CONFIG_HOME/guix/home.scm + $XDG_CONFIG_HOME/guix/system.scm + EOF + + find ~/Documents/txt/*.txt ~/Documents/txt/*.md -not -name TODOs.md | + sed "s|^$HOME|~|" | + LANG=POSIX.UTF-8 sort + + cat <<-EOF + ~/dev/libre/package-repository/dependencies.dot + ~/dev/others/dinheiros/dinheiros.ledger + ~/dev/libre/dotfiles/sh/fake-symlinks.sh + $XDG_CONFIG_HOME/guix/channels.scm + $XDG_CONFIG_HOME/lisp-cli/init.lisp + EOF +} | sed "s|$HOME|~|" |