add mpd and sftp

This commit is contained in:
ChaotiCryptidz 2022-01-23 10:30:56 +00:00
parent c7ebd6e26f
commit 5191dee7ad
5 changed files with 65 additions and 9 deletions

View file

@ -15,7 +15,8 @@
hosts.hetzner-vm.services.vault
hosts.hetzner-vm.services.netdata
hosts.hetzner-vm.services.quassel
hosts.hetzner-vm.services.minecraft
hosts.hetzner-vm.services.mpd
hosts.hetzner-vm.services.storage-sftp
(modulesPath + "/profiles/qemu-guest.nix")
];

View file

@ -1,8 +0,0 @@
{ pkgs, ... }: {
services.minecraft-server = {
enable = true;
eula = true;
openFirewall = true;
package = pkgs.papermc;
};
}

View file

@ -0,0 +1,37 @@
{ pkgs, ... }: {
services.mpd = {
enable = true;
network.listenAddress = "0.0.0.0";
dataDir = "/mpd";
musicDirectory = "/storage/music";
playlistDirectory = "/mpd/playlists";
credentials = [{
passwordFile = "/secrets/mpd-password";
permissions = [ "read" "add" "control" "admin" ];
}];
extraConfig = ''
samplerate_converter "1"
audio_output_format "44100:16:2"
audio_output {
type "httpd"
name "HTTP Music Out"
encoder "opus"
port "8012"
bitrate "128000"
format "48000:16:2"
always_on "yes"
tags "yes"
}
'';
};
systemd.services.mpd.serviceConfig.StateDirectory = ["/mpd"];
services.nginx.virtualHosts."stream.owo.monster" = {
forceSSL = true;
enableACME = true;
locations = { "/".proxyPass = "http://127.0.0.1:8012"; };
};
networking.firewall.allowedTCPPorts = [ 6600 ];
}

View file

@ -0,0 +1,22 @@
{ ... }: {
services.vsftpd = {
enable = true;
extraConfig = ''
listen_port=4220
pasv_enable=Yes
pasv_min_port=51000
pasv_max_port=51999
'';
localUsers = true;
userlistEnable = true;
userlist = ["ftp-user"];
localRoot = "/storage";
};
users.users.ftp-user = {
isSystemUser = true;
group = "ftp-user";
};
users.groups.ftp-user = {};
networking.firewall.allowedTCPPortRanges = [ { from = 51000; to = 51999; } ];
networking.firewall.allowedTCPPorts = [ 4220 ];
}

View file

@ -68,6 +68,10 @@
# let vscode, vivaldi, etc work.
security.unprivilegedUsernsClone = true;
virtualisation.virtualbox.host.enable = true;
#virtualisation.virtualbox.host.enableExtensionPack = true;
users.extraGroups.vboxusers.members = [ "chaoticryptidz" ];
networking.hostName = "lappy";
time.timeZone = "Europe/London";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";