2024-09-22 18:46:29 +00:00
|
|
|
(define-module (buer rules)
|
|
|
|
#:use-module (radix services admin)
|
|
|
|
#:use-module (radix utils)
|
|
|
|
#:export (general
|
|
|
|
text-editors
|
|
|
|
power-management
|
|
|
|
service-management))
|
|
|
|
|
|
|
|
(define general
|
|
|
|
(list (permit (identity ":wheel")
|
|
|
|
(setenv
|
|
|
|
`(("GUILE_LOAD_PATH" . #t)
|
2024-10-21 00:01:53 +00:00
|
|
|
("GUILE_LOAD_COMPILED_PATH" . #t)
|
|
|
|
("TERM" . "linux"))))))
|
2024-09-22 18:46:29 +00:00
|
|
|
|
|
|
|
(define text-editors
|
|
|
|
(map (lambda (cmd)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(keepenv? #t)
|
|
|
|
(command cmd)))
|
|
|
|
`("kak" "emacsclient")))
|
|
|
|
|
|
|
|
(define power-management
|
|
|
|
(map (lambda (cmd)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command cmd)
|
|
|
|
(args '())))
|
|
|
|
`("zzz" "halt" "reboot")))
|
|
|
|
|
|
|
|
(define service-management
|
|
|
|
(append (map (lambda (action)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command "herd")
|
|
|
|
(args (list action))))
|
|
|
|
`("status" "detailed-status"))
|
|
|
|
(flat-map (lambda (service action)
|
|
|
|
(permit (identity ":wheel")
|
|
|
|
(nopass? #t)
|
|
|
|
(command "herd")
|
|
|
|
(args (map symbol->string
|
|
|
|
(list action service)))))
|
|
|
|
'(networking wpa-supplicant)
|
|
|
|
'(doc stop start enable status restart disable))))
|