add systemd timers, add beets config, add smb share

This commit is contained in:
2026-07-25 00:09:38 +02:00
parent 8cfe8b7c6f
commit 0a770e4094
8 changed files with 183 additions and 13 deletions
+31
View File
@@ -12,6 +12,7 @@
./modules/nfs.nix
./modules/navidrome.nix
./modules/slskd.nix
./modules/smb.nix
];
nix.settings.experimental-features = [
@@ -58,6 +59,7 @@
fsType = "vfat";
};
boot.zfs.forceImportRoot = false;
services.zfs.autoScrub.enable = true;
swapDevices = [ ];
@@ -87,6 +89,7 @@
shell = pkgs.fish;
};
services.tailscale.enable = true;
services.rsync.enable = true;
programs.nh.enable = true;
programs.neovim.enable = true;
@@ -117,5 +120,33 @@
};
};
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
'';
};
system.stateVersion = "26.05";
}
Generated
+49 -8
View File
@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1784725727,
"narHash": "sha256-J5+C9wsO0lhDyUalQzfplDbRjyHDYeEH5+9sdyXtwa8=",
"lastModified": 1784789275,
"narHash": "sha256-cgRTWuG+u1tBPhm01JrId2k0Bni09phVJ1Q0BZlRd7M=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "041a999e8c1c5b731913855909e68d30ca69b8e0",
"rev": "3b0e6bbd65869af1beadf5963a99befc179d209f",
"type": "github"
},
"original": {
@@ -22,24 +22,65 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1784667253,
"narHash": "sha256-35bjWl+VasRT9qKxLhZsoKBxjkyUtiwfxYOuvsZbCX0=",
"lastModified": 1784843119,
"narHash": "sha256-KUklz9QgWKgBxWXA2UOO2bFHe96ioAuDU5kdhPNR+4A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3247a2b07cc6751f9aaa1012fea55be69e6f1fe0",
"rev": "fac37c4c352c6ae34578df70dd833cfd7dfca131",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "pull/544340/head",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-patch-filetote": {
"flake": false,
"locked": {
"narHash": "sha256-GqEjefb2EZNMsTWPDqqnjrjk7G9UEn+7OID03eLHyaM=",
"type": "file",
"url": "https://github.com/NixOS/nixpkgs/pull/543082.diff"
},
"original": {
"type": "file",
"url": "https://github.com/NixOS/nixpkgs/pull/543082.diff"
}
},
"nixpkgs-patch-slskd": {
"flake": false,
"locked": {
"narHash": "sha256-QRija0sHZY/w4bS/c1LWcckPL5zYK7QFnR7OV3zfrvE=",
"type": "file",
"url": "https://github.com/NixOS/nixpkgs/pull/544340.diff"
},
"original": {
"type": "file",
"url": "https://github.com/NixOS/nixpkgs/pull/544340.diff"
}
},
"nixpkgs-patcher": {
"locked": {
"lastModified": 1781789965,
"narHash": "sha256-ZRlWPq2Qms6KbesJrj7cUe2GN7s8BZISfp9ZbrCi2x0=",
"owner": "gepbird",
"repo": "nixpkgs-patcher",
"rev": "d2abed2b94b7955e05b4e2e8a9b8ac45597ecf94",
"type": "github"
},
"original": {
"owner": "gepbird",
"repo": "nixpkgs-patcher",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nixpkgs-patch-filetote": "nixpkgs-patch-filetote",
"nixpkgs-patch-slskd": "nixpkgs-patch-slskd",
"nixpkgs-patcher": "nixpkgs-patcher"
}
}
},
+16 -3
View File
@@ -1,10 +1,19 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=pull/544340/head";
nixpkgs.url = "github:NixOS/nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-patcher.url = "github:gepbird/nixpkgs-patcher";
nixpkgs-patch-slskd = {
url = "https://github.com/NixOS/nixpkgs/pull/544340.diff";
flake = false;
};
nixpkgs-patch-filetote = {
url = "https://github.com/NixOS/nixpkgs/pull/543082.diff";
flake = false;
};
};
outputs =
@@ -12,13 +21,17 @@
self,
nixpkgs,
home-manager,
}:
nixpkgs-patch-slskd,
nixpkgs-patch-filetote,
nixpkgs-patcher
}@inputs:
let
system = "x86_64-linux";
in
{
nixosConfigurations.nixos-music = nixpkgs.lib.nixosSystem {
nixosConfigurations.nixos-music = nixpkgs-patcher.lib.nixosSystem {
inherit system;
specialArgs = inputs;
modules = [
./configuration.nix
./hardware-configuration.nix
+47
View File
@@ -0,0 +1,47 @@
{ pkgs, ...}:
{
programs.beets.enable = true;
# programs.beets.package = pkgs.beets.override {
# pluginOverrides = {
# filetote = {
# enable = true;
# };
# };
# };
programs.beets.settings = {
directory = "/home/user/Music/Tracks";
plugins = [ "fetchart" "badfiles" "edit" "fish" "hook" ];
import = {
copy = false;
move = true;
autotag = false;
write = true;
};
paths = {
default = "$albumartist/$album/$track. $artist - $title";
};
fetchart = {
auto = true;
sources = [ "filesystem" ];
};
badfiles = {
check_on_import = true;
};
hook = {
hooks = [
{
event = "item_imported";
command = "echo test";
}
];
};
};
}
+4
View File
@@ -1,5 +1,9 @@
{pkgs, ... }:
{
imports = [
./beets.nix
];
home.username = "user";
home.homeDirectory = "/home/user";
+8 -1
View File
@@ -1,8 +1,11 @@
{lib, ...}:
{
services.navidrome = {
enable = true;
user = "user";
settings = {
MusicFolder = "/media/music";
MusicFolder = "/home/user/Music";
PlaylistsPath = "Playlists";
Address = "0.0.0.0";
ScanSchedule = "@every 24h";
@@ -10,4 +13,8 @@
Scanner.PurgeMissing = "always";
};
};
systemd.services.navidrome.serviceConfig = {
ProtectHome = lib.mkForce false;
};
}
+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";
};
};
};
}
+4 -1
View File
@@ -14,7 +14,10 @@
nodejs
gomi
slskd
sops
bun
croc
mp3val
flac
(python314.withPackages(ps: with ps; [ requests python-dotenv ]))
]);
}