118 lines
2.3 KiB
Nix
118 lines
2.3 KiB
Nix
{ pkgs, ... }:
|
|
let
|
|
downloadDir = "/mnt/Downloads";
|
|
in
|
|
{
|
|
# Enable automatic login for the user.
|
|
services = {
|
|
# sudo tailscale up --operator=$USER
|
|
# use https://hs.wetofu.me
|
|
tailscale.enable = true;
|
|
logrotate.checkConfig = false;
|
|
|
|
openssh = {
|
|
enable = true;
|
|
banner = "Must back to QingDao! Must back HOME!";
|
|
|
|
settings = {
|
|
PermitRootLogin = "no";
|
|
PasswordAuthentication = false;
|
|
};
|
|
};
|
|
|
|
ntp = {
|
|
enable = true;
|
|
servers = [
|
|
"ntp.ntsc.ac.cn" # China
|
|
];
|
|
};
|
|
|
|
transmission = {
|
|
enable = false;
|
|
openPeerPorts = true;
|
|
downloadDirPermissions = "777";
|
|
|
|
settings = {
|
|
download-dir = downloadDir;
|
|
peer-port-random-low = "42333";
|
|
peer-port-random-on-start = true;
|
|
};
|
|
};
|
|
|
|
resilio = {
|
|
enable = true;
|
|
deviceName = "Gangly4670";
|
|
enableWebUI = true;
|
|
directoryRoot = downloadDir;
|
|
};
|
|
|
|
kubo = {
|
|
enable = false;
|
|
dataDir = "/mnt/ipfs";
|
|
enableGC = true;
|
|
};
|
|
|
|
nginx = {
|
|
enable = true;
|
|
virtualHosts = {
|
|
default = {
|
|
default = true;
|
|
locations = {
|
|
"/" = {
|
|
root = "/var/lib/nginx/html";
|
|
};
|
|
|
|
"/files/" = {
|
|
alias = downloadDir;
|
|
extraConfig = "autoindex on;";
|
|
};
|
|
|
|
"/transmission" = {
|
|
proxyPass = "http://localhost:9091";
|
|
};
|
|
|
|
# resilio
|
|
"/sync" = {
|
|
proxyPass = "http://localhost:9000";
|
|
};
|
|
|
|
# kubo/ipfs
|
|
#"/ipfs" = {
|
|
# proxyPass = "http://localhost:8080";
|
|
#};
|
|
|
|
#"/ipns" = {
|
|
# proxyPass = "http://localhost:8080";
|
|
#};
|
|
|
|
#"/ipfs-ui" = {
|
|
# proxyPass = "http://localhost:5001/webui/";
|
|
#};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
samba = {
|
|
enable = true;
|
|
shares = {
|
|
share = {
|
|
path = downloadDir;
|
|
browseable = "yes";
|
|
"read only" = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
# $ nix search wget
|
|
environment.systemPackages = with pkgs; [
|
|
libraspberrypi
|
|
];
|
|
|
|
programs = {
|
|
git.enable = true;
|
|
};
|
|
}
|