diff options
-rw-r--r-- | system.scm | 219 | ||||
-rw-r--r-- | thinkpad.scm | 23 |
2 files changed, 23 insertions, 219 deletions
diff --git a/system.scm b/system.scm deleted file mode 100644 index e487e71..0000000 --- a/system.scm +++ /dev/null | |||
@@ -1,219 +0,0 @@ | |||
1 | ;; This is an operating system configuration generated | ||
2 | ;; by the graphical installer. | ||
3 | ;; | ||
4 | ;; Once installation is complete, you can learn and modify | ||
5 | ;; this file to tweak the system configuration, and pass it | ||
6 | ;; to the 'guix system reconfigure' command to effect your | ||
7 | ;; changes. | ||
8 | |||
9 | |||
10 | ;; Indicate which modules to import to access the variables | ||
11 | ;; used in this configuration. | ||
12 | (use-modules (gnu) (nongnu packages linux)) | ||
13 | (use-modules (gnu system setuid)) | ||
14 | (use-modules (gnu packages admin)) | ||
15 | (use-modules (guix packages)) | ||
16 | (use-modules (gnu packages shells)) | ||
17 | (use-modules (guix build-system trivial)) | ||
18 | (use-modules (guix licenses)) | ||
19 | (use-modules (gnu packages tls)) | ||
20 | (use-modules (srfi srfi-1)) | ||
21 | (use-modules (ryan-packages freedesktop)) | ||
22 | (use-modules (ryan-packages wm)) | ||
23 | (use-package-modules security-token) | ||
24 | (use-service-modules cups desktop networking xorg ssh nix sound security-token docker virtualization) | ||
25 | |||
26 | ; Define package that installs my root ca public keys | ||
27 | (define my-ca-certs | ||
28 | (package | ||
29 | (name "my-ca-certs") | ||
30 | (version "1") | ||
31 | (source (local-file "./CACerts" | ||
32 | #:recursive? #t)) | ||
33 | (build-system trivial-build-system) | ||
34 | (license mpl2.0) | ||
35 | (home-page "https://rschanz.org") | ||
36 | (arguments | ||
37 | `(#:modules | ||
38 | ((guix build utils)) | ||
39 | #:builder | ||
40 | (begin | ||
41 | (use-modules (guix build utils) | ||
42 | (srfi srfi-1) | ||
43 | (srfi srfi-26) | ||
44 | (ice-9 ftw)) | ||
45 | (let* ((ca-certificates (assoc-ref %build-inputs "source")) | ||
46 | (crt-suffix ".crt") | ||
47 | (is-certificate? (cut string-suffix? crt-suffix <>)) | ||
48 | (certificates (filter is-certificate? | ||
49 | (scandir ca-certificates))) | ||
50 | (out (assoc-ref %outputs "out")) | ||
51 | (certificate-directory (string-append out "/etc/ssl/certs")) | ||
52 | (openssl (string-append (assoc-ref %build-inputs "openssl") "/bin/openssl"))) | ||
53 | (mkdir-p certificate-directory) | ||
54 | (for-each | ||
55 | (lambda (cert) | ||
56 | (invoke | ||
57 | openssl "x509" | ||
58 | "-in" (string-append ca-certificates "/" cert) | ||
59 | "-outform" "PEM" | ||
60 | "-out" (string-append certificate-directory "/" cert ".pem"))) | ||
61 | certificates) | ||
62 | #t)))) | ||
63 | (native-inputs | ||
64 | (list openssl)) | ||
65 | (synopsis "My CA Certs") | ||
66 | (description synopsis))) | ||
67 | |||
68 | ; Re-define the base packages to remove sudo | ||
69 | (define %my-base-packages | ||
70 | (remove (lambda (package) | ||
71 | (member (package-name package) | ||
72 | (list "sudo" "nano"))) | ||
73 | %base-packages )) | ||
74 | |||
75 | (define %backlight-udev-rule | ||
76 | (udev-rule | ||
77 | "90-backlight.rules" | ||
78 | (string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", " | ||
79 | "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\"" | ||
80 | "\n" | ||
81 | "ACTION==\"add\", SUBSYSTEM==\"backlight\", " | ||
82 | "RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\""))) | ||
83 | |||
84 | (operating-system | ||
85 | (kernel linux) | ||
86 | (firmware (list linux-firmware)) | ||
87 | (locale "en_US.utf8") | ||
88 | (timezone "America/New_York") | ||
89 | (keyboard-layout (keyboard-layout "us")) | ||
90 | (host-name "RyanThinkpad") | ||
91 | |||
92 | ;; The list of user accounts ('root' is implicit). | ||
93 | (users (cons* (user-account | ||
94 | (name "ryan") | ||
95 | (comment "Ryan") | ||
96 | (group "users") | ||
97 | ;(shell (file-append zsh "/bin/zsh")) | ||
98 | (home-directory "/home/ryan") | ||
99 | (supplementary-groups '("wheel" "netdev" "audio" "video" "lp" "plugdev" "docker" "libvirt" "kvm"))) | ||
100 | %base-user-accounts)) | ||
101 | |||
102 | ;; Packages installed system-wide. Users can also install packages | ||
103 | ;; under their own account: use 'guix search KEYWORD' to search | ||
104 | ;; for packages and 'guix install PACKAGE' to install a package. | ||
105 | (packages (append (map specification->package (list "sway" | ||
106 | "swaybg" | ||
107 | "swayidle" | ||
108 | ;"swaylock-effects" | ||
109 | "fuzzel" | ||
110 | "alacritty" | ||
111 | "pinentry-qt" | ||
112 | "adwaita-icon-theme" | ||
113 | "hicolor-icon-theme" | ||
114 | "git" | ||
115 | "nss-certs" | ||
116 | "waybar" | ||
117 | "gnupg" | ||
118 | "light" | ||
119 | "mako" | ||
120 | "grim" | ||
121 | "slurp" | ||
122 | "wl-clipboard" | ||
123 | "bluez" | ||
124 | "blueman" | ||
125 | "ldacbt" | ||
126 | "libfreeaptx" | ||
127 | "libfdk" | ||
128 | "opendoas" | ||
129 | ;"xdg-desktop-portal-wlr" | ||
130 | "xdg-desktop-portal" | ||
131 | "pipewire" | ||
132 | "docker" | ||
133 | "libvirt" | ||
134 | "virt-manager" | ||
135 | "wireplumber" | ||
136 | "zsh")) | ||
137 | (list my-ca-certs xdg-desktop-portal-wlr-new swaylock-effects-new) | ||
138 | %my-base-packages )) | ||
139 | |||
140 | ;; Below is the list of system services. To search for available | ||
141 | ;; services, run 'guix system search KEYWORD' in a terminal. | ||
142 | (services | ||
143 | (append (list | ||
144 | |||
145 | ;; To configure OpenSSH, pass an 'openssh-configuration' | ||
146 | ;; record as a second argument to 'service' below. | ||
147 | (service openssh-service-type) | ||
148 | (service pcscd-service-type) | ||
149 | (service docker-service-type) | ||
150 | (service nix-service-type) | ||
151 | (service libvirt-service-type | ||
152 | (libvirt-configuration | ||
153 | (unix-sock-group "libvirt"))) | ||
154 | (service bluetooth-service-type) | ||
155 | (udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))) | ||
156 | |||
157 | ;; This is the default list of services we | ||
158 | ;; are appending to. | ||
159 | (modify-services %desktop-services | ||
160 | (guix-service-type config => | ||
161 | (guix-configuration | ||
162 | (inherit config) | ||
163 | (substitute-urls | ||
164 | (append (list "https://substitutes.nonguix.org") | ||
165 | %default-substitute-urls)) | ||
166 | (authorized-keys | ||
167 | (cons* (plain-file "non-guix.pub" | ||
168 | "(public-key | ||
169 | (ecc | ||
170 | (curve Ed25519) | ||
171 | (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#) | ||
172 | ) | ||
173 | )" ) %default-authorized-guix-keys)))) | ||
174 | (udev-service-type config => | ||
175 | (udev-configuration | ||
176 | (inherit config) | ||
177 | (rules (cons %backlight-udev-rule | ||
178 | (udev-configuration-rules config))))) | ||
179 | (delete pulseaudio-service-type) | ||
180 | (delete gdm-service-type) | ||
181 | (delete xorg-server-service-type) | ||
182 | (delete alsa-service-type) ))) | ||
183 | (setuid-programs | ||
184 | (append (list (file-like->setuid-program | ||
185 | (file-append | ||
186 | ;(specification->package "swaylock-effects") | ||
187 | swaylock-effects-new | ||
188 | "/bin/swaylock")) | ||
189 | (file-like->setuid-program | ||
190 | (file-append | ||
191 | (specification->package "opendoas") | ||
192 | "/bin/doas"))) | ||
193 | (delete sudo %setuid-programs))) | ||
194 | (bootloader (bootloader-configuration | ||
195 | (bootloader grub-efi-bootloader) | ||
196 | (targets (list "/boot/efi")) | ||
197 | (keyboard-layout keyboard-layout))) | ||
198 | (mapped-devices (list (mapped-device | ||
199 | (source (uuid | ||
200 | "adcaf322-7ee5-48ec-abf6-4a9b10643878")) | ||
201 | (target "sysroot") | ||
202 | (type luks-device-mapping)))) | ||
203 | |||
204 | ;; The list of file systems that get "mounted". The unique | ||
205 | ;; file system identifiers there ("UUIDs") can be obtained | ||
206 | ;; by running 'blkid' in a terminal. | ||
207 | (file-systems (cons* (file-system | ||
208 | (mount-point "/") | ||
209 | (device "/dev/mapper/sysroot") | ||
210 | (type "ext4") | ||
211 | (dependencies mapped-devices)) | ||
212 | (file-system | ||
213 | (mount-point "/boot/efi") | ||
214 | (device (uuid "DFE8-32EF" | ||
215 | 'fat32)) | ||
216 | (type "vfat")) %base-file-systems)) | ||
217 | (swap-devices | ||
218 | (list | ||
219 | (swap-space (target (uuid "7e1bb7c5-da2a-4509-8263-f707fc752993"))) ))) | ||
diff --git a/thinkpad.scm b/thinkpad.scm new file mode 100644 index 0000000..a15bc66 --- /dev/null +++ b/thinkpad.scm | |||
@@ -0,0 +1,23 @@ | |||
1 | (use-modules (ryan-config base-system)) | ||
2 | |||
3 | (operating-system | ||
4 | (inherit base-operating-system) | ||
5 | (host-name "RyanThinkpad") | ||
6 | (mapped-devices (list (mapped-device | ||
7 | (source (uuid | ||
8 | "adcaf322-7ee5-48ec-abf6-4a9b10643878")) | ||
9 | (target "sysroot") | ||
10 | (type luks-device-mapping)))) | ||
11 | (file-systems (cons* (file-system | ||
12 | (mount-point "/") | ||
13 | (device "/dev/mapper/sysroot") | ||
14 | (type "ext4") | ||
15 | (dependencies mapped-devices)) | ||
16 | (file-system | ||
17 | (mount-point "/boot/efi") | ||
18 | (device (uuid "DFE8-32EF" | ||
19 | 'fat32)) | ||
20 | (type "vfat")) %base-file-systems)) | ||
21 | (swap-devices | ||
22 | (list | ||
23 | (swap-space (target (uuid "7e1bb7c5-da2a-4509-8263-f707fc752993")))))) | ||