dev.fron.io rc / 39d0eef
meta: pull Tony Olagbaiye a month ago
6 changed file(s) with 101 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
148148 '';
149149 in [
150150 appimage-run steam-run manix # Package Tools
151 abduco dvtm # Terminal Multiplexing
151 abduco dvtm nvimpager # Terminal Multiplexing
152152 yadm # Dotfile Management
153153 pstree bottom # Process Monitoring
154154 pv pup # Pipe Management
00 (define-module (rc home factors emacs)
1 #:use-module (system base compile)
2 #:use-module ((rc) #:prefix rc:)
13 #:use-module (rc home)
24 #:use-module (rc utils)
35 #:use-module (guix gexp)
46 #:use-module (guix packages)
7 #:use-module (guix scripts import)
58 #:use-module (gnu home-services)
69 #:use-module (gnu home-services emacs)
710 #:use-module (gnu packages emacs)
811 #:use-module (gnu packages emacs-xyz)
912 #:use-module (flat packages emacs)
1013 #:export (use-emacs-services))
14
15 (define (outsource-melpa pkg)
16 (define (melpa-name->package-name name)
17 "Given the NAME of an Emacs package, return the corresponding Guix name."
18 (let ((package-name-prefix "emacs-"))
19 (if (string-prefix? package-name-prefix name)
20 (string-downcase name)
21 (string-append package-name-prefix (string-downcase name)))))
22
23 (let ((edir (string-append rc:%channel-root "/rc/packages/emacs"))
24 (name (symbol->string pkg)))
25 (let();false-if-exception
26 (let ((scm (string-append edir "/" name ".scm"))
27 (pkg-name (melpa-name->package-name name)))
28 (unless (file-exists? edir)
29 (mkdir edir))
30 (unless (file-exists? scm)
31 (with-output-to-file scm
32 (lambda ()
33 (display `(define-module (rc packages emacs ,pkg)
34 #:use-module (guix build-system emacs)
35 #:use-module (guix download)
36 #:use-module (guix packages)
37 #:use-module (gnu packages emacs)
38 #:use-module (gnu packages emacs-xyz)
39 #:export ()))
40 (display "\n")
41 (guix-import "elpa" "-r" "--archive=melpa" name)
42 (display (string-append "\n" pkg-name))))
43 (compile-file scm)
44 (load-compiled (compiled-file-name scm)))
45 (module-ref (resolve-module `(rc packages emacs ,pkg))
46 (string->symbol pkg-name))))))
47
48 (define-syntax-rule (melpa pkg)
49 (outsource-melpa (quote pkg)))
1150
1251 (define (use-emacs-services services)
1352 (cons*
1655 (package emacs-pgtk-native-comp)
1756 ;(package (inferior-package->package (delayed 'emacs) #:license #f))
1857 (elisp-packages (list
58 (melpa weechat)
1959 emacs-ace-window ; ace-window.nix
2060 ;emacs-ahg ; ahg.nix
2161 emacs-all-the-icons ; all-the-icons.nix
3474 ;emacs-calfw-org ; calfw-org.nix
3575 emacs-calfw ; calfw.nix
3676 ;emacs-cargo ; cargo.nix
77 emacs-ccls
3778 ;emacs-cl ; cl.nix
3879 emacs-company-box ; company-box.nix
3980 emacs-company-cabal ; company-cabal.nix
1616 #:use-module (rc home factors emacs)
1717 #:use-module (gnu home-services)
1818 #:use-module (gnu home-services emacs)
19 #:use-module (gnu home-services files)
2019 #:use-module (gnu home-services gnupg)
2120 #:use-module (gnu home-services shells)
2221 #:use-module (gnu home-services shellutils)
144143 "export EDITOR=nvim"
145144 "export ALTERNATE_EDITOR=emacsclient"
146145 "export NIX_PATH=nixpkgs=/nix/var/nix/profiles/system/flake/input/master"
146 "export PATH=$PATH:$HOME/bin"
147147 "export GUIX=$HOME/.config/guix/current/share/guile/site/3.0"))
148148 (zprofile (list))
149149 (zshrc
257257 (shepherd-service
258258 (provision '(dbus))
259259 (start #~(make-forkexec-constructor
260 (list #$(file-append (@@ (gnu packages glib) dbus)
260 (list #$(file-append (@ (gnu packages glib) dbus)
261261 "/bin/dbus-daemon")
262262 "--nofork"
263263 "--session"
359359 (gpg-agent-config
360360 (home-gpg-agent-configuration
361361 (ssh-agent? #t)))))
362
363 (simple-service 'darkice-shepherd-daemon
364 home-shepherd-service-type
365 (list
366 (shepherd-service
367 (provision '(darkice))
368 (start #~(make-forkexec-constructor
369 (list #$(file-append (@ (gnu packages audio) darkice)
370 "/bin/darkice")
371 "-c" "/etc/darkice.cfg")))
372 (auto-start? #f))))
362373
363374 (service pipewire-service-type
364375 (pipewire-configuration
4747 #$config)
4848 #:user #$user
4949 #:group #$group
50 #:log-level "/var/log/biboumi.log"
50 #:log-file "/var/log/biboumi.log"
5151 #:environment-variables
5252 (append (list (string-append "HOME="
5353 (or #$home (passwd:dir (getpw #$user))))
22 #:use-module (gcrypt pk-crypto)
33 #:use-module (guix packages)
44 #:use-module (gnu)
5 #:use-module (gnu system setuid)
56 #:use-module (gnu system nss)
67 #:use-module (nongnu system linux-initrd)
78 #:use-module (rc system factors doas)
89 #:use-module (rc system factors guix)
910 #:use-module (rc system factors home)
11 #:use-module (gnu services admin)
1012 #:use-module (gnu services desktop)
1113 #:use-module (gnu services sddm)
1214 #:use-module (gnu services shepherd)
1315 #:use-module (gnu services sound)
1416 #:use-module (gnu services ssh)
17 #:use-module (gnu services sysctl)
1518 #:use-module (gnu services networking)
1619 #:use-module (gnu services nix)
1720 #:use-module (gnu services vpn)
4952 #:use-module (gnu packages vpn)
5053 #:use-module (gnu packages web)
5154 #:use-module (gnu packages wm)
55 #:use-module (gnu packages xiph)
5256 #:use-module (gnu packages xdisorg)
5357 #:use-module (gnu packages xorg)
5458 #:use-module (nongnu packages linux)
130134 (options "subvol=gnu")
131135 (type "btrfs"))
132136 (file-system (device ssd)
137 (mount-point "/var/guix")
138 (mount-may-fail? #t)
139 (options "subvolid=498") ; /gnu/var
140 (type "btrfs"))
141 (file-system (device ssd)
133142 (mount-point "/nix")
134143 (flags '(no-atime))
135144 (options "subvol=nix")
148157 (comment "Data User")
149158 (shell (file-append zsh "/bin/zsh"))
150159 (supplementary-groups '("wheel" "stem"
151 "audio" "video"
160 "audio" "video" "kvm"
152161 "adbusers" "netdev")))
153162 (user-account
154163 (name "python")
194203 %base-packages))
195204
196205 (setuid-programs (cons*
197 #~(string-append #$swaylock "/bin/swaylock")
206 (setuid-program
207 (program #~(string-append #$swaylock "/bin/swaylock")))
198208 %setuid-programs))
199209
200210 (sudoers-file (plain-file "sudoers" "\
209219 (openssh-configuration
210220 (permit-root-login #t)
211221 (openssh openssh-sans-x)))
222 (service unattended-upgrade-service-type
223 (unattended-upgrade-configuration
224 (schedule #~"00 12 * * *")
225 (channels
226 (local-file "/etc/guix/channels.scm" "channels.scm"))
227 (operating-system-file
228 (file-append (local-file "/srv/code/rc" "config-dir" #:recursive? #t)
229 "/config.scm"))
230 (services-to-restart
231 (list 'mcron))))
212232 (service nix-service-type
213233 (nix-configuration
214234 (package nixUnstable)
337357 pipewire-0.3)
338358 (udev-rules-service 'android-add-udev-rules
339359 android-udev-rules)
360 (simple-service 'icecast-server shepherd-root-service-type
361 (list (shepherd-service
362 (documentation "Icecast2 service.")
363 (provision '(icecast))
364 (requirement '(networking))
365 (start #~(lambda _
366 (let ((icecast (string-append #$icecast
367 "/bin/icecast")))
368 (fork+exec-command
369 (list icecast "-c" "/etc/icecast.xml")
370 #:environment-variables
371 (list "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"
372 "SSL_CERT_DIR=/etc/ssl/certs")))
373 #t)))))
340374 (simple-service 'minecraft-server shepherd-root-service-type
341375 (list (shepherd-service
342376 (documentation "Minecraft Server.")
373407 (fold (lambda (a b) (apply a (list b)))
374408 (modify-services
375409 %desktop-services
410 (sysctl-service-type config =>
411 (sysctl-configuration
412 (inherit config)
413 (settings (cons*
414 '("kernel.pid_max" . "4194304")
415 (sysctl-configuration-settings config)))))
376416 (delete gdm-service-type)
377417 (delete network-manager-service-type)
378418 (delete pulseaudio-service-type)
22 #:use-module (guix gexp)
33 #:use-module (guix records)
44 #:use-module (gnu services)
5 #:use-module (gnu system setuid)
56 #:use-module (gnu packages admin)
67 #:export (use-doas-services))
78
2526 (simple-service 'doas-profile-service profile-service-type
2627 (list opendoas))
2728 (simple-service 'doas-setuid-service setuid-program-service-type
28 (list #~(string-append #$opendoas "/bin/doas")))
29 (list (setuid-program
30 (program #~(string-append #$opendoas "/bin/doas")))))
2931 services))