system.scm

e7779b9f07b77b113550b82070825fa7f08d8f72 · 7.1 KB · 164 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 docker)
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" "docker")))
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 "docker"
85 "wireplumber"
86 "zsh"))
87 %my-base-packages ))
88
89 ;; Below is the list of system services. To search for available
90 ;; services, run 'guix system search KEYWORD' in a terminal.
91 (services
92 (append (list
93
94 ;; To configure OpenSSH, pass an 'openssh-configuration'
95 ;; record as a second argument to 'service' below.
96 (service openssh-service-type)
97 (service pcscd-service-type)
98 (service fprintd-service-type)
99 (service docker-service-type)
100 (service bluetooth-service-type)
101 (udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))
102 (set-xorg-configuration
103 (xorg-configuration (keyboard-layout keyboard-layout))))
104
105 ;; This is the default list of services we
106 ;; are appending to.
107 (modify-services %desktop-services
108 (guix-service-type config =>
109 (guix-configuration
110 (inherit config)
111 (substitute-urls
112 (append (list "https://substitutes.nonguix.org")
113 %default-substitute-urls))
114 (authorized-keys
115 (cons* (plain-file "non-guix.pub"
116 "(public-key
117 (ecc
118 (curve Ed25519)
119 (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
120 )
121 )" ) %default-authorized-guix-keys))))
122 (udev-service-type config =>
123 (udev-configuration
124 (inherit config)
125 (rules (cons %backlight-udev-rule
126 (udev-configuration-rules config)))))
127 (delete pulseaudio-service-type)
128 (delete gdm-service-type) )))
129 (setuid-programs
130 (append (list (file-like->setuid-program
131 (file-append
132 (specification->package "swaylock-effects")
133 "/bin/swaylock"))
134 (file-like->setuid-program
135 (file-append
136 (specification->package "opendoas")
137 "/bin/doas")))
138 (delete sudo %setuid-programs)))
139 (bootloader (bootloader-configuration
140 (bootloader grub-efi-bootloader)
141 (targets (list "/boot/efi"))
142 (keyboard-layout keyboard-layout)))
143 (mapped-devices (list (mapped-device
144 (source (uuid
145 "adcaf322-7ee5-48ec-abf6-4a9b10643878"))
146 (target "sysroot")
147 (type luks-device-mapping))))
148
149 ;; The list of file systems that get "mounted". The unique
150 ;; file system identifiers there ("UUIDs") can be obtained
151 ;; by running 'blkid' in a terminal.
152 (file-systems (cons* (file-system
153 (mount-point "/")
154 (device "/dev/mapper/sysroot")
155 (type "ext4")
156 (dependencies mapped-devices))
157 (file-system
158 (mount-point "/boot/efi")
159 (device (uuid "DFE8-32EF"
160 'fat32))
161 (type "vfat")) %base-file-systems))
162 (swap-devices
163 (list
164 (swap-space (target (uuid "7e1bb7c5-da2a-4509-8263-f707fc752993"))) )))