Loading nixos/modules/services/audio/icecast.nix +37 −29 Original line number Diff line number Diff line Loading @@ -5,8 +5,14 @@ ... }: let inherit (lib) mkRemovedOptionModule mkRenamedOptionModule ; cfg = config.services.icecast; configFile = pkgs.writeText "icecast.xml" '' <?xml version="1.0"?> <icecast> <hostname>${cfg.hostname}</hostname> Loading @@ -16,7 +22,7 @@ let </authentication> <paths> <logdir>${cfg.logDir}</logdir> <logdir>/var/log/icecast</logdir> <adminroot>${pkgs.icecast}/share/icecast/admin</adminroot> <webroot>${pkgs.icecast}/share/icecast/web</webroot> <alias source="/" dest="/status.xsl"/> Loading @@ -29,18 +35,27 @@ let <security> <chroot>0</chroot> <changeowner> <user>${cfg.user}</user> <group>${cfg.group}</group> </changeowner> </security> ${cfg.extraConf} ${cfg.extraConfig} </icecast> ''; in { imports = [ (mkRemovedOptionModule [ "services" "icecast" "logDir" ] '' The log directory is now managed by systemd's LogsDirectory= directive. '') (mkRemovedOptionModule [ "services" "icecast" "user" ] '' The service now runs under the dynamically allocated `icecast` user. '') (mkRemovedOptionModule [ "services" "icecast" "group" ] '' The service now runs under the dynamically allocated `icecast` group. '') (mkRenamedOptionModule [ "services" "icecast" "extraConf" ] [ "services" "icecast" "extraConfig" ]) ]; ###### interface options = { Loading Loading @@ -69,12 +84,6 @@ in }; }; logDir = lib.mkOption { type = lib.types.path; description = "Base directory used for logging."; default = "/var/log/icecast"; }; listen = { port = lib.mkOption { type = lib.types.port; Loading @@ -89,22 +98,12 @@ in }; }; user = lib.mkOption { type = lib.types.str; description = "User privileges for the server."; default = "nobody"; }; group = lib.mkOption { type = lib.types.str; description = "Group privileges for the server."; default = "nogroup"; }; extraConf = lib.mkOption { extraConfig = lib.mkOption { type = lib.types.lines; description = "icecast.xml content."; default = ""; description = '' Extra configuration added to {file}`icecast.xml` inside the `<icecast>` element. ''; }; }; Loading @@ -120,11 +119,20 @@ in description = "Icecast Network Audio Streaming Server"; wantedBy = [ "multi-user.target" ]; preStart = "mkdir -p ${cfg.logDir} && chown ${cfg.user}:${cfg.group} ${cfg.logDir}"; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.icecast}/bin/icecast -c ${configFile}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; DynamicUser = true; ExecStart = toString [ (lib.getExe pkgs.icecast) "-c" configFile ]; ExecReload = toString [ (lib.getExe' pkgs.coreutils "kill") "-HUP" "$MAINPID" ]; LogsDirectory = "icecast"; }; }; Loading nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -748,6 +748,7 @@ in hydra = runTest ./hydra; i18n = runTest ./i18n.nix; i3wm = runTest ./i3wm.nix; icecast = runTest ./icecast.nix; icingaweb2 = runTest ./icingaweb2.nix; ifm = runTest ./ifm.nix; ifstate = import ./ifstate { inherit runTest; }; Loading nixos/tests/icecast.nix 0 → 100644 +25 −0 Original line number Diff line number Diff line { pkgs, ... }: { name = "icecast"; meta = { inherit (pkgs.icecast.meta) maintainers; }; nodes.machine = { services.icecast = { enable = true; hostname = "nixos.test"; admin.password = "test"; }; }; testScript = '' machine.wait_for_unit("icecast.service") machine.wait_for_open_port(8000) machine.succeed("curl -fail http://localhost:8000 | grep -q 'DO NOT ATTEMPT TO PARSE ICECAST HTML OUTPUT'") ''; } pkgs/by-name/ic/icecast/package.nix +27 −15 Original line number Diff line number Diff line Loading @@ -2,36 +2,48 @@ lib, stdenv, fetchurl, libxml2, libxslt, pkg-config, curl, libvorbis, libtheora, speex, libigloo, libkate, libopus, libtheora, libvorbis, libxml2, libxslt, rhash, speex, nixosTests, }: stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: { pname = "icecast"; version = "2.4.4"; version = "2.5.0"; src = fetchurl { url = "http://downloads.xiph.org/releases/icecast/icecast-${version}.tar.gz"; sha256 = "0i2d9rhav0x6js2qhjf5iy6j2a7f0d11ail0lfv40hb1kygrgda9"; url = "http://downloads.xiph.org/releases/icecast/icecast-${finalAttrs.version}.tar.gz"; hash = "sha256-2aoHx0Ka7BnZUP9v1CXDcfdxWM00/yIPwZGywYbGfHo="; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libigloo libkate libopus libtheora libvorbis libxml2 libxslt rhash speex ]; passthru.tests = { inherit (nixosTests) icecast; }; meta = { description = "Server software for streaming multimedia"; mainProgram = "icecast"; Loading @@ -50,4 +62,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ jcumming ]; platforms = with lib.platforms; unix; }; } }) pkgs/by-name/li/libigloo/package.nix 0 → 100644 +27 −0 Original line number Diff line number Diff line { lib, stdenv, fetchurl, rhash, icecast, }: stdenv.mkDerivation (finalAttrs: { pname = "libigloo"; version = "0.9.5"; src = fetchurl { url = "https://downloads.xiph.org/releases/igloo/libigloo-${finalAttrs.version}.tar.gz"; hash = "sha256-6iLpEZ96IYiBD5kQDFFVxnYtRZWuITuawp5ptPC4cok="; }; buildInputs = [ rhash ]; doCheck = true; meta = { description = "Generic C framework used and developed by the Icecast project"; license = lib.licenses.gpl2Only; inherit (icecast.meta) maintainers; }; }) Loading
nixos/modules/services/audio/icecast.nix +37 −29 Original line number Diff line number Diff line Loading @@ -5,8 +5,14 @@ ... }: let inherit (lib) mkRemovedOptionModule mkRenamedOptionModule ; cfg = config.services.icecast; configFile = pkgs.writeText "icecast.xml" '' <?xml version="1.0"?> <icecast> <hostname>${cfg.hostname}</hostname> Loading @@ -16,7 +22,7 @@ let </authentication> <paths> <logdir>${cfg.logDir}</logdir> <logdir>/var/log/icecast</logdir> <adminroot>${pkgs.icecast}/share/icecast/admin</adminroot> <webroot>${pkgs.icecast}/share/icecast/web</webroot> <alias source="/" dest="/status.xsl"/> Loading @@ -29,18 +35,27 @@ let <security> <chroot>0</chroot> <changeowner> <user>${cfg.user}</user> <group>${cfg.group}</group> </changeowner> </security> ${cfg.extraConf} ${cfg.extraConfig} </icecast> ''; in { imports = [ (mkRemovedOptionModule [ "services" "icecast" "logDir" ] '' The log directory is now managed by systemd's LogsDirectory= directive. '') (mkRemovedOptionModule [ "services" "icecast" "user" ] '' The service now runs under the dynamically allocated `icecast` user. '') (mkRemovedOptionModule [ "services" "icecast" "group" ] '' The service now runs under the dynamically allocated `icecast` group. '') (mkRenamedOptionModule [ "services" "icecast" "extraConf" ] [ "services" "icecast" "extraConfig" ]) ]; ###### interface options = { Loading Loading @@ -69,12 +84,6 @@ in }; }; logDir = lib.mkOption { type = lib.types.path; description = "Base directory used for logging."; default = "/var/log/icecast"; }; listen = { port = lib.mkOption { type = lib.types.port; Loading @@ -89,22 +98,12 @@ in }; }; user = lib.mkOption { type = lib.types.str; description = "User privileges for the server."; default = "nobody"; }; group = lib.mkOption { type = lib.types.str; description = "Group privileges for the server."; default = "nogroup"; }; extraConf = lib.mkOption { extraConfig = lib.mkOption { type = lib.types.lines; description = "icecast.xml content."; default = ""; description = '' Extra configuration added to {file}`icecast.xml` inside the `<icecast>` element. ''; }; }; Loading @@ -120,11 +119,20 @@ in description = "Icecast Network Audio Streaming Server"; wantedBy = [ "multi-user.target" ]; preStart = "mkdir -p ${cfg.logDir} && chown ${cfg.user}:${cfg.group} ${cfg.logDir}"; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.icecast}/bin/icecast -c ${configFile}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; DynamicUser = true; ExecStart = toString [ (lib.getExe pkgs.icecast) "-c" configFile ]; ExecReload = toString [ (lib.getExe' pkgs.coreutils "kill") "-HUP" "$MAINPID" ]; LogsDirectory = "icecast"; }; }; Loading
nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -748,6 +748,7 @@ in hydra = runTest ./hydra; i18n = runTest ./i18n.nix; i3wm = runTest ./i3wm.nix; icecast = runTest ./icecast.nix; icingaweb2 = runTest ./icingaweb2.nix; ifm = runTest ./ifm.nix; ifstate = import ./ifstate { inherit runTest; }; Loading
nixos/tests/icecast.nix 0 → 100644 +25 −0 Original line number Diff line number Diff line { pkgs, ... }: { name = "icecast"; meta = { inherit (pkgs.icecast.meta) maintainers; }; nodes.machine = { services.icecast = { enable = true; hostname = "nixos.test"; admin.password = "test"; }; }; testScript = '' machine.wait_for_unit("icecast.service") machine.wait_for_open_port(8000) machine.succeed("curl -fail http://localhost:8000 | grep -q 'DO NOT ATTEMPT TO PARSE ICECAST HTML OUTPUT'") ''; }
pkgs/by-name/ic/icecast/package.nix +27 −15 Original line number Diff line number Diff line Loading @@ -2,36 +2,48 @@ lib, stdenv, fetchurl, libxml2, libxslt, pkg-config, curl, libvorbis, libtheora, speex, libigloo, libkate, libopus, libtheora, libvorbis, libxml2, libxslt, rhash, speex, nixosTests, }: stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: { pname = "icecast"; version = "2.4.4"; version = "2.5.0"; src = fetchurl { url = "http://downloads.xiph.org/releases/icecast/icecast-${version}.tar.gz"; sha256 = "0i2d9rhav0x6js2qhjf5iy6j2a7f0d11ail0lfv40hb1kygrgda9"; url = "http://downloads.xiph.org/releases/icecast/icecast-${finalAttrs.version}.tar.gz"; hash = "sha256-2aoHx0Ka7BnZUP9v1CXDcfdxWM00/yIPwZGywYbGfHo="; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libigloo libkate libopus libtheora libvorbis libxml2 libxslt rhash speex ]; passthru.tests = { inherit (nixosTests) icecast; }; meta = { description = "Server software for streaming multimedia"; mainProgram = "icecast"; Loading @@ -50,4 +62,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ jcumming ]; platforms = with lib.platforms; unix; }; } })
pkgs/by-name/li/libigloo/package.nix 0 → 100644 +27 −0 Original line number Diff line number Diff line { lib, stdenv, fetchurl, rhash, icecast, }: stdenv.mkDerivation (finalAttrs: { pname = "libigloo"; version = "0.9.5"; src = fetchurl { url = "https://downloads.xiph.org/releases/igloo/libigloo-${finalAttrs.version}.tar.gz"; hash = "sha256-6iLpEZ96IYiBD5kQDFFVxnYtRZWuITuawp5ptPC4cok="; }; buildInputs = [ rhash ]; doCheck = true; meta = { description = "Generic C framework used and developed by the Icecast project"; license = lib.licenses.gpl2Only; inherit (icecast.meta) maintainers; }; })