Guest User

Untitled

a guest
Oct 23rd, 2024
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.14 KB | None | 0 0
  1. ;; Indicate which modules to import to access the variables
  2. ;; used in this configuration.
  3. (define-module (config systems base-system)
  4. #:use-module (gnu)
  5. #:use-module (gnu services)
  6. #:use-module (gnu services audio)
  7. #:use-module (gnu services dbus)
  8. #:use-module (gnu services desktop)
  9. #:use-module (gnu services databases)
  10. #:use-module (gnu packages lisp)
  11. #:use-module (gnu system)
  12. #:use-module (gnu system nss)
  13. #:use-module (gnu system pam)
  14. #:use-module (guix)
  15. #:use-module (rnrs lists)
  16. #:use-module (ice-9 popen)
  17. #:use-module (ice-9 rdelim)
  18. #:use-module (ice-9 format)
  19. #:use-module (nongnu packages linux)
  20. #:use-module (nongnu system linux-initrd)
  21. #:use-module (rosenthal packages wm)
  22. #:export (base-system))
  23.  
  24. (use-service-modules admin dbus desktop networking docker ssh xorg mcron cups sysctl virtualization sound authentication nix)
  25.  
  26. (use-package-modules admin android base bash bootloaders ccache certs compression cross-base cups databases emacs emacs-xyz firmware fonts gawk geo ghostscript gnome gnupg guile guile-xyz hurd less linux text-editors man nvi ntp pciutils python python-xyz ratpoison scanner screen ssh suckless texinfo tex version-control vim wget wm xfce xorg gnuzilla package-management)
  27.  
  28. (define base-system
  29. (operating-system
  30. (kernel linux)
  31. (initrd microcode-initrd)
  32. (firmware (list linux-firmware))
  33. (locale "pt_BR.utf8")
  34. (timezone "America/Sao_Paulo")
  35. (keyboard-layout (keyboard-layout "br"))
  36. (host-name "felux")
  37.  
  38. ;; Use the UEFI variant of GRUB with the EFI System
  39. ;; Partition mounted on /boot/efi.
  40. (bootloader (bootloader-configuration
  41. (bootloader grub-efi-bootloader)
  42. (targets (list "/boot/efi"))
  43. (keyboard-layout keyboard-layout))) ;; for grub
  44.  
  45. (swap-devices (list (swap-space
  46. (target (uuid
  47. "xxx")))))
  48.  
  49. (mapped-devices (list (mapped-device
  50. (source (uuid
  51. "xxx"))
  52. (target "guix")
  53. (type luks-device-mapping))))
  54.  
  55. ;; The list of file systems that get "mounted". The unique
  56. ;; file system identifiers there ("UUIDs") can be obtained
  57. ;; by running 'blkid' in a terminal.
  58. (file-systems (cons* (file-system
  59. (mount-point "/")
  60. (device "/dev/mapper/guix")
  61. (type "ext4")
  62. (dependencies mapped-devices))
  63. (file-system
  64. (mount-point "/boot/efi")
  65. (device (uuid "xxx"
  66. 'fat32))
  67. (type "vfat")) %base-file-systems))
  68.  
  69.  
  70. ;; The list of user accounts ('root' is implicit).
  71. (users (cons* (user-account
  72. (name "felux")
  73. (comment "xxx")
  74. (group "users")
  75. (home-directory "/home/felux")
  76. (supplementary-groups '("wheel" "netdev" "audio" "video" "docker")))
  77. %base-user-accounts))
  78.  
  79. ;; Packages installed system-wide. Users can also install packages
  80. ;; under their own account: use 'guix search KEYWORD' to search
  81. ;; for packages and 'guix install PACKAGE' to install a package.
  82. (packages (append (list (specification->package "emacs")
  83. (specification->package "emacs-exwm")
  84. (specification->package
  85. "emacs-desktop-environment")
  86. awesome
  87. hyprland
  88. nix sbcl stumpwm)
  89. ;; guix-icons procps psmisc which shadow e2fsprogs guile-3.0-latest bash coreutils findutils grep sed diffutils patch gawk tar gzip bzip2 xz lzip pciutils usbutils util-linux+udev kmod eudev less mg nano nvi info-reader bash-completion kbd sudo guile-readline guile-colorized inetutils isc-dhcp iproute wget nss-certs iw wireless-tools
  90. %base-packages))
  91.  
  92.  
  93. ;; Setup services
  94. (services (append
  95. (list
  96. ;; Set up my home configuration
  97. (service guix-home-service-type
  98. `(("felux" ,home)))
  99.  
  100. ;; Seat management (can't use seatd because Wireplumber depends on elogind)
  101. (service elogind-service-type)
  102.  
  103. ;; Set up Polkit to allow `wheel' users to run admin tasks
  104. polkit-wheel-service
  105.  
  106. (service gnome-desktop-service-type)
  107. (service openssh-service-type)
  108.  
  109. (service containerd-service-type)
  110. (service docker-service-type)
  111.  
  112. ;; Networking services
  113. (service network-manager-service-type)
  114. (service wpa-supplicant-service-type) ;; Needed by NetworkManager
  115. (service modem-manager-service-type) ;; For cellular modems
  116. (service bluetooth-service-type
  117. (bluetooth-configuration
  118. (auto-enable? #t)))
  119. (service usb-modeswitch-service-type)
  120.  
  121. ;; Basic desktop system services (copied from %desktop-services)
  122. (service avahi-service-type)
  123. (service udisks-service-type)
  124. (service upower-service-type)
  125. (service cups-pk-helper-service-type)
  126. (service geoclue-service-type)
  127. (service polkit-service-type)
  128. (service dbus-root-service-type)
  129. fontconfig-file-system-service ;; Manage the fontconfig cache
  130.  
  131. ;; Adiciona o serviço MPD
  132. (service mpd-service-type
  133. (mpd-configuration
  134. (music-directory "~/Music")
  135. (state-file "~/.config/mpd/mpd.state")
  136. (playlist-directory "~/.config/mpd/playlists")
  137. (log-file "/var/log/mpd.log")
  138. (default-port 6600)))
  139.  
  140. (service nix-service-type)
  141.  
  142. ;; (service mcron-service-type
  143. ;; (mcron-configuration
  144. ;; (jobs (list cpupower-powersave-job
  145. ;; lift-nofile-limit-job
  146. ;; renice-guix-daemon-job
  147. ;; ;;guix-reconfigure-job
  148. ;; guix-release-throttle-job))))
  149.  
  150. ;; TODO: add /usr/bin/env
  151. ;; (service special-files-service-type
  152. ;; `(("/usr/bin/env" ,(file-append (canonical-package coreutils) "/bin/env"))))
  153.  
  154. ;; Schedule cron jobs for system tasks
  155. (simple-service 'system-cron-jobs
  156. mcron-service-type
  157. (list
  158. ;; Run `guix gc' 5 minutes after midnight every day.
  159. ;; Clean up generations older than 2 months and free
  160. ;; at least 10G of space.
  161. #~(job "5 0 * * *" "guix gc -d 2m -F 5G")))
  162.  
  163. (service cups-service-type
  164. (cups-configuration
  165. (web-interface? #t)
  166. (extensions
  167. (list cups-filters))))
  168.  
  169. (set-xorg-configuration
  170. (xorg-configuration ;set keyboard-layout for Xorg
  171. (keyboard-layout keyboard-layout)))
  172.  
  173. ;; (simple-service 'custom-udev-rules udev-service-type (list sane-backends android-udev-rules)))
  174.  
  175. (modify-services %desktop-services
  176. (ntp-service-type config =>
  177. (ntp-configuration
  178. (allow-large-adjustment? #t)))
  179. (alsa-service-type config => ;disable routing alsa over pulse, because that broke audacity.
  180. (alsa-configuration
  181. (pulseaudio? #f)))
  182. (sysctl-service-type config =>
  183. (sysctl-configuration
  184. (settings (append '(("fs.file-max" . "500000")
  185. ("fs.inotify.max_user_watches" . "524288"))
  186. %default-sysctl-settings))))
  187. (guix-service-type config => (guix-configuration
  188. (inherit config)
  189. (substitute-urls
  190. (append (list "https://substitutes.nonguix.org"
  191. "https://ci.guix.gnu.org"
  192. "https://bordeaux.guix.gnu.org")
  193. %default-substitute-urls))
  194. (authorized-keys
  195. (append (list (local-file "/home/felux/signing-key.pub")
  196. (local-file "/home/felux/ci-key.pub")
  197. (local-file "/home/felux/bordeaux-key.pub"))
  198. %default-authorized-guix-keys))))
  199. ;; (delete dbus-root-service-type)
  200. ;; (delete udev-service-type)
  201. ;; (delete polkit-service-type)
  202. ;; (delete gdm-service-type)
  203. ;; (delete nscd-service-type)
  204. ;; (delete rottlog-service-type)
  205. ;; (delete syslog-service-type)
  206. ;; (delete sysctl-service-type)
  207. ;; (delete guix-service-type)
  208. ;; (delete urandom-seed-service-type)
  209. ;; (delete static-networking-service-type)
  210. ;; (delete mingetty-service-type)
  211. ))
  212. %base-services))
  213.  
  214. ;; Allow resolution of '.local' host names with mDNS.
  215. (name-service-switch %mdns-host-lookup-nss)))
  216.  
Advertisement
Add Comment
Please, Sign In to add comment