From e85dac137e7be8940b08744a88fcb8fe60e70000 Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen Date: Thu, 2 Jul 2015 03:18:56 +0200 Subject: [PATCH] sundtek init at 30-06-2015 --- nixos/modules/module-list.nix | 1 + nixos/modules/services/misc/sundtek.nix | 33 +++++++++++++++++ pkgs/misc/drivers/sundtek/default.nix | 48 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 84 insertions(+) create mode 100644 nixos/modules/services/misc/sundtek.nix create mode 100644 pkgs/misc/drivers/sundtek/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d580e269df96..e2d8efcf4c2b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -219,6 +219,7 @@ ./services/misc/rogue.nix ./services/misc/siproxd.nix ./services/misc/subsonic.nix + ./services/misc/sundtek.nix ./services/misc/svnserve.nix ./services/misc/synergy.nix ./services/misc/uhub.nix diff --git a/nixos/modules/services/misc/sundtek.nix b/nixos/modules/services/misc/sundtek.nix new file mode 100644 index 000000000000..8438ef79904f --- /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; + }; + }; + }; +} diff --git a/pkgs/misc/drivers/sundtek/default.nix b/pkgs/misc/drivers/sundtek/default.nix new file mode 100644 index 000000000000..0ad313a72331 --- /dev/null +++ b/pkgs/misc/drivers/sundtek/default.nix @@ -0,0 +1,48 @@ +{ fetchurl, stdenv }: + +with stdenv.lib; + +let + version = "30-06-2015"; + rpath = makeLibraryPath [ "$out/lib" "$out/bin" ]; + platform = with stdenv; + if isx86_64 then "64bit" + else + if isi686 then "32bit" + else abort "${system} not considered in build derivation. Might still be supported."; + +in + stdenv.mkDerivation { + src = fetchurl { + url = "http://www.sundtek.de/media/netinst/${platform}/installer.tar.gz"; + sha256 = "304d2785b5e9046c78fc092341721fdc404074105e63dd635e838559d42313c3"; + }; + name = "sundtek-${version}"; + + phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; + + sourceRoot = "."; + + installPhase = '' + cp -r opt $out + + # add and fix pkg-config file + mkdir -p $out/lib/pkgconfig + substitute $out/doc/libmedia.pc $out/lib/pkgconfig/libmedia.pc \ + --replace /opt $out + ''; + + postFixup = '' + find $out -type f -exec \ + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \ + patchelf --set-rpath ${rpath} {} \; + ''; + + meta = { + description = "Sundtek MediaTV driver"; + maintainers = [ maintainers.simonvandel ]; + platforms = platforms.unix; + license = licenses.unfree; + homepage = "http://support.sundtek.com/index.php/topic,1573.0.html"; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8bc7e90f334..bd8ac1e3640d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2978,6 +2978,8 @@ let suidChroot = callPackage ../tools/system/suid-chroot { }; + sundtek = callPackage ../misc/drivers/sundtek { }; + super = callPackage ../tools/security/super { }; ssdeep = callPackage ../tools/security/ssdeep { };