mirror of
https://github.com/kmein/niveum
synced 2026-03-20 03:51:07 +01:00
Compare commits
1 Commits
5d3c9a67ab
...
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;
|
||||||
}
|
}
|
||||||
|
|||||||
32
flake.lock
generated
32
flake.lock
generated
@@ -22,11 +22,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648834319,
|
"lastModified": 1647175256,
|
||||||
"narHash": "sha256-i5Aj4Aw64D/A0X6XW5LxSS4XBnYj7gMz+kN4dpsbdk8=",
|
"narHash": "sha256-7H+veXPM7IwdN1DoZqliwb9sghlN56koV5dnCu1kpsc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "0bdbdea2e26c984b096f4f7d10e3c88536a980b0",
|
"rev": "a8d00f5c038cf7ec54e7dac9c57b171c1217f008",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -109,11 +109,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648830526,
|
"lastModified": 1647992509,
|
||||||
"narHash": "sha256-vXaBIvst+KvXSRAjYBDzX4vtQERL5R4fe0/7585Msqk=",
|
"narHash": "sha256-AG40Nt5OWz0LBs5p457emOuwLKOvTtcv/2fUdnEN3Ws=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6f88260faaaa3cda8f4e478be72be6c0861c47ad",
|
"rev": "d2caa9377539e3b5ff1272ac3aa2d15f3081069f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -125,11 +125,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648941300,
|
"lastModified": 1648337267,
|
||||||
"narHash": "sha256-EYBrvRKf1DGxICfVthCmMYVivTbm8ZMFELjT5x7yQhI=",
|
"narHash": "sha256-8DRg8UDvs63iaIaHEbWG7/lnD9ImQlMNsTZMY3PvFLc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "21299f3dd3ff475f19bc8933f30ebb6a135799f1",
|
"rev": "6de161729c81dc98e844793cc9c8fda29d5ef62a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -194,11 +194,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648400983,
|
"lastModified": 1648314795,
|
||||||
"narHash": "sha256-I9ADWgUN1orbnXPBW4kulHpv8wkx6C8zsQcg9wphpPg=",
|
"narHash": "sha256-hGIXkAcGiJnVXnl8kigZpI3VFrLmAr2+yr85hi5JwP0=",
|
||||||
"owner": "kmein",
|
"owner": "kmein",
|
||||||
"repo": "scripts",
|
"repo": "scripts",
|
||||||
"rev": "f5df67a2416d8f05a7dbfea269c44668854c7887",
|
"rev": "d1d525b92a34e55b1ad886807c284106e58716b2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -210,11 +210,11 @@
|
|||||||
"stockholm": {
|
"stockholm": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1648481223,
|
"lastModified": 1648214990,
|
||||||
"narHash": "sha256-8tc3wCjUs1JQZKOU/eJy4s2jchEA2cf/62JaA4HAfqo=",
|
"narHash": "sha256-rptATGq+jcpL+P+Cr6d3OajV6zYkbHPWlt3aQNZI2TY=",
|
||||||
"ref": "master",
|
"ref": "master",
|
||||||
"rev": "b9e0a7ec71e0318a992ff2b275a6aaee3cef63bd",
|
"rev": "ae9c0b12710b5361d0d45510eb401eebfc1b3fb0",
|
||||||
"revCount": 10498,
|
"revCount": 10497,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://cgit.lassul.us/stockholm"
|
"url": "https://cgit.lassul.us/stockholm"
|
||||||
},
|
},
|
||||||
|
|||||||
350
lib/streams.nix
350
lib/streams.nix
File diff suppressed because it is too large
Load Diff
@@ -238,6 +238,16 @@ in {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "tahina";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = [
|
||||||
|
"tahina.r:${toString config.services.prometheus.exporters.node.port}"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
services.prometheus.exporters.blackbox = {
|
services.prometheus.exporters.blackbox = {
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
@@ -26,23 +26,17 @@
|
|||||||
extraModulePackages = [];
|
extraModulePackages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems."/" = {
|
||||||
"/" = {
|
device = "/dev/disk/by-uuid/e9a8bd34-61eb-4317-888d-bd7d6248a906";
|
||||||
device = "/dev/disk/by-uuid/e9a8bd34-61eb-4317-888d-bd7d6248a906";
|
fsType = "xfs";
|
||||||
fsType = "xfs";
|
|
||||||
};
|
|
||||||
"/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/9B2F-31E1";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
fileSystems."/boot" = {
|
||||||
{
|
device = "/dev/disk/by-uuid/9B2F-31E1";
|
||||||
device = "/swapfile";
|
fsType = "vfat";
|
||||||
size = 2048;
|
};
|
||||||
}
|
|
||||||
];
|
swapDevices = [];
|
||||||
|
|
||||||
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