mirror of https://codeberg.org/anemofilia/zero
operating-systems: buer: Update to opendoas-service-type
parent
a8ef1b1f24
commit
281d9ee65d
|
@ -79,6 +79,8 @@
|
|||
#:prefix channel:)
|
||||
#|P|# #:use-module ((buer privilege)
|
||||
#:prefix privileged-programs:)
|
||||
#|R|# #:use-module ((buer rules)
|
||||
#:prefix rules:)
|
||||
#|U|# #:use-module ((buer users)
|
||||
#:prefix user:)
|
||||
|
||||
|
@ -145,7 +147,7 @@
|
|||
|
||||
#|System level packages|#
|
||||
(packages
|
||||
(list #|admin |# btop inetutils isc-dhcp opendoas shadow zzz
|
||||
(list #|admin |# btop inetutils isc-dhcp shadow zzz
|
||||
#|base |# coreutils diffutils findutils grep patch sed tar which
|
||||
#|certs |# nss-certs
|
||||
#|compression |# gzip xz zstd
|
||||
|
@ -307,41 +309,13 @@
|
|||
(size (round/ (ram-total) 2))
|
||||
(compression-algorithm 'lz4)))
|
||||
|
||||
#|Doas configuration services|#
|
||||
(simple-service 'miscellaneous-permissions doas-service-type
|
||||
(list (permit (identity ":wheel")
|
||||
(setenv
|
||||
`(("GUILE_LOAD_PATH" . #t)
|
||||
("GUILE_LOAD_COMPILED_PATH" . #t))))))
|
||||
(simple-service 'text-editors-permissions doas-service-type
|
||||
(map (lambda (cmd)
|
||||
(permit (identity ":wheel")
|
||||
(keepenv? #t)
|
||||
(command cmd)))
|
||||
`("kak" "emacsclient")))
|
||||
(simple-service 'power-management-permissions doas-service-type
|
||||
(map (lambda (cmd)
|
||||
(permit (identity ":wheel")
|
||||
(nopass? #t)
|
||||
(command cmd)
|
||||
(args '())))
|
||||
`("zzz" "halt" "reboot")))
|
||||
(simple-service 'shepherd-status-permissions doas-service-type
|
||||
(map (lambda (action)
|
||||
(permit (identity ":wheel")
|
||||
(nopass? #t)
|
||||
(command "herd")
|
||||
(args (list action))))
|
||||
`("status" "detailed-status")))
|
||||
(simple-service 'service-management-permissions doas-service-type
|
||||
(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)))
|
||||
#|Permission services|#
|
||||
(service opendoas-service-type
|
||||
(opendoas-configuration
|
||||
(rules (append rules:general
|
||||
rules:text-editors
|
||||
rules:power-management
|
||||
rules:service-management))))
|
||||
|
||||
#|Special file services|#
|
||||
(service special-files-service-type
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
(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)
|
||||
("GUILE_LOAD_COMPILED_PATH" . #t))))))
|
||||
|
||||
(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))))
|
Loading…
Reference in New Issue