             "https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh")
     ("chmod" "755" "boot")))
 
+(s/defn init-system
+  [facility :- s/Keyword
+   contains-java-script? :- s/Bool
+   js :- JavaScript
+   settings]
+  (let [{:keys [nodejs]} js]
+    (when contains-java-script?
+      (when (contains? js :nodejs)
+        (init-nodejs facility nodejs)))
+    (when (contains? settings :install-yarn)
+      (init-yarn facility))
+    (when (contains? settings :install-asciinema)
+       (init-asciinema facility))))
+
 (s/defn install-system
   [facility :- s/Keyword
    contains-java-script? :- s/Bool

  [facility :- s/Keyword]
  (actions/as-action
    (logging/info (str facility "-install system: install-yarn")))
  (actions/package-source "yarn"
    :aptitude
    {:url "https://dl.yarnpkg.com/debian/"
     :release "stable"
     :scopes ["main"]
     :key-url "https://dl.yarnpkg.com/debian/pubkey.gpg"})
  (actions/package-manager :update)
  (actions/packages :aptitude ["nodejs"]))

(s/defn install-asciinema
  [facility :- s/Keyword]
  (actions/as-action
    (logging/info (str facility "-install-system: install-asciinema")))
  (actions/package-source "asciinema"
    :aptitude
    {:url "http://ppa.launchpad.net/zanchey/asciinema/ubuntu "
     :release "bionic"
     :scopes ["main"]
     :key-url "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x9D2E234C0F833EAD"})
  (actions/package-manager :update)
  (actions/packages :aptitude ["asciinema" "imagemagick" "gifsicle"])
  (actions/exec-checked-script
    "install asciicast2gif"

  (let [{:keys [version]} config]
    (actions/as-action
      (logging/info (str facility "-install system: install-nodejs")))
    (actions/packages :aptitude ["nodejs"])))

(s/defn
  init-yarn
  [facility :- s/Keyword]
  (actions/as-action
    (logging/info (str facility "-init system: init-yarn")))
  (actions/package-source "yarn"
    :aptitude
    {:url "https://dl.yarnpkg.com/debian/"
     :release "stable"
     :scopes ["main"]
     :key-url "https://dl.yarnpkg.com/debian/pubkey.gpg"}))

(s/defn
  install-yarn
