add mpd and sftp
This commit is contained in:
parent
c7ebd6e26f
commit
5191dee7ad
|
@ -15,7 +15,8 @@
|
||||||
hosts.hetzner-vm.services.vault
|
hosts.hetzner-vm.services.vault
|
||||||
hosts.hetzner-vm.services.netdata
|
hosts.hetzner-vm.services.netdata
|
||||||
hosts.hetzner-vm.services.quassel
|
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")
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
services.minecraft-server = {
|
|
||||||
enable = true;
|
|
||||||
eula = true;
|
|
||||||
openFirewall = true;
|
|
||||||
package = pkgs.papermc;
|
|
||||||
};
|
|
||||||
}
|
|
37
hosts/hetzner-vm/services/mpd.nix
Normal file
37
hosts/hetzner-vm/services/mpd.nix
Normal 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 ];
|
||||||
|
}
|
22
hosts/hetzner-vm/services/storage-sftp.nix
Normal file
22
hosts/hetzner-vm/services/storage-sftp.nix
Normal 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 ];
|
||||||
|
}
|
|
@ -68,6 +68,10 @@
|
||||||
# let vscode, vivaldi, etc work.
|
# let vscode, vivaldi, etc work.
|
||||||
security.unprivilegedUsernsClone = true;
|
security.unprivilegedUsernsClone = true;
|
||||||
|
|
||||||
|
virtualisation.virtualbox.host.enable = true;
|
||||||
|
#virtualisation.virtualbox.host.enableExtensionPack = true;
|
||||||
|
users.extraGroups.vboxusers.members = [ "chaoticryptidz" ];
|
||||||
|
|
||||||
networking.hostName = "lappy";
|
networking.hostName = "lappy";
|
||||||
time.timeZone = "Europe/London";
|
time.timeZone = "Europe/London";
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
|
Loading…
Reference in a new issue