msg-cli/README.org
2025-03-16 11:23:47 -06:00

112 lines
4.5 KiB
Org Mode

# -*- mode: org; coding: utf-8; -*-
#+TITLE: MacOS Subsystem for Guix
* Overview
MSG is an attempt to create a native-like experience for Guix on MacOS, using methods inspired by others like Podman/Docker/Lima. It uses Qemu with a prebuilt installer image to create a customized local Guix instance (supported on Intel and Apple Silicon based Macs). The base image is pretty barebones and is meant to be customized to your liking. To get a good idea of whats included you can reference the /etc/config.scm file within the built image.
* F.A.Q
- Q: Why does the cli generate the image locally instead of downloading a complete pre-built image like Podman?
- A: This is due to the final image requiring the admin account to be setup with the same UID as the host MacOS user. Podman accomplishes this by passing configuration values in it's ignition file, which are used to initialize the CoreOS image with the correct values on it's first run. Guix doesn't currently support a similar initialization method, so the image must be regenerated after the config has been updated with the correct values (UID, etc...). This is unlikely to change in the near future, unless Guix ends up adding some sort of similar functionality.
- Q: What are the long term goals of this project?
- A: I would like for this project to accomplish a few goals.
1. Be able to fully replace docker/podman desktop on MacOS
2. Give users a way to manage their MacOS dotfiles using Guix Home
3. Improve GUI application performance with X11/Xquartz
4. Introduce a MSG Desktop GUI to accompany the cli
* Installation
** Install from Homebrew Tap
*** Add MSG Tap and Install
1. Add the main MSG homebrew tap
#+begin_src sh
brew tap MSG/apps https://forge.superkamiguru.org/MSG/homebrew-apps
#+end_src
2. Install msg-cli
#+begin_src sh
brew install msg-cli
#+end_src
3. Make sure the homebrew guile paths are set from adding aconchillo's guile-next version (see above)
** Building From Source
*** Requirements
- wget
- qemu
- autotools
- guile-next
- texinfo
These can be installed by running:
#+begin_src sh
brew install autoconf automake libtool wget qemu texinfo msg/apps/guile-next
#+end_src
1. First clone this repository with:
#+begin_src sh
git clone https://forge.superkamiguru.org/MSG/msg-cli.git
cd msg-cli
#+end_src
2. Build and install the cli using:
#+begin_src sh
autoreconf -vif && ./configure && make && sudo make install
#+end_src
3. Make sure to add the correct env vars set for guile-next/msg.
#+begin_src sh
export GUILE_LOAD_PATH=/opt/homebrew/share/guile/site/3.0
export GUILE_LOAD_COMPILED_PATH=/opt/homebrew/lib/guile/3.0/site-ccache
export GUILE_SYSTEM_EXTENSIONS_PATH=/opt/homebrew/lib/guile/3.0/extensions
export GUILE_LOAD_PATH=$GUILE_LOAD_PATH:/usr/local/share/guile/site/3.0/
export GUILE_LOAD_COMPILED_PATH=$GUILE_LOAD_COMPILED_PATH:/usr/local/lib/guile/3.0/site-ccache/
export GUILE_SYSTEM_EXTENSIONS_PATH=$GUILE_SYSTEM_EXTENSIONS_PATH:/usr/local/lib/guile/3.0/extensions
export PATH=/usr/local/bin:$PATH
#+end_src
* Contributing
- To work on the package itself, you will want to also make sure that you install guile-hall and guile-config from the msg homebrew tap
#+begin_src sh
brew install msg/apps/guile-hall
#+end_src
- The first recommended thing to do when beginning work on msg-cli is to clean the directory using hall
#+begin_src sh
hall clean -x
#+end_src
- This will make sure that all the build files for distribution are cleaned. Also new files must be scanned in using hall before building, and we want to avoid scanning in generated build files
- Adding a new file
- After cleaning the build structure, you can add in the new files you would like and run the following:
#+begin_src sh
hall scan -x
#+end_src
- Once you would like to test the application you can generate the build files using:
#+begin_src sh
hall build -xf
#+end_src
- And then install with the autotools dance
#+begin_src sh
autoreconf -vif && ./configure && make && sudo make install
#+end_src
- Make sure to avoid scanning in any autogenerated/build files. Also be sure to run halls clean command before you add a new file, and clean/rebuild the makefiles before pushing to the repo.
* Usage
- msg machine (command)
- init: initializes a new MSG instance
- reinit: reinitializes an MSG instance (is destructive!)
- start: starts the initialized MSG instance
- stop: stops the running instance
- msg shell
- Creates an ssh connection to the running instance