arroyo/arroyo-nixos.org

3.1 KiB
Raw Permalink Blame History

Arroyo NixOS Generator

Arroyo can manage any number of NixOS hosts, though right now it seeks to only manage systems which are "endpoints" a place the user may want to deploy their Arroyo configuration to.

Server and cluster management will be explored at some point in the future, but for now this is designed to build laptops and desktops which can be given a bare-bones NixOS install through my NixOS Automatic Partitioning Installer and attached to the same network as a machine running Arroyo or capable of running Morph on a set of Arroyo tangled files.

Calling in to the Arcology to generate My NixOS Configuration

I'll move this code here someday, for now we call it with a nix run. good luck making this work for yourself! you could replace the path: and it might just work.

(defun arroyo-nixos-imports (&optional role)
  (arroyo-generate-imports "nixos" role nil t))

Arroyo NixOS manages systems with Morph:

It goes in to Arroyo Home Manager but can be installed from GitHub to bootstrap the system if necessary.

{ pkgs, ... }:
{
  home.packages = [ pkgs.morph ];
}

NEXT why isn't this on the Morph page..?

Flooding the Arroyo tangles and deploys all sub-systems

arroyo-flood is an interactive command which stitches together the arroyo system and runs the morph command which deploys the system:

Click here to flood the Arroyo.

(defun arroyo-nixos-full-spread (host &optional local-only switch-action)
  "Flood the arroyo. Tangle all related files and run morph deploy.
DEP-FILE is a string pointing to a Morph network definition.
SWITCH-ACTION is one of the actions which morph deploy expects. Read its docs."
  (interactive (list (->> (shell-command-to-string "deploy-targets")
                          (s-split "\n")
                          (append '("--all"))
                          (completing-read "Which host do you want to deploy to? "))))
  (let ((switch-action (or switch-action "switch")))
    ;; expand this to include CCE_NIXOS keywords eventually
    (org-babel-tangle-file (expand-file-name "cce/home-manager.org" org-roam-directory))
    (org-babel-tangle-file (expand-file-name "arroyo/arroyo-emacs.org" org-roam-directory))
    (arroyo-emacs-generate-init)
    (async-shell-command (format "deploy -a %s %s" switch-action host)
                         "*nix-deploy*")))

(defalias 'arroyo-flood 'arroyo-nixos-full-spread)
(provide 'arroyo-nixos)