about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorHerwig Hochleitner <herwig@bendlas.net>2015-02-10 02:27:04 +0100
committerHerwig Hochleitner <herwig@bendlas.net>2015-02-10 06:49:47 +0100
commit2961b83d08a18f6ac9c9d87a347cf5f2cea27690 (patch)
tree887896ee471c49da55faaf5dd5c299de3a2cf20a /nixos/modules
parentd49405a5abf7f4c63b9f9a5836e9790824f6406c (diff)
downloadnixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar.gz
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar.bz2
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar.lz
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar.xz
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.tar.zst
nixlib-2961b83d08a18f6ac9c9d87a347cf5f2cea27690.zip
Add cdemu packages and module
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/hardware/cdemu.nix49
2 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 292feb948828..9c5cb6de83c3 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -144,6 +144,7 @@
   ./services/games/minecraft-server.nix
   ./services/hardware/acpid.nix
   ./services/hardware/amd-hybrid-graphics.nix
+  ./services/hardware/cdemu.nix
   ./services/hardware/bluetooth.nix
   ./services/hardware/freefall.nix
   ./services/hardware/nvidia-optimus.nix
diff --git a/nixos/modules/services/hardware/cdemu.nix b/nixos/modules/services/hardware/cdemu.nix
new file mode 100644
index 000000000000..32a454b39c07
--- /dev/null
+++ b/nixos/modules/services/hardware/cdemu.nix
@@ -0,0 +1,49 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let cfg = config.services.cdemu;
+in {
+
+  options = {
+    services.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;
+  };
+  
+}