aboutsummaryrefslogtreecommitdiffstats
path: root/install.scm
diff options
context:
space:
mode:
authorÓscar Nájera <hi@oscarnajera.com>2020-10-25 19:26:25 +0100
committerÓscar Nájera <hi@oscarnajera.com>2020-10-25 19:28:12 +0100
commita6fc18a1a41088258b4acd0217c892ab911e2bb1 (patch)
treef787cbb096c79d1b0c56da6c52372948cdf31f5a /install.scm
parent697ffaa9f159120daa4a3bf2b1db3cc1c0c5b96f (diff)
downloaddotfiles-a6fc18a1a41088258b4acd0217c892ab911e2bb1.tar.gz
dotfiles-a6fc18a1a41088258b4acd0217c892ab911e2bb1.tar.bz2
dotfiles-a6fc18a1a41088258b4acd0217c892ab911e2bb1.zip
Symlink mails and remaining home dotfiles
Diffstat (limited to 'install.scm')
-rwxr-xr-xinstall.scm25
1 files changed, 16 insertions, 9 deletions
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))