feat: MPD
This commit is contained in:
79
modules/home/mpd.nix
Normal file
79
modules/home/mpd.nix
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.sydnix.mpd;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
sydnix.mpd = {
|
||||||
|
enable = mkEnableOption "Music Player Daemon";
|
||||||
|
|
||||||
|
musicDirectory = mkOption {
|
||||||
|
default = "${config.home.homeDirectory}/Music";
|
||||||
|
type = types.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
scrobbling = {
|
||||||
|
enable = mkOption {
|
||||||
|
description = "Enable scrobbling for MPD via mpdscribble.";
|
||||||
|
type = types.bool;
|
||||||
|
default = cfg.enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
endpoints = mkOption {
|
||||||
|
type = types.attrsOf (types.submodule ({ ... }: {
|
||||||
|
options = {
|
||||||
|
passwordFile = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
};
|
||||||
|
username = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
discord = {
|
||||||
|
enable = mkOption {
|
||||||
|
description = "Enable Discord integration for MPD via mpd-discord-rpc.";
|
||||||
|
type = types.bool;
|
||||||
|
default = cfg.enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
musicDirectory = cfg.musicDirectory;
|
||||||
|
extraConfig = ''
|
||||||
|
audio_output {
|
||||||
|
type "pipewire"
|
||||||
|
name "My PipeWire Output"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
# if you want to allow non-localhost connections
|
||||||
|
network.listenAddress = "any";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mpd-discord-rpc = mkIf cfg.discord.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# services.mpdscribble = mkIf cfg.scrobbling.enable {
|
||||||
|
# enable = true;
|
||||||
|
# endpoints = {
|
||||||
|
# "last.fm" = {
|
||||||
|
# passwordFile = "/etc/insecure-bullshit/lastfm-password.lol";
|
||||||
|
# username = "crumb1";
|
||||||
|
# };
|
||||||
|
# "libre.fm" = {
|
||||||
|
# passwordFile = "/etc/insecure-bullshit/librefm-password.lol";
|
||||||
|
# username = "crumbtoo";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -19,24 +19,23 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
keyFile = "/persist/user-files/${config.home.username}/key.txt";
|
keyFile = "/persist/user-files/${config.home.username}/key.txt";
|
||||||
secrets = {
|
secrets = {
|
||||||
example-user-key = {};
|
lastfm-password = {};
|
||||||
|
librefm-password = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
impermanence = {
|
mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
directories = [
|
scrobbling.endpoints = {
|
||||||
"Music"
|
"last.fm" = {
|
||||||
"Pictures"
|
passwordFile = config.sydnix.sops.secrets.lastfm-password.path;
|
||||||
"Documents"
|
username = "crumb1";
|
||||||
"Videos"
|
};
|
||||||
".ssh"
|
"libre.fm" = {
|
||||||
{
|
passwordFile = config.sydnix.sops.secrets.librefm-password.path;
|
||||||
directory = ".local/share/Steam";
|
username = "crumbtoo";
|
||||||
method = "symlink";
|
};
|
||||||
}
|
};
|
||||||
".passage"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,24 @@ let mutableSymlink = config.lib.file.mkOutOfStoreSymlink;
|
|||||||
in {
|
in {
|
||||||
home.file."org".source =
|
home.file."org".source =
|
||||||
mutableSymlink "~/Dropbox/org";
|
mutableSymlink "~/Dropbox/org";
|
||||||
|
|
||||||
|
xdg.configFile."sops/age/keys.txt".source =
|
||||||
|
mutableSymlink "/persist/user-files/${config.home.username}/key.txt";
|
||||||
|
|
||||||
|
sydnix.impermanence = {
|
||||||
|
enable = true;
|
||||||
|
directories = [
|
||||||
|
"Music"
|
||||||
|
"Pictures"
|
||||||
|
"Documents"
|
||||||
|
"Videos"
|
||||||
|
".ssh"
|
||||||
|
{
|
||||||
|
directory = ".local/share/Steam";
|
||||||
|
method = "symlink";
|
||||||
|
}
|
||||||
|
".passage"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
15
users/crumb/mpdscribble.nix
Normal file
15
users/crumb/mpdscribble.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.services.mpdscribble;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
services.mpdscribble = {
|
||||||
|
enable = mkEnableOption "the mpdscribble service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
example-user-key: ENC[AES256_GCM,data:zefLZFp/MuxwrhbNhiCRWOCG,iv:IFwI3e2+uq1yv+hWQnHcX25XGiHa3AFqeIr5LW+2KFo=,tag:yS6KzPK7robKJsupZW8a2w==,type:str]
|
lastfm-password: ENC[AES256_GCM,data:gLcWwEFLhlVdMWez5Kaja17WFUA=,iv:KT9JO0823dn6qHnK2uOacMxHf4f776/soXFUVjUi1UA=,tag:n77bHc97yoKJPYvTCWhEuQ==,type:str]
|
||||||
|
librefm-password: ENC[AES256_GCM,data:0gDlWC/2CxryI6jH5RuJ,iv:8QVnhLko3H/IupQrNknxTR8NewfTP+DJyzvHk9Hzr48=,tag:Ku02Jp7p5G5qkO41Y3EFwA==,type:str]
|
||||||
sops:
|
sops:
|
||||||
kms: []
|
kms: []
|
||||||
gcp_kms: []
|
gcp_kms: []
|
||||||
@@ -14,8 +15,8 @@ sops:
|
|||||||
VVBqSEM2bVFBU0M5YzZBQWIwUmVXUXMKvWb57Rc+rO5M8Pf7lvbSjuZB4FrHgT3A
|
VVBqSEM2bVFBU0M5YzZBQWIwUmVXUXMKvWb57Rc+rO5M8Pf7lvbSjuZB4FrHgT3A
|
||||||
uBQHH3wpv0BVVzL8tucPnwNxDnwpWvFxxwNVy/rtfs6y6HPu6fuOsA==
|
uBQHH3wpv0BVVzL8tucPnwNxDnwpWvFxxwNVy/rtfs6y6HPu6fuOsA==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2024-12-29T08:21:03Z"
|
lastmodified: "2025-01-02T08:53:07Z"
|
||||||
mac: ENC[AES256_GCM,data:08lmfeXvrhipenfCO9AjdahGSvfaUO74EVlbtjhNw+Pjlu3SQNlqTBdzPFwpebCphNnryun/WGgT6fopgyITdkd1V7DGQLV184LRe0lD5qA3DEBm+uEPBqFpXT0AYucylWEam8paZYZ8HjdPL91I1H1MTDqGcO2dYhAh59JWXfE=,iv:fY+FxlfexYkkQsYp/On/QEhiKrZyzJ6mzTaXIxY44u0=,tag:U29ULu1vNi2z/MXMz9PkTg==,type:str]
|
mac: ENC[AES256_GCM,data:MGK6/dU2DfpFS2YfX67JihtqOmHgIjdv3fK24VK5L5eooYN9EuOdOU7vqrS4F6SAbPLJ6S0/wamUnAsWZ9MID6DP1BEEVbMhzucyBAbMlQWWlC0p/eu/yW3XOlgto5MEXP6DwXTWHtgK4VKlQk+LmZpdtnm3cX1MH96WoNN9kyI=,iv:JksmtiYXeOe9/aMAc5JiCxdFtnpd8JpFEnGWEAH7gLg=,tag:7yH6rKA48pz2ECJ6L4T4sQ==,type:str]
|
||||||
pgp: []
|
pgp: []
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.9.1
|
version: 3.9.1
|
||||||
|
|||||||
Reference in New Issue
Block a user