update Makefile targets.
Convert vps-system.scm and vps-home.scm from plain Guile
scripts to proper modules with #:export. Update Makefile
build targets to use -L and -e syntax. Set dak shell to
bash and add sudoers entry.
Co-Authored-By: Claude <noreply@anthropic.com>
sudo GUIX_PACKAGE_PATH=`pwd` PROFILE=libre guix system reconfigure system.scm
vps-home:
- GUIX_PACKAGE_PATH=`pwd` guix home reconfigure vps-home.scm
+ GUIX_PACKAGE_PATH=`pwd` guix home reconfigure \
+ -L `pwd` -e '(@ (vps-home) vps-home-environment)'
. $(guix-profile)/etc/profile
vps-system:
- sudo GUIX_PACKAGE_PATH=`pwd` guix system reconfigure vps-system.scm
+ sudo GUIX_PACKAGE_PATH=`pwd` guix system reconfigure \
+ -L `pwd` -e '(@ (vps-system) vps-operating-system)'
# Build-only targets — validate configuration without activating.
guix system build system.scm
build-vps-system:
- GUIX_PACKAGE_PATH=`pwd` guix system build vps-system.scm
+ GUIX_PACKAGE_PATH=`pwd` guix system build \
+ -L `pwd` -e '(@ (vps-system) vps-operating-system)'
build-vps-home:
- GUIX_PACKAGE_PATH=`pwd` guix home build vps-home.scm
+ GUIX_PACKAGE_PATH=`pwd` guix home build \
+ -L `pwd` -e '(@ (vps-home) vps-home-environment)'
build-vps: build-vps-system build-vps-home
;;;
;;; VPS home directory configuration.
-(use-modules (gnu home)
- (gnu home services)
- (gnu services)
- (gnu system shadow)
- (conf home paseo)
- (conf home claude))
+(define-module (vps-home)
+ #:use-module (gnu home)
+ #:use-module (gnu home services)
+ #:use-module (gnu services)
+ #:use-module (gnu system shadow)
+ #:use-module (conf home paseo)
+ #:use-module (conf home claude)
+ #:export (vps-home-environment))
-(home-environment
- (packages (list claude-code paseo))
- (services
- (append (list paseo-daemon-service
+(define vps-home-environment
+ (home-environment
+ (packages (list claude-code paseo))
+ (services
+ (append (list paseo-daemon-service
- ;; Uncomment the shell you wish to use for your user:
- ;; (service home-bash-service-type)
- ;; (service home-fish-service-type)
- ;; (service home-zsh-service-type)
+ ;; Uncomment the shell you wish to use for your user:
+ ;; (service home-bash-service-type)
+ ;; (service home-fish-service-type)
+ ;; (service home-zsh-service-type)
+
+ (service home-files-service-type
+ `((".guile" ,%default-dotguile)
+ (".Xdefaults" ,%default-xdefaults)))
- (service home-files-service-type
- `((".guile" ,%default-dotguile)
- (".Xdefaults" ,%default-xdefaults)))
+ (service home-xdg-configuration-files-service-type
+ `(("gdb/gdbinit" ,%default-gdbinit)
+ ("nano/nanorc" ,%default-nanorc))))
- (service home-xdg-configuration-files-service-type
- `(("gdb/gdbinit" ,%default-gdbinit)
- ("nano/nanorc" ,%default-nanorc))))
+ %base-home-services))))
- %base-home-services)))
+vps-home-environment
;;; Usage:
;;; guix system image --image-type=mbr-raw vps-system.scm
-(use-modules (gnu)
- (nongnu packages linux)
- (conf vps sshd))
-
-(use-service-modules networking)
-
-(operating-system
- (host-name "vps")
- (kernel linux)
- (timezone "Etc/UTC")
- (locale "en_US.utf8")
-
- ;; ── OVH-specific (permanent -- the hardware requires these) ──
-
- (bootloader (bootloader-configuration
- (bootloader grub-bootloader)
- (targets '("/dev/sda"))))
-
- (kernel-arguments (list "console=ttyS0 console=tty0"))
-
- ;; ── Filesystems ──
-
- (file-systems (cons (file-system
- (device (uuid "38af4c98-d0f5-96b6-2fa6-251038af4c98"))
- (mount-point "/")
- (type "ext4")) %base-file-systems))
-
- ;; ── Users ──
-
- (users (cons (user-account
- (name "dak")
- (group "users")
- (supplementary-groups '("wheel"))
- (home-directory "/home/dak")) %base-user-accounts))
-
- ;; ── Services ──
-
- (services
- (append (list
- ;; DHCP
- (service dhcpcd-service-type)
-
- %ssh-service
-
- ;; NTP
- (service ntp-service-type))
-
- %base-services))
-
- ;; ── Sudoers: dak can reconfigure without a password ──
-
- (sudoers-file (plain-file "sudoers"
- (string-append (plain-file-content
- %sudoers-specification)
- "dak ALL = NOPASSWD: ALL\n"))))
+(define-module (vps-system)
+ #:use-module (gnu)
+ #:use-module (gnu packages admin)
+ #:use-module (gnu packages bash)
+ #:use-module (nongnu packages linux)
+ #:use-module (conf vps sshd)
+ #:export (vps-operating-system))
+
+(use-service-modules networking shepherd)
+
+(define vps-operating-system
+ (operating-system
+ (host-name "vps")
+ (kernel linux)
+ (timezone "Etc/UTC")
+ (locale "en_US.utf8")
+
+ ;; OVH-specific (permanent -- the hardware requires these)
+
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (targets '("/dev/sda"))))
+
+ (kernel-arguments (list "console=ttyS0 console=tty0"))
+
+ ;; Filesystems
+
+ (file-systems (cons (file-system
+ (device (uuid "38af4c98-d0f5-96b6-2fa6-251038af4c98"))
+ (mount-point "/")
+ (type "ext4")) %base-file-systems))
+
+ ;; Users
+
+ (users (cons* (user-account
+ (name "dak")
+ (group "users")
+ (supplementary-groups '("wheel"))
+ (home-directory "/home/dak")
+ (shell (file-append bash "/bin/bash")))
+ %base-user-accounts))
+
+ ;; Services
+
+ (services
+ (append (list
+ ;; DHCP — OVH delivers the static IP via DHCP
+ (service dhcpcd-service-type)
+
+ %ssh-service
+
+ ;; NTP — correct time is required for Guix substitutes
+ (service ntp-service-type)) %base-services))
+
+ ;; Sudoers: dak can reconfigure without a password
+
+ (sudoers-file (plain-file "sudoers"
+ (string-append (plain-file-content
+ %sudoers-specification)
+ "dak ALL = NOPASSWD: ALL\n")))))
+
+vps-operating-system