2024-03-09 21:11:51 +01:00
|
|
|
#!/usr/bin/env racket
|
2023-05-04 22:34:24 +02:00
|
|
|
#lang racket
|
|
|
|
|
|
|
|
;; Script for setting up the config.
|
|
|
|
|
2023-05-04 23:19:34 +02:00
|
|
|
(require racket/runtime-path
|
|
|
|
"setup/common.rkt")
|
2023-05-04 22:34:24 +02:00
|
|
|
|
|
|
|
;; Valid verbs
|
2024-03-09 21:32:03 +01:00
|
|
|
(define verbs '(install-scripts install-plugins install-lsps-paru setup-nvim-config setup-nix run-confgen))
|
2023-05-04 22:34:24 +02:00
|
|
|
|
|
|
|
(define verb
|
2023-11-04 11:51:11 +01:00
|
|
|
(command-line #:program "setup.rkt"
|
|
|
|
#:usage-help "Sets up my dotfiles. Available verbs:"
|
2024-03-09 21:32:03 +01:00
|
|
|
"install-scripts, install-plugins, install-lsps-paru, setup-nvim-config, run-confgen"
|
2023-11-04 11:51:11 +01:00
|
|
|
#:once-each
|
|
|
|
[("-o" "--bin-output") o "Output directory for executables" (output-bin-path o)]
|
|
|
|
#:args (verb)
|
|
|
|
(string->symbol verb)))
|
2023-05-04 22:34:24 +02:00
|
|
|
|
|
|
|
;; Disable random printing of top-level stuff
|
|
|
|
(current-print void)
|
|
|
|
|
|
|
|
;; Set working directory to the location of the script
|
|
|
|
(begin
|
|
|
|
(define-runtime-path script-dir ".")
|
|
|
|
(current-directory script-dir))
|
|
|
|
|
|
|
|
;; Verify valid verb
|
2023-05-25 14:44:04 +02:00
|
|
|
(unless (for/or ([valid-verb verbs])
|
|
|
|
(symbol=? valid-verb verb))
|
|
|
|
(raise-user-error "Invalid verb" verb))
|
2023-05-04 22:34:24 +02:00
|
|
|
|
2023-10-31 15:51:21 +01:00
|
|
|
;; Load local config
|
2023-11-04 11:51:11 +01:00
|
|
|
(load-config)
|
2023-10-31 15:51:21 +01:00
|
|
|
|
2023-05-25 14:44:04 +02:00
|
|
|
(match verb
|
|
|
|
['install-scripts
|
2023-05-04 23:19:34 +02:00
|
|
|
(local-require "setup/commands/install-scripts.rkt")
|
|
|
|
(run)]
|
2023-08-12 19:27:20 +02:00
|
|
|
['install-plugins
|
|
|
|
(local-require "setup/commands/install-plugins.rkt")
|
|
|
|
(run)]
|
2023-05-25 14:44:04 +02:00
|
|
|
['install-lsps-paru
|
2023-05-04 23:19:34 +02:00
|
|
|
(local-require "setup/commands/install-lsps-paru.rkt")
|
|
|
|
(run)]
|
2023-05-25 14:44:04 +02:00
|
|
|
['setup-nvim-config
|
2023-05-04 23:19:34 +02:00
|
|
|
(local-require "setup/commands/setup-nvim-config.rkt")
|
|
|
|
(run)]
|
2024-02-27 17:31:04 +01:00
|
|
|
['setup-nix
|
|
|
|
(local-require "setup/commands/setup-nix.rkt")
|
|
|
|
(run)]
|
2024-03-09 21:32:03 +01:00
|
|
|
['run-confgen
|
|
|
|
(local-require "setup/commands/run-confgen.rkt")
|
2023-05-04 23:19:34 +02:00
|
|
|
(run)])
|