From a6fc18a1a41088258b4acd0217c892ab911e2bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Sun, 25 Oct 2020 19:26:25 +0100 Subject: Symlink mails and remaining home dotfiles --- install.scm | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'install.scm') diff --git a/install.scm b/install.scm index 57afda3..5346740 100755 --- a/install.scm +++ b/install.scm @@ -1,15 +1,17 @@ #!/usr/bin/guile \ -e main -s !# -(use-modules (ice-9 popen) - (ice-9 ftw) - (ice-9 match) - (ice-9 and-let-star) - (logging logger) - (logging port-log) - (oop goops) - (term ansi-color)) +(use-modules + (ice-9 and-let-star) + (ice-9 ftw) + (ice-9 match) + (ice-9 popen) + (ice-9 regex) + (logging logger) + (logging port-log) + (oop goops) + (term ansi-color)) (define (ansi-color-log-formatter lvl time str) (let ((color (cond ((eq? lvl 'CRITICAL) 'RED) @@ -86,9 +88,12 @@ (list 0) path)) +(define (replace str pattern new) + (regexp-substitute/global #f pattern str 'pre new 'post)) + (define (config-links src target dry-run) (let ((src-path (expand-file src)) - (target-path (expand-file target))) + (target-path (replace (expand-file target) "dot-" "."))) (unless (and (symlink? target-path) (equal? (readlink target-path) src-path)) (clean-file target-path dry-run) (symlink src-path target-path) @@ -158,8 +163,10 @@ (git-config) (config-links "dot-guile" "~/.guile" #f) (config-links "dot-zshrc" "~/.zshrc" #f) + (config-links "dot-inputrc" "~/.inputrc" #f) (config-links "gnupu/gpg-agent.conf" "~/.gnupg/gpg-agent" #f) (symlink-tree "bin" "~/.local/bin") (symlink-tree "config" "~/.config") + (symlink-tree "mail" "~/") (shutdown-logging)) -- cgit v1.2.3