summary refs log tree commit diff
path: root/nixos/modules/services/misc/sundtek.nix
diff options
context:
space:
mode:
authorSimon Vandel Sillesen <simon.vandel@gmail.com>2015-07-02 03:18:56 +0200
committerSimon Vandel Sillesen <simon.vandel@gmail.com>2015-07-07 10:58:58 +0200
commite85dac137e7be8940b08744a88fcb8fe60e70000 (patch)
tree6ca481726eb43a0f15fa164e45f02e621c68630c /nixos/modules/services/misc/sundtek.nix
parent41cf8be4123bbbec5701bf16d0f444e645eb4479 (diff)
downloadnixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar.gz
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar.bz2
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar.lz
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar.xz
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.tar.zst
nixpkgs-e85dac137e7be8940b08744a88fcb8fe60e70000.zip
sundtek init at 30-06-2015
Diffstat (limited to 'nixos/modules/services/misc/sundtek.nix')
-rw-r--r--nixos/modules/services/misc/sundtek.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/sundtek.nix b/nixos/modules/services/misc/sundtek.nix
new file mode 100644
index 00000000000..8438ef79904
--- /dev/null
+++ b/nixos/modules/services/misc/sundtek.nix
@@ -0,0 +1,33 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.sundtek;
+
+in
+{
+  options.services.sundtek = {
+    enable = mkEnableOption "Sundtek driver";
+  };
+
+  config = mkIf cfg.enable {
+
+    environment.systemPackages = [ pkgs.sundtek ];
+
+    systemd.services.sundtek = {
+      description = "Sundtek driver";
+      wantedBy = [ "multi-user.target" ];
+
+      serviceConfig = {
+        Type = "oneshot";
+        ExecStart = ''
+          ${pkgs.sundtek}/bin/mediasrv -d -v -p ${pkgs.sundtek}/bin ;\
+          ${pkgs.sundtek}/bin/mediaclient --start=5 --wait-for-devices
+          '';
+        ExecStop = "${pkgs.sundtek}/bin/mediaclient --shutdown";
+        RemainAfterExit = true;
+      };
+    };
+  };
+}