Commit | Line | Data |
---|---|---|
538b99f3 LC |
1 | ;; This is an operating system configuration for a VM image. |
2 | ;; Modify it as you see fit and instantiate the changes by running: | |
3 | ;; | |
4 | ;; guix system reconfigure /etc/config.scm | |
5 | ;; | |
4b236c88 | 6 | |
4c13ccbf | 7 | (use-modules (gnu) (guix) (srfi srfi-1)) |
ea2acfe9 | 8 | (use-service-modules desktop networking ssh xorg) |
4c13ccbf LC |
9 | (use-package-modules bootloaders certs fonts nvi |
10 | package-management wget xorg) | |
4b236c88 LF |
11 | |
12 | (define vm-image-motd (plain-file "motd" " | |
538b99f3 | 13 | \x1b[1;37mThis is the GNU system. Welcome!\x1b[0m |
4b236c88 | 14 | |
538b99f3 LC |
15 | This instance of Guix is a template for virtualized environments. |
16 | You can reconfigure the whole system by adjusting /etc/config.scm | |
17 | and running: | |
4b236c88 | 18 | |
538b99f3 LC |
19 | guix system reconfigure /etc/config.scm |
20 | ||
ff587e0f LC |
21 | Run '\x1b[1;37minfo guix\x1b[0m' to browse documentation. |
22 | ||
538b99f3 LC |
23 | \x1b[1;33mConsider setting a password for the 'root' and 'guest' \ |
24 | accounts.\x1b[0m | |
25 | ")) | |
26 | ||
4b236c88 LF |
27 | (operating-system |
28 | (host-name "gnu") | |
29 | (timezone "Etc/UTC") | |
30 | (locale "en_US.utf8") | |
538b99f3 | 31 | (keyboard-layout (keyboard-layout "us" "altgr-intl")) |
4b236c88 | 32 | |
4c13ccbf LC |
33 | ;; Label for the GRUB boot menu. |
34 | (label (string-append "GNU Guix " (package-version guix))) | |
35 | ||
907dd327 | 36 | (firmware '()) |
3c515b22 | 37 | |
538b99f3 LC |
38 | ;; Below we assume /dev/vda is the VM's hard disk. |
39 | ;; Adjust as needed. | |
fdfdecdb TGR |
40 | (bootloader (bootloader-configuration |
41 | (bootloader grub-bootloader) | |
538b99f3 | 42 | (target "/dev/vda") |
fdfdecdb | 43 | (terminal-outputs '(console)))) |
4b236c88 | 44 | (file-systems (cons (file-system |
4b236c88 | 45 | (mount-point "/") |
538b99f3 | 46 | (device "/dev/vda1") |
4b236c88 LF |
47 | (type "ext4")) |
48 | %base-file-systems)) | |
49 | ||
538b99f3 LC |
50 | (users (cons (user-account |
51 | (name "guest") | |
52 | (comment "GNU Guix Live") | |
53 | (password "") ;no password | |
54 | (group "users") | |
55 | (supplementary-groups '("wheel" "netdev" | |
56 | "audio" "video"))) | |
57 | %base-user-accounts)) | |
58 | ||
6e0521ee LC |
59 | ;; Our /etc/sudoers file. Since 'guest' initially has an empty password, |
60 | ;; allow for password-less sudo. | |
61 | (sudoers-file (plain-file "sudoers" "\ | |
62 | root ALL=(ALL) ALL | |
63 | %wheel ALL=NOPASSWD: ALL\n")) | |
64 | ||
a4ae05fb | 65 | (packages (append (list font-bitstream-vera nss-certs nvi wget) |
5df29aad | 66 | %base-packages)) |
538b99f3 LC |
67 | |
68 | (services | |
69 | (append (list (service xfce-desktop-service-type) | |
70 | ||
538b99f3 LC |
71 | ;; Choose SLiM, which is lighter than the default GDM. |
72 | (service slim-service-type | |
73 | (slim-configuration | |
74 | (auto-login? #t) | |
75 | (default-user "guest") | |
76 | (xorg-configuration | |
77 | (xorg-configuration | |
d7b05620 | 78 | (keyboard-layout keyboard-layout))))) |
538b99f3 | 79 | |
ea2acfe9 LC |
80 | ;; Uncomment the line below to add an SSH server. |
81 | ;;(service openssh-service-type) | |
82 | ||
d7b05620 LC |
83 | ;; Use the DHCP client service rather than NetworkManager. |
84 | (service dhcp-client-service-type)) | |
85 | ||
9c64080d LC |
86 | ;; Remove GDM, ModemManager, NetworkManager, and wpa-supplicant, |
87 | ;; which don't make sense in a VM. | |
538b99f3 | 88 | (remove (lambda (service) |
d7b05620 | 89 | (let ((type (service-kind service))) |
fc068092 LC |
90 | (or (memq type |
91 | (list gdm-service-type | |
92 | wpa-supplicant-service-type | |
93 | cups-pk-helper-service-type | |
9c64080d LC |
94 | network-manager-service-type |
95 | modem-manager-service-type)) | |
fc068092 LC |
96 | (eq? 'network-manager-applet |
97 | (service-type-name type))))) | |
538b99f3 LC |
98 | (modify-services %desktop-services |
99 | (login-service-type config => | |
100 | (login-configuration | |
101 | (inherit config) | |
102 | (motd vm-image-motd))))))) | |
103 | ||
104 | ;; Allow resolution of '.local' host names with mDNS. | |
105 | (name-service-switch %mdns-host-lookup-nss)) |