add navidrome, nfs and slskd

This commit is contained in:
2026-07-23 01:24:08 +02:00
parent 497ca74787
commit 8cfe8b7c6f
7 changed files with 156 additions and 12 deletions
+6 -2
View File
@@ -9,6 +9,9 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./packages.nix ./packages.nix
./modules/nfs.nix
./modules/navidrome.nix
./modules/slskd.nix
]; ];
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@@ -59,10 +62,9 @@
swapDevices = [ ]; swapDevices = [ ];
networking.hostId = "6054e036"; networking.hostId = "6054e036";
networking.hostName = "nixos-music"; networking.hostName = "nixos-music";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.firewall.enable = false;
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@@ -88,6 +90,8 @@
services.rsync.enable = true; services.rsync.enable = true;
programs.nh.enable = true; programs.nh.enable = true;
programs.neovim.enable = true; programs.neovim.enable = true;
programs.tmux.enable = true;
programs.bat.enable = true;
programs.git = { programs.git = {
enable = true; enable = true;
config = { config = {
Generated
+6 -6
View File
@@ -22,16 +22,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1784497964, "lastModified": 1784667253,
"narHash": "sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU=", "narHash": "sha256-35bjWl+VasRT9qKxLhZsoKBxjkyUtiwfxYOuvsZbCX0=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "241313f4e8e508cb9b13278c2b0fa25b9ca27163", "rev": "3247a2b07cc6751f9aaa1012fea55be69e6f1fe0",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "pull/544340/head",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs?ref=pull/544340/head";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
+13
View File
@@ -0,0 +1,13 @@
{
services.navidrome = {
enable = true;
settings = {
MusicFolder = "/media/music";
PlaylistsPath = "Playlists";
Address = "0.0.0.0";
ScanSchedule = "@every 24h";
EnableInsightsCollector = false;
Scanner.PurgeMissing = "always";
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{
services.nfs.server = {
enable = true;
exports = {
"/media/music" = {
"192.168.132.0/24" = [
"rw"
"async"
"no_subtree_check"
"fsid=1"
];
};
};
};
}
+110
View File
@@ -0,0 +1,110 @@
{config, pkgs, ...}:
{
services.slskd = {
enable = true;
environmentFile = /home/user/slskd_secrets;
user = "user";
settings = {
remote_configuration = true;
remote_file_management = true;
directories = {
downloads = "/media/music/Soulseek";
};
shares = {
directories = [
"/media/music/Tracks"
"/media/music/Tracks2"
"/media/music/samples"
];
};
rooms = [
"Rare Music"
"nicotine"
"! ! LGBTQ+ ! !"
"lossless"
"Linux"
"Breakcore"
"Jungle"
];
transfers = {
upload = {
speed_limit = 3700;
};
groups = {
blacklisted = {
members = [
"relay"
"smbd"
];
};
user_defined = {
my_buddies = {
upload = {
priority = 1;
strategy = "firstinfirstout";
slots = 1000;
};
members = [
"noamifur"
"mesityl"
"diphenhydramine"
"monfi"
];
};
};
};
};
soulseek = {
description = ''
Fuck DRM. Fuck Spotify
Discord: keksnino
https://www.last.fm/user/KeksNino
'';
listen_port = 32895;
};
integrations = {
webhooks = {
discord_relay = {
call = {
url = "http://127.0.0.1:5001/slskd_webhook";
};
on = [ "UploadFileComplete" ];
timeout = 5000;
retry = {
attempts = 3;
};
};
};
};
};
};
systemd.user.services.slskd-speed = {
enable = true;
description = "Soulseek True Speed Shower";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Environment = "PYTHONUNBUFFERED=1";
Restart = "on-failure";
RestartSec = 30;
StandardOutput = "journal";
StandardError = "journal";
EnvironmentFile = "/home/user/slskd_secrets";
ExecStart = ''
${pkgs.python3}/bin/python3 /home/user/slskd-speed.py \
-u "$SLSKD_SLSK_USERNAME" \
-p "$SLSKD_SLSK_PASSWORD" \
-s 30mbit/s \
--slskd-url http://localhost:5030 \
--slskd-key "$SLSKD_API_KEY" \
--loop \
--poll-interval 30 \
--interval 900
'';
};
};
}
+5 -3
View File
@@ -1,6 +1,6 @@
{ pkgs, ... }: { { pkgs, ... }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = (with pkgs; [
wget wget
nixfmt nixfmt
tree-sitter tree-sitter
@@ -11,8 +11,10 @@
unzip unzip
scdl scdl
aria2 aria2
python3
nodejs nodejs
gomi gomi
]; slskd
sops
(python314.withPackages(ps: with ps; [ requests python-dotenv ]))
]);
} }