massive restructure

This commit is contained in:
2026-07-30 01:02:17 +02:00
parent 0b0634530f
commit 438ce4c58e
32 changed files with 3558 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
{
imports = [
./slskd.nix
./navidrome.nix
./nfs.nix
./services.nix
./smb.nix
./zfs.nix
../scripts.nix
];
}
+20
View File
@@ -0,0 +1,20 @@
{ lib, ... }:
{
services.navidrome = {
enable = true;
user = "user";
settings = {
MusicFolder = "/home/user/Music";
PlaylistsPath = "Playlists";
Address = "0.0.0.0";
ScanSchedule = "@every 24h";
EnableInsightsCollector = false;
Scanner.PurgeMissing = "always";
};
};
systemd.services.navidrome.serviceConfig = {
ProtectHome = lib.mkForce false;
};
}
+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"
];
};
};
};
}
+31
View File
@@ -0,0 +1,31 @@
{ pkgs, ... }:
{
systemd.timers."bc-wishlist-scraper" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Unit = "bc-wishlist-scraper.service";
};
};
systemd.services."bc-wishlist-scraper" = {
script = ''
${pkgs.bash}/bin/bash /home/user/bc-wishlist-scraper/run.sh
'';
};
systemd.user.timers."scdl" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Unit = "scdl.service";
};
};
systemd.user.services."scdl" = {
script = ''
cd ~/Music/scdl && ${pkgs.scdl}/bin/scdl me -f -c --download-archive archive.txt
'';
};
}
+118
View File
@@ -0,0 +1,118 @@
{ 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;
};
feature = {
swagger = true;
};
integrations = {
webhooks = {
discord_relay = {
call = {
url = "http://localhost:5001/slskd_webhook";
};
on = [ "UploadFileComplete" ];
timeout = 5000;
retry = {
attempts = 3;
};
};
};
};
retention = {
files = {
incomplete = 20160;
};
};
};
};
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
'';
};
};
}
+24
View File
@@ -0,0 +1,24 @@
{
services.samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"workgroup" = "WORKGROUP";
"server string" = "smbnix";
"security" = "user";
"interfaces" = "lo eno1 tailscale0";
"hosts allow" = "192.168.132.0/24 100.64.0.0/10 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
};
"Music" = {
"path" = "/media/music";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"valid users" = "user";
};
};
};
}
+39
View File
@@ -0,0 +1,39 @@
{
boot.loader.grub = {
enable = true;
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
mirroredBoots = [
{
devices = [ "nodev" ];
path = "/boot";
}
];
};
fileSystems."/" = {
device = "zpool/root";
fsType = "zfs";
};
fileSystems."/nix" = {
device = "zpool/nix";
fsType = "zfs";
};
fileSystems."/var" = {
device = "zpool/var";
fsType = "zfs";
};
fileSystems."/home" = {
device = "zpool/home";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/FCFD-4472";
fsType = "vfat";
};
boot.zfs.forceImportRoot = false;
services.zfs.autoScrub.enable = true;
swapDevices = [ ];
}