about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-02-10 15:33:06 +0100
committerlethalman <lucabru@src.gnome.org>2015-02-10 15:33:06 +0100
commitc1d22c947e5097c24b20424fefede4a53cc0f9ff (patch)
treeb237e310d72ecc7b1b814bd98ca61d8d4ec88b24 /nixos/modules
parenta1d11517923811807300d6b8a06b1534427b6154 (diff)
parentdea3ac7783568482e3a18a1b4603702fdcff1dd9 (diff)
downloadnixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar.gz
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar.bz2
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar.lz
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar.xz
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.tar.zst
nixlib-c1d22c947e5097c24b20424fefede4a53cc0f9ff.zip
Merge pull request #6278 from bendlas/cdemu
Add cdemu packages and module
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/cdemu.nix49
2 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 9bbcfeace89d..0fad59d55717 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -55,6 +55,7 @@
   ./programs/atop.nix
   ./programs/bash/bash.nix
   ./programs/blcr.nix
+  ./programs/cdemu.nix
   ./programs/command-not-found/command-not-found.nix
   ./programs/dconf.nix
   ./programs/environment.nix
diff --git a/nixos/modules/programs/cdemu.nix b/nixos/modules/programs/cdemu.nix
new file mode 100644
index 000000000000..d1b1915eea91
--- /dev/null
+++ b/nixos/modules/programs/cdemu.nix
@@ -0,0 +1,49 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let cfg = config.programs.cdemu;
+in {
+
+  options = {
+    programs.cdemu = {
+      enable = mkOption {
+        default = false;
+        description = "Whether to enable cdemu for users of appropriate group (default cdrom)";
+      };
+      group = mkOption {
+        default = "cdrom";
+        description = "Required group for users of cdemu";
+      };
+      gui = mkOption {
+        default = true;
+        description = "Whether to install cdemu GUI (gCDEmu)";
+      };
+      image-analyzer = mkOption {
+        default = true;
+        description = "Whether to install image analyzer";
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+
+    boot = {
+      extraModulePackages = [ pkgs.linuxPackages.vhba ];
+      kernelModules = [ "vhba" ];
+    };
+
+    services = {
+      udev.extraRules = ''
+        KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="${cfg.group}"
+      '';
+      dbus.packages = [ pkgs.cdemu-daemon ];
+    };
+
+    environment.systemPackages =
+      [ pkgs.cdemu-daemon pkgs.cdemu-client ]
+      ++ optional cfg.gui pkgs.gcdemu
+      ++ optional cfg.image-analyzer pkgs.image-analyzer;
+  };
+
+}