Merge pull request #46514 from rembo10/headphones

headphones: init at 0.5.19
This commit is contained in:
Ryan Mulligan 2019-02-17 17:45:51 -08:00 committed by GitHub
commit 8107a09ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 130 additions and 2 deletions

View File

@ -3843,6 +3843,11 @@
github = "relrod";
name = "Ricky Elrod";
};
rembo10 = {
email = "rembo10@users.noreply.github.com";
github = "rembo10";
name = "rembo10";
};
renatoGarcia = {
email = "fgarcia.renato@gmail.com";
github = "renatoGarcia";

View File

@ -290,7 +290,7 @@
riak-cs = 263;
infinoted = 264;
sickbeard = 265;
# glance = 266; # unused, removed 2017-12-13
headphones = 266;
couchpotato = 267;
gogs = 268;
pdns-recursor = 269;
@ -590,7 +590,7 @@
riak-cs = 263;
infinoted = 264;
sickbeard = 265;
# glance = 266; # unused, removed 2017-12-13
headphones = 266;
couchpotato = 267;
gogs = 268;
kresd = 270;

View File

@ -380,6 +380,7 @@
./services/misc/gogs.nix
./services/misc/gollum.nix
./services/misc/gpsd.nix
./services/misc/headphones.nix
./services/misc/home-assistant.nix
./services/misc/ihaskell.nix
./services/misc/irkerd.nix

View File

@ -0,0 +1,87 @@
{ config, lib, pkgs, ... }:
with lib;
let
name = "headphones";
cfg = config.services.headphones;
in
{
###### interface
options = {
services.headphones = {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the headphones server.";
};
dataDir = mkOption {
type = types.path;
default = "/var/lib/${name}";
description = "Path where to store data files.";
};
configFile = mkOption {
type = types.path;
default = "${cfg.dataDir}/config.ini";
description = "Path to config file.";
};
host = mkOption {
type = types.str;
default = "localhost";
description = "Host to listen on.";
};
port = mkOption {
type = types.ints.u16;
default = 8181;
description = "Port to bind to.";
};
user = mkOption {
type = types.str;
default = name;
description = "User to run the service as";
};
group = mkOption {
type = types.str;
default = name;
description = "Group to run the service as";
};
};
};
###### implementation
config = mkIf cfg.enable {
users.users = optionalAttrs (cfg.user == name) (singleton {
name = name;
uid = config.ids.uids.headphones;
group = cfg.group;
description = "headphones user";
home = cfg.dataDir;
createHome = true;
});
users.groups = optionalAttrs (cfg.group == name) (singleton {
name = name;
gid = config.ids.gids.headphones;
});
systemd.services.headphones = {
description = "Headphones Server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
User = cfg.user;
Group = cfg.group;
ExecStart = "${pkgs.headphones}/bin/headphones --datadir ${cfg.dataDir} --config ${cfg.configFile} --host ${cfg.host} --port ${toString cfg.port}";
};
};
};
}

View File

@ -0,0 +1,33 @@
{ stdenv, fetchFromGitHub, python2, makeWrapper }:
python2.pkgs.buildPythonApplication rec {
name = "headphones-${version}";
version = "0.5.19";
src = fetchFromGitHub {
owner = "rembo10";
repo = "headphones";
rev = "v${version}";
sha256 = "0z39gyan3ksdhnjxxs7byamrzmrk8cn15g300iqigzvgidff1lq0";
};
dontBuild = true;
doCheck = false;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python2 ];
installPhase = ''
mkdir -p $out/bin
cp -R {data,headphones,lib,Headphones.py} $out/
makeWrapper $out/Headphones.py $out/bin/headphones
'';
meta = with stdenv.lib; {
description = "Automatic music downloader for SABnzbd";
license = licenses.gpl3;
homepage = https:/github.com/rembo10/headphones;
maintainers = with stdenv.lib.maintainers; [ rembo10 ];
};
}

View File

@ -13589,6 +13589,8 @@ in
hbase = callPackage ../servers/hbase {};
headphones = callPackage ../servers/headphones {};
hiawatha = callPackage ../servers/http/hiawatha {};
home-assistant = callPackage ../servers/home-assistant { };