-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradio.nix
More file actions
97 lines (90 loc) · 2.58 KB
/
Copy pathradio.nix
File metadata and controls
97 lines (90 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{ config, pkgs, lib, ...}:
let
cfg = config.services.amc-radio;
in
{
options.services.amc-radio = {
enable = lib.mkEnableOption "AMC Radio";
icecastPort = lib.mkOption {
type = lib.types.int;
default = 8000;
};
icecastHostname = lib.mkOption {
type = lib.types.str;
default = "aseanmotorclub.com";
};
icecastAdminPassword = lib.mkOption {
type = lib.types.str;
default = "aseanmotorclub.com";
};
};
config = lib.mkIf cfg.enable {
users.users.amc-radio = {
isSystemUser = true;
group = "amc-radio";
};
users.groups.amc-radio = {};
systemd.tmpfiles.settings = {
"amc-radio" = {
"/var/lib/radio/jingles" = {
d = {
group = "amc-radio";
user = "amc-radio";
mode = "0755";
};
};
"/var/lib/radio/prev_requests" = {
d = {
group = "amc-radio";
user = "amc-radio";
mode = "0755";
};
};
"/var/lib/radio/playlist" = {
d = {
group = "amc-radio";
user = "amc-radio";
mode = "0755";
};
};
};
};
services.icecast = {
enable = true;
hostname = cfg.icecastHostname;
admin.password = cfg.icecastHostname;
listen.address = "0.0.0.0";
listen.port = cfg.icecastPort;
extraConf = ''
<location>ASEAN Motor Club</location>
<admin>admin@aseanmotorclub.com</admin>
<limits>
<clients>100</clients>
<sources>2</sources>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<mount>
<mount-name>/stream</mount-name>
<username>source</username>
<password>hackme</password>
<max-listeners>100</max-listeners>
<public>1</public>
<stream-name>ASEAN Motor Club Radio</stream-name>
<stream-description>Your home for automotive enthusiasm in Southeast Asia</stream-description>
<stream-url>https://www.aseanmotorclub.com/radio</stream-url>
<genre>Automotive</genre>
<fallback-mount>/fallback.wav</fallback-mount>
<fallback-override>1</fallback-override>
</mount>
'';
};
services.liquidsoap.streams = {
radio = builtins.readFile ./radio.liq;
};
};
}