/
wsl-config.scm
113 lines (100 loc) · 3.54 KB
/
wsl-config.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
;(use-modules (oop goops))
;(add-to-load-path "/root/.guix-profile/share/guile/site/3.0/")
;(use-modules (ice-9 readline))
;(activate-readline)
(use-modules
(gnu)
(gnu system linux-container)
(gnu services shepherd)
(guix profiles)
(guix packages)
(srfi srfi-1))
(use-service-modules base ssh desktop dbus docker)
(use-package-modules screen vim certs bash)
(define dummy-networking-service-type
(shepherd-service-type
'dummy-networking
(const (shepherd-service
(documentation "Provide loopback and networking without actually
doing anything.")
(provision '(loopback networking))
(start #~(const #t))))
#f
(description "dummy networking")))
(define make-cgroup-fs
(lambda (name)
(file-system
(device "cgroup")
(mount-point (string-append "/sys/fs/cgroup/" name))
(type "cgroup")
(check? #f)
(options name)
(create-mount-point? #t)
(mount? #t))))
(define os
(operating-system
(host-name "scarpa")
(timezone "Europe/London")
(locale "en_US.utf8")
(locale-libcs (list glibc glibc-2.29 glibc-2.31))
(kernel hello) ; dummy package
(initrd (lambda* (. rest) (plain-file "dummyinitrd" "dummyinitrd")))
(initrd-modules '())
(firmware '())
(bootloader
(bootloader-configuration
(bootloader
(bootloader
(name 'dummybootloader)
(package hello)
(configuration-file "/dev/null")
(configuration-file-generator (lambda* (. rest) (computed-file "dummybootloader" #~(mkdir #$output))))
(installer #~(const #t))))))
(file-systems (append
(list (file-system
(device "/dev/sdb")
(mount-point "/")
(type "ext4")
(mount? #t))) ; saying #f here doesn't work :(
(map make-cgroup-fs ; more cgroups required by docker
(list "hugetlb" "misc" "net_cls" "net_prio" "rdma"))))
(users (cons (user-account
(name "giuliano")
(group "users")
(supplementary-groups '("wheel" "docker")))
%base-user-accounts))
(packages (append (list screen ; global packages to add
vim
nss-certs)
(remove
(lambda (x)
(member (package-name x)
(list "zile" ; global packages to not add
"nano"
"info-reader"
"pciutils"
"usbutils"
"util-linux-with-udev"
"kmod"
"eudev"
"isc-dhcp"
"iw"
"wireless-tools")))
%base-packages)))
(essential-services
(remove
(lambda (x)
(member (service-type-name (service-kind x))
(list 'firmware 'linux-bare-metal)))
(operating-system-default-essential-services this-operating-system)))
(services (list (service guix-service-type)
(service dummy-networking-service-type)
(syslog-service)
(service elogind-service-type)
(service dbus-root-service-type)
(service docker-service-type)
(service special-files-service-type
`(("/bin/sh" ,(file-append bash "/bin/sh"))
("/bin/bash" ,(file-append bash "/bin/bash"))
("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))))
os