From 87b4440a6001bb239a210e1c4a1fec2e95fdd1d6 Mon Sep 17 00:00:00 2001 From: Niklaus Giger Date: Sat, 12 Mar 2022 19:27:17 +0100 Subject: [PATCH] nixos/k3b: init. Fixes #19154 missing permissions for k3b --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/k3b.nix | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 nixos/modules/programs/k3b.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 132416d865f4..81fe27dd75d5 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -172,6 +172,7 @@ ./programs/java.nix ./programs/k40-whisperer.nix ./programs/kclock.nix + ./programs/k3b.nix ./programs/kdeconnect.nix ./programs/kbdlight.nix ./programs/less.nix diff --git a/nixos/modules/programs/k3b.nix b/nixos/modules/programs/k3b.nix new file mode 100644 index 000000000000..68a4d08f349c --- /dev/null +++ b/nixos/modules/programs/k3b.nix @@ -0,0 +1,52 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + # interface + options.programs.k3b = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable k3b, the KDE disk burning application. + + Additionally to installing k3b enabling this will + add setuid wrappers in /run/wrappers/bin + for both cdrdao and cdrecord. On first + run you must manually configure the path of cdrdae and + cdrecord to correspond to the appropriate paths under + /run/wrappers/bin in the "Setup External Programs" menu. + ''; + }; + }; + + # implementation + config = mkIf config.programs.k3b.enable { + + environment.systemPackages = with pkgs; [ + k3b + dvdplusrwtools + cdrdao + cdrkit + ]; + + security.wrappers = { + cdrdao = { + setuid = true; + owner = "root"; + group = "cdrom"; + permissions = "u+wrx,g+x"; + source = "${pkgs.cdrdao}/bin/cdrdao"; + }; + cdrecord = { + setuid = true; + owner = "root"; + group = "cdrom"; + permissions = "u+wrx,g+x"; + source = "${pkgs.cdrkit}/bin/cdrecord"; + }; + }; + + }; +}