system.scm

15c9036a40b9219c36ad390066072a202123ff15 · 7.0 KB · 162 lines raw

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 services authentication))
17 (use-modules (gnu packages shells))
18 (use-modules (srfi srfi-1))
19 (use-package-modules security-token)
20 (use-service-modules cups desktop networking ssh xorg sound security-token)
21
22 ; Re-define the base packages to remove sudo
23 (define %my-base-packages
24 (remove (lambda (package)
25 (member (package-name package)
26 (list "sudo" "nano")))
27 %base-packages ))
28
29 (define %backlight-udev-rule
30 (udev-rule
31 "90-backlight.rules"
32 (string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
33 "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\""
34 "\n"
35 "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
36 "RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\"")))
37
38 (operating-system
39 (kernel linux)
40 (firmware (list linux-firmware))
41 (locale "en_US.utf8")
42 (timezone "America/New_York")
43 (keyboard-layout (keyboard-layout "us"))
44 (host-name "RyanThinkpad")
45
46 ;; The list of user accounts ('root' is implicit).
47 (users (cons* (user-account
48 (name "ryan")
49 (comment "Ryan")
50 (group "users")
51 ;(shell (file-append zsh "/bin/zsh"))
52 (home-directory "/home/ryan")
53 (supplementary-groups '("wheel" "netdev" "audio" "video" "lp" "plugdev")))
54 %base-user-accounts))
55
56 ;; Packages installed system-wide. Users can also install packages
57 ;; under their own account: use 'guix search KEYWORD' to search
58 ;; for packages and 'guix install PACKAGE' to install a package.
59 (packages (append (map specification->package (list "sway"
60 "swaybg"
61 "swayidle"
62 "swaylock-effects"
63 "fuzzel"
64 "alacritty"
65 "pinentry-qt"
66 "adwaita-icon-theme"
67 "hicolor-icon-theme"
68 "git"
69 "nss-certs"
70 "waybar"
71 "gnupg"
72 "light"
73 "mako"
74 "grim"
75 "slurp"
76 "wl-clipboard"
77 "bluez"
78 "blueman"
79 "opendoas"
80 "xdg-desktop-portal-wlr"
81 "xdg-desktop-portal"
82 "pipewire"
83 "fprintd"
84 "wireplumber"
85 "zsh"))
86 %my-base-packages ))
87
88 ;; Below is the list of system services. To search for available
89 ;; services, run 'guix system search KEYWORD' in a terminal.
90 (services
91 (append (list
92
93 ;; To configure OpenSSH, pass an 'openssh-configuration'
94 ;; record as a second argument to 'service' below.
95 (service openssh-service-type)
96 (service pcscd-service-type)
97 (service fprintd-service-type)
98 (service bluetooth-service-type)
99 (udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))
100 (set-xorg-configuration
101 (xorg-configuration (keyboard-layout keyboard-layout))))
102
103 ;; This is the default list of services we
104 ;; are appending to.
105 (modify-services %desktop-services
106 (guix-service-type config =>
107 (guix-configuration
108 (inherit config)
109 (substitute-urls
110 (append (list "https://substitutes.nonguix.org")
111 %default-substitute-urls))
112 (authorized-keys
113 (cons* (plain-file "non-guix.pub"
114 "(public-key
115 (ecc
116 (curve Ed25519)
117 (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
118 )
119 )" ) %default-authorized-guix-keys))))
120 (udev-service-type config =>
121 (udev-configuration
122 (inherit config)
123 (rules (cons %backlight-udev-rule
124 (udev-configuration-rules config)))))
125 (delete pulseaudio-service-type)
126 (delete gdm-service-type) )))
127 (setuid-programs
128 (append (list (file-like->setuid-program
129 (file-append
130 (specification->package "swaylock-effects")
131 "/bin/swaylock"))
132 (file-like->setuid-program
133 (file-append
134 (specification->package "opendoas")
135 "/bin/doas")))
136 (delete sudo %setuid-programs)))
137 (bootloader (bootloader-configuration
138 (bootloader grub-efi-bootloader)
139 (targets (list "/boot/efi"))
140 (keyboard-layout keyboard-layout)))
141 (mapped-devices (list (mapped-device
142 (source (uuid
143 "adcaf322-7ee5-48ec-abf6-4a9b10643878"))
144 (target "sysroot")
145 (type luks-device-mapping))))
146
147 ;; The list of file systems that get "mounted". The unique
148 ;; file system identifiers there ("UUIDs") can be obtained
149 ;; by running 'blkid' in a terminal.
150 (file-systems (cons* (file-system
151 (mount-point "/")
152 (device "/dev/mapper/sysroot")
153 (type "ext4")
154 (dependencies mapped-devices))
155 (file-system
156 (mount-point "/boot/efi")
157 (device (uuid "DFE8-32EF"
158 'fat32))
159 (type "vfat")) %base-file-systems))
160 (swap-devices
161 (list
162 (swap-space (target (uuid "7e1bb7c5-da2a-4509-8263-f707fc752993"))) )))