chore: move doas configuration to doas-service in system declaration

pull/1/head
anemofilia 2023-09-23 21:00:28 -03:00
parent db58f18d93
commit 94e87a5602
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
3 changed files with 40 additions and 25 deletions

View File

@ -6,6 +6,7 @@
(radix packages linux)
(radix packages text-editors)
(radix packages shells)
(radix services admin)
(radix services linux)
(radix system setuid)
(radix secrets)
@ -239,8 +240,44 @@
(respawn? #f)))
#|Doas config service|#
(simple-service 'doas-config etc-service-type
`(("doas.conf" ,file:doas-config)))
(service doas-service-type
(append #|Miscellaneous|#
(list (permit (identity ":wheel")
(setenv `("GUILE_LOAD_PATH")))
(permit (identity ":wheel")
(nopass? #t)
(command "guix")
(args `("pull")))
(permit (identity ":wheel")
(nopass? #t)
(command "herd")
(args `("status"
"detailed-status"))))
#|Text editors|#
(map (lambda (cmd)
(permit (identity ":wheel")
(keepenv? #t)
(command cmd)))
`("kak" "emacsclient"))
#|Power management|#
(map (lambda (cmd)
(permit (identity ":wheel")
(nopass? #t)
(args '())))
`("zzz" "halt" "reboot"))
#|Service management|#
(flatmap (lambda (service action)
(permit (identity ":wheel")
(nopass? #t)
(command "herd")
(args (cons action service))))
`(("tlp") ("tor") ("thermald")
("thinkfan") ("wpa-supplicant")))
`("doc" "stop" "start" "status"
"restart" "enable" "disable"))))
#|Special file services|#
(service special-files-service-type

View File

@ -1,19 +0,0 @@
permit setenv { GUILE_LOAD_PATH } :wheel
permit keepenv :wheel cmd kak
permit keepenv :wheel cmd emacsclient
permit nopass :wheel cmd zzz args
permit nopass :wheel cmd halt args
permit nopass :wheel cmd reboot args
permit nopass :wheel cmd guix args pull
permit nopass :wheel cmd herd args status
permit nopass :wheel cmd herd args doc thinkfan
permit nopass :wheel cmd herd args stop thinkfan
permit nopass :wheel cmd herd args start thinkfan
permit nopass :wheel cmd herd args status thinkfan
permit nopass :wheel cmd herd args restart thinkfan
permit nopass :wheel cmd herd args doc wpa-supplicant
permit nopass :wheel cmd herd args stop wpa-supplicant
permit nopass :wheel cmd herd args start wpa-supplicant
permit nopass :wheel cmd herd args status wpa-supplicant
permit nopass :wheel cmd herd args restart wpa-supplicant

View File

@ -1,9 +1,6 @@
(define-module (radix files doas)
#:use-module (gnu)
#:export (completion config))
#:export (completion))
(define completion
(local-file "../../../files/doas/doas-completion"))
(define config
(local-file "../../../files/doas/doas.conf"))