1{ config, pkgs, lib, ... }:
2
3with lib;
4
5{
6 # interface
7 options.programs.k3b = {
8 enable = mkOption {
9 type = types.bool;
10 default = false;
11 description = lib.mdDoc ''
12 Whether to enable k3b, the KDE disk burning application.
13
14 Additionally to installing `k3b` enabling this will
15 add `setuid` wrappers in `/run/wrappers/bin`
16 for both `cdrdao` and `cdrecord`. On first
17 run you must manually configure the path of `cdrdae` and
18 `cdrecord` to correspond to the appropriate paths under
19 `/run/wrappers/bin` in the "Setup External Programs" menu.
20 '';
21 };
22 };
23
24 # implementation
25 config = mkIf config.programs.k3b.enable {
26
27 environment.systemPackages = with pkgs; [
28 k3b
29 dvdplusrwtools
30 cdrdao
31 cdrtools
32 ];
33
34 security.wrappers = {
35 cdrdao = {
36 setuid = true;
37 owner = "root";
38 group = "cdrom";
39 permissions = "u+wrx,g+x";
40 source = "${pkgs.cdrdao}/bin/cdrdao";
41 };
42 cdrecord = {
43 setuid = true;
44 owner = "root";
45 group = "cdrom";
46 permissions = "u+wrx,g+x";
47 source = "${pkgs.cdrtools}/bin/cdrecord";
48 };
49 };
50
51 };
52}