Merge pull request #16108 from pwetzel/squeezelite
Squeezelite package and service init
This commit is contained in:
commit
6fd8e5719b
@ -268,6 +268,7 @@
|
|||||||
nzbget = 245;
|
nzbget = 245;
|
||||||
mosquitto = 246;
|
mosquitto = 246;
|
||||||
toxvpn = 247;
|
toxvpn = 247;
|
||||||
|
squeezelite = 248;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
@ -506,6 +507,7 @@
|
|||||||
nzbget = 245;
|
nzbget = 245;
|
||||||
mosquitto = 246;
|
mosquitto = 246;
|
||||||
#toxvpn = 247; # unused
|
#toxvpn = 247; # unused
|
||||||
|
#squeezelite = 248; #unused
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing
|
# When adding a gid, make sure it doesn't match an existing
|
||||||
# uid. Users and groups with the same name should have equal
|
# uid. Users and groups with the same name should have equal
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
./services/audio/liquidsoap.nix
|
./services/audio/liquidsoap.nix
|
||||||
./services/audio/mpd.nix
|
./services/audio/mpd.nix
|
||||||
./services/audio/mopidy.nix
|
./services/audio/mopidy.nix
|
||||||
|
./services/audio/squeezelite.nix
|
||||||
./services/backup/almir.nix
|
./services/backup/almir.nix
|
||||||
./services/backup/bacula.nix
|
./services/backup/bacula.nix
|
||||||
./services/backup/crashplan.nix
|
./services/backup/crashplan.nix
|
||||||
|
67
nixos/modules/services/audio/squeezelite.nix
Normal file
67
nixos/modules/services/audio/squeezelite.nix
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
uid = config.ids.uids.squeezelite;
|
||||||
|
cfg = config.services.squeezelite;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.squeezelite= {
|
||||||
|
|
||||||
|
enable = mkEnableOption "Squeezelite, a software Squeezebox emulator";
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
default = "/var/lib/squeezelite";
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The directory where Squeezelite stores its name file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraArguments = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Additional command line arguments to pass to Squeezelite.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.services.squeezelite= {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" "sound.target" ];
|
||||||
|
description = "Software Squeezebox emulator";
|
||||||
|
preStart = "mkdir -p ${cfg.dataDir} && chown -R squeezelite ${cfg.dataDir}";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.squeezelite}/bin/squeezelite -N ${cfg.dataDir}/player-name ${cfg.extraArguments}";
|
||||||
|
User = "squeezelite";
|
||||||
|
PermissionsStartOnly = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraUsers.squeezelite= {
|
||||||
|
inherit uid;
|
||||||
|
group = "nogroup";
|
||||||
|
extraGroups = [ "audio" ];
|
||||||
|
description = "Squeezelite user";
|
||||||
|
home = "${cfg.dataDir}";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
26
pkgs/applications/audio/squeezelite/default.nix
Normal file
26
pkgs/applications/audio/squeezelite/default.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ stdenv, fetchFromGitHub, alsaLib, faad2, flac, libmad, libvorbis, mpg123 }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "squeezelite-git-2016-05-27";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "ralph-irving";
|
||||||
|
repo = "squeezelite";
|
||||||
|
rev = "e37ed17fed9e11a7346cbe9f1e1deeccc051f42e";
|
||||||
|
sha256 = "15ihx2dbp4kr6k6r50g9q5npqad5zyv8nqf5cr37bhg964syvbdm";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ alsaLib faad2 flac libmad libvorbis mpg123 ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp squeezelite $out/bin
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Lightweight headless squeezebox client emulator";
|
||||||
|
homepage = https://github.com/ralph-irving/squeezelite;
|
||||||
|
license = licenses.gpl3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
@ -14253,6 +14253,8 @@ in
|
|||||||
apiKey = config.libspotify.apiKey or null;
|
apiKey = config.libspotify.apiKey or null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
squeezelite = callPackage ../applications/audio/squeezelite { };
|
||||||
|
|
||||||
ltunify = callPackage ../tools/misc/ltunify { };
|
ltunify = callPackage ../tools/misc/ltunify { };
|
||||||
|
|
||||||
src = callPackage ../applications/version-management/src/default.nix {
|
src = callPackage ../applications/version-management/src/default.nix {
|
||||||
|
Loading…
Reference in New Issue
Block a user