mirror of
https://github.com/kmein/niveum
synced 2026-03-21 20:31:07 +01:00
Compare commits
1 Commits
8ffb0bd245
...
tahina
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e96539faa |
@@ -19,7 +19,6 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
services.gnome-keyring.enable = true;
|
|
||||||
services.nextcloud-client = {
|
services.nextcloud-client = {
|
||||||
enable = true;
|
enable = true;
|
||||||
startInBackground = true;
|
startInBackground = true;
|
||||||
|
|||||||
@@ -262,6 +262,5 @@ in {
|
|||||||
./vscode.nix
|
./vscode.nix
|
||||||
./watson.nix
|
./watson.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
./tor.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ in {
|
|||||||
scripts.vimv
|
scripts.vimv
|
||||||
scripts.swallow # window swallowing
|
scripts.swallow # window swallowing
|
||||||
scripts.literature-quote
|
scripts.literature-quote
|
||||||
jless # less(1) for json
|
scripts.nav # json navigation
|
||||||
scripts.notetags
|
scripts.notetags
|
||||||
scripts.booksplit
|
scripts.booksplit
|
||||||
scripts.dmenurandr
|
scripts.dmenurandr
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
services.tor.enable = true;
|
services.tor.enable = true;
|
||||||
environment.systemPackages = [pkgs.tor];
|
services.tor.torsocks.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
349
lib/streams.nix
349
lib/streams.nix
File diff suppressed because it is too large
Load Diff
@@ -11,22 +11,23 @@ in {
|
|||||||
<niveum/configs/spacetime.nix>
|
<niveum/configs/spacetime.nix>
|
||||||
<niveum/modules/retiolum.nix>
|
<niveum/modules/retiolum.nix>
|
||||||
<niveum/configs/sshd.nix>
|
<niveum/configs/sshd.nix>
|
||||||
|
{
|
||||||
|
console.keyMap = "de";
|
||||||
|
i18n.defaultLocale = "de_DE.UTF-8";
|
||||||
|
services.xserver = {
|
||||||
|
layout = "de";
|
||||||
|
libinput.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
nix.nixPath = ["/var/src"];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.nixPath = ["/var/src"];
|
|
||||||
|
|
||||||
console.keyMap = "de";
|
|
||||||
i18n.defaultLocale = "de_DE.UTF-8";
|
|
||||||
services.xserver = {
|
|
||||||
layout = "de";
|
|
||||||
libinput.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.xenos = {
|
users.users.xenos = {
|
||||||
name = "xenos";
|
name = "xenos";
|
||||||
password = "xenos";
|
password = "xenos";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = ["networkmanager"];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
|||||||
@@ -36,12 +36,7 @@
|
|||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [];
|
||||||
{
|
|
||||||
device = "/swapfile";
|
|
||||||
size = 2048;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,20 +72,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.mpd-playlists = let
|
system.activationScripts.mpd-playlists = let
|
||||||
makePlaylist = name: streams: pkgs.writeText "name.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
playlistFile = pkgs.writeText "radio.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
||||||
tags = lib.lists.unique (lib.concatMap ({tags ? [], ...}: tags) streams);
|
|
||||||
in ''
|
in ''
|
||||||
rm -rf /var/lib/mpd/playlists
|
rm -rf /var/lib/mpd/playlists
|
||||||
install -d /var/lib/mpd/playlists
|
install -d /var/lib/mpd/playlists
|
||||||
ln -sfn "${toString (makePlaylist "all" streams)}" "/var/lib/mpd/playlists/all.m3u"
|
ln -sfn "${toString playlistFile}" "/var/lib/mpd/playlists/radio.m3u"
|
||||||
${lib.concatMapStringsSep "\n" (
|
|
||||||
tag: let
|
|
||||||
playlistStreams = lib.filter ({tags ? [], ...}: lib.elem tag tags) streams;
|
|
||||||
in ''
|
|
||||||
ln -sfn "${toString (makePlaylist tag playlistStreams)}" "/var/lib/mpd/playlists/${tag}.m3u"
|
|
||||||
''
|
|
||||||
)
|
|
||||||
tags}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.tuna = {
|
services.tuna = {
|
||||||
@@ -96,15 +87,33 @@ in {
|
|||||||
logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300",
|
logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300",
|
||||||
stream,
|
stream,
|
||||||
station,
|
station,
|
||||||
...
|
|
||||||
}: {inherit id desc logo stream station;})
|
}: {inherit id desc logo stream station;})
|
||||||
streams;
|
streams;
|
||||||
webPort = 7044;
|
webPort = 8080;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.ympd = {
|
systemd.services.tuna-stations = let
|
||||||
enable = true;
|
stations = lib.lists.imap0 (id: {
|
||||||
mpd.port = config.services.mpd.network.port;
|
desc ? "",
|
||||||
|
logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300",
|
||||||
|
stream,
|
||||||
|
station,
|
||||||
|
}: {inherit id desc logo stream station;})
|
||||||
|
streams;
|
||||||
|
stationsJson = (pkgs.formats.json {}).generate "stations.json" stations;
|
||||||
|
in {
|
||||||
|
enable = false;
|
||||||
|
wantedBy = ["tuna.service"];
|
||||||
|
startAt = "hourly";
|
||||||
|
script = ''
|
||||||
|
mkdir -p /etc/tuna
|
||||||
|
antenne_asb_url=$(
|
||||||
|
${pkgs.curl}/bin/curl -sS 'https://www.caster.fm/widgets/em_player.php?jsinit=true&uid=529295&t=blue&c=' \
|
||||||
|
| grep streamUrl \
|
||||||
|
| sed ${lib.escapeShellArg "s/^.*'\\([^']*\\)'.*/\\1/"}
|
||||||
|
)
|
||||||
|
${pkgs.jq}/bin/jq "map(if .station == \"Antenne ASB\" then .stream |= \"$antenne_asb_url\" else . end)" < ${stationsJson} > /etc/tuna/stations.json
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
@@ -116,7 +125,7 @@ in {
|
|||||||
virtualHosts."radio.kmein.r" = {
|
virtualHosts."radio.kmein.r" = {
|
||||||
basicAuth.dj = password;
|
basicAuth.dj = password;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${config.services.ympd.webPort}";
|
proxyPass = "http://127.0.0.1:${toString config.services.tuna.webPort}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user