feat: add wrtag
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
a3bd66771e
commit
95bf1530f5
4 changed files with 73 additions and 5 deletions
|
|
@ -2,4 +2,5 @@
|
|||
# my-module = import ./my-module.nix
|
||||
namespaced-vpn = import ./namespaced-vpn.nix;
|
||||
storagebox = import ./storagebox.nix;
|
||||
wrtagweb = import ./wrtagweb.nix;
|
||||
}
|
||||
|
|
|
|||
53
modules/nixos/wrtagweb.nix
Normal file
53
modules/nixos/wrtagweb.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.wrtagweb;
|
||||
settingsFormat = pkgs.formats.keyValue {
|
||||
mkKeyValue = lib.generators.mkKeyValueDefault { } " ";
|
||||
listsAsDuplicateKeys = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.wrtagweb = {
|
||||
|
||||
enable = lib.mkEnableOption "wrtag web";
|
||||
|
||||
settings = lib.mkOption rec {
|
||||
type = settingsFormat.type;
|
||||
apply = lib.recursiveUpdate default;
|
||||
default = {
|
||||
web-listen-addr = "127.0.0.1:7373";
|
||||
path-format = "/data/music/{{ artists .Release.Artists | sort | join \"; \" | safepath }}/({{ .Release.ReleaseGroup.FirstReleaseDate.Year }}) {{ .Release.Title | safepath }}{{ if not (eq .ReleaseDisambiguation \"\") }} ({{ .ReleaseDisambiguation | safepath }}){{ end }}/{{ pad0 2 .TrackNum }}.{{ len .Tracks | pad0 2 }} {{ if .IsCompilation }}{{ artistsString .Track.Artists | safepath }} - {{ end }}{{ .Track.Title | safepath }}{{ .Ext }}";
|
||||
};
|
||||
description = ''
|
||||
Configuration for wrtagweb
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.wrtagweb = {
|
||||
enable = true;
|
||||
isSystemUser = true;
|
||||
group = "wrtagweb";
|
||||
};
|
||||
users.groups.wrtagweb = { };
|
||||
|
||||
systemd.services.wrtagweb = {
|
||||
description = "wrtagweb";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
User = "wrtagweb";
|
||||
ExecStart = "${pkgs.unstable.wrtag}/bin/wrtagweb -config-path ${settingsFormat.generate "wrtagweb" cfg.settings}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue