- Introductory video on Guix Home coming soon!
Check out this blog post about Guix:
Join us on the Fediverse! https://emacs.ch or https://fosstodon.org
Follow me: @email@example.com / https://fosstodon.org/@daviwil
- Support the channel! Buy Mastering Emacs with this link https://www.masteringemacs.org/r/systemcrafters
¶Hacking Guix Home Services in the REPL
Today I want to spend some time learning how to hack on Guix Home services in the Guile REPL so that I can build up a service without running
guix home container a bunch of times!
(use-modules (guix store)) (let* ((server (open-connection)) (path (add-text-to-store server "hello.txt" "Hello Guix!"))) (display "The store path is: ") (display path) (newline) (close-connection server))
(build-derivations store derivations [mode]): Builds a list of derivations against the given store
(define (sh-symlink) (gexp->derivation "sh" #~(symlink (string-append #$bash "/bin/bash") #$output))) (run-with-store (open-connection) (sh-symlink))
;; guix home -L ~/.dotfiles container test-config.scm (use-modules (gnu home) (gnu services) (daviwil home-services emacs)) (home-environment (services (list (service home-emacs-service-type (home-emacs-configuration (modules (home-emacs-module-configuration (module-name "dw-core") ;; (variables '(("dw-core-use-something" . #t))) )) (extra-init ";; Foo!"))))))
You can build a g-exp in the REPL by running the following command:
,build (scheme-file "test.scm" my-g-expr)