@@ -67,6 +67,7 @@
|
|||||||
murmur.enable = true;
|
murmur.enable = true;
|
||||||
anki-sync-server.enable = true;
|
anki-sync-server.enable = true;
|
||||||
vaultwarden.enable = true;
|
vaultwarden.enable = true;
|
||||||
|
beets.enable = true;
|
||||||
servarr = {
|
servarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
prowlarr.enable = true;
|
prowlarr.enable = true;
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let cfg = config.sydnix.deertopia.beets;
|
||||||
|
in {
|
||||||
|
options.sydnix.deertopia.beets = {
|
||||||
|
enable = lib.mkEnableOption "Beets";
|
||||||
|
user = lib.mkOption {
|
||||||
|
default = "beets";
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
Name of the user which owns the Beets database.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
group = lib.mkOption {
|
||||||
|
default = "beets";
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
Name of the group which owns the Beets database.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
users.users.${cfg.user} = {
|
||||||
|
description = "Beets";
|
||||||
|
isSystemUser = true;
|
||||||
|
inherit (cfg) group;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.${cfg.group} = {};
|
||||||
|
|
||||||
|
# Persist allowed directories.
|
||||||
|
sydnix.impermanence.directories = [
|
||||||
|
{
|
||||||
|
directory = "/var/lib/beets";
|
||||||
|
inherit (cfg) user group;
|
||||||
|
mode = "u=rwx,g=rwx,o=";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.beets
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.sessionVariables.BEETSDIR = "/var/lib/beets";
|
||||||
|
systemd.tmpfiles.settings."50-var-lib-beets-beets-yaml" = {
|
||||||
|
"/var/lib/beets/beets.yaml"."L+".argument =
|
||||||
|
lib.toString
|
||||||
|
(pkgs.writeText
|
||||||
|
"beets.yaml"
|
||||||
|
(lib.toJSON {
|
||||||
|
directory = "/media/library/music";
|
||||||
|
library = "/var/lib/beets/beets.db";
|
||||||
|
import = {
|
||||||
|
copy = true;
|
||||||
|
write = true;
|
||||||
|
incremental = true;
|
||||||
|
};
|
||||||
|
paths = {
|
||||||
|
default = "$albumartist/$album%aunique{} ($year)/$track $title";
|
||||||
|
singleton = "Non-Album/$artist/$title";
|
||||||
|
comp = "Compilations/$album%aunique{} ($year)/$title";
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
"slskd"
|
"slskd"
|
||||||
# Can access Nixarr's media.
|
# Can access Nixarr's media.
|
||||||
"media"
|
"media"
|
||||||
|
"beets"
|
||||||
];
|
];
|
||||||
initialHashedPassword =
|
initialHashedPassword =
|
||||||
"$y$j9T$aEFDDwdTZbAc6VQRXrkBJ0$K8wxTGTWDihyX1wxJ.ZMH//wmQFfrGGUkLkxIU0Lyq8";
|
"$y$j9T$aEFDDwdTZbAc6VQRXrkBJ0$K8wxTGTWDihyX1wxJ.ZMH//wmQFfrGGUkLkxIU0Lyq8";
|
||||||
|
|||||||
Reference in New Issue
Block a user