aboutsummaryrefslogtreecommitdiffstats
path: root/install.scm
diff options
context:
space:
mode:
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))