This repository has been archived on 2024-11-23. You can view files and clone it, but cannot push or open issues or pull requests.
rpi3-configurations/global/software-configuration.nix

140 lines
2.8 KiB
Nix
Raw Permalink Normal View History

2023-07-18 13:52:59 +00:00
{ pkgs, ... }:
let
2023-07-23 00:04:13 +00:00
downloadDir = "/mnt/Downloads/";
2023-07-18 13:52:59 +00:00
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;
2023-07-23 01:58:03 +00:00
banner = ''
Must back to QingDao! Must back HOME!
'';
2023-07-18 13:52:59 +00:00
settings = {
2023-07-18 14:14:44 +00:00
PermitRootLogin = "no";
2023-07-18 13:52:59 +00:00
PasswordAuthentication = false;
};
};
ntp = {
enable = true;
servers = [
"ntp.ntsc.ac.cn" # China
];
};
transmission = {
2023-07-23 00:14:01 +00:00
enable = true;
2023-07-18 13:52:59 +00:00
openPeerPorts = true;
downloadDirPermissions = "777";
2023-07-23 00:29:03 +00:00
credentialsFile = "/var/secrets/transmission/settings.json";
2023-07-18 13:52:59 +00:00
2023-07-23 13:44:26 +00:00
extraFlags = [
2023-07-23 22:44:53 +00:00
"--no-auth"
2023-07-23 13:44:26 +00:00
"--no-incomplete-dir"
"--username=transmission"
];
2023-07-18 13:52:59 +00:00
settings = {
download-dir = downloadDir;
2023-07-23 00:15:42 +00:00
peer-port-random-low = 42333;
2023-07-18 13:52:59 +00:00
peer-port-random-on-start = true;
2023-07-23 04:09:23 +00:00
incomplete-dir-enabled = false;
2023-07-23 13:32:36 +00:00
incomplete-dir = "${downloadDir}.incomplete";
2023-07-18 13:52:59 +00:00
};
};
resilio = {
2023-07-23 22:36:45 +00:00
enable = false;
2023-07-18 13:52:59 +00:00
deviceName = "Gangly4670";
enableWebUI = true;
directoryRoot = downloadDir;
};
2023-07-19 07:08:34 +00:00
kubo = {
2023-07-20 06:33:16 +00:00
enable = false;
2023-07-19 07:08:34 +00:00
dataDir = "/mnt/ipfs";
enableGC = true;
};
2023-07-18 13:52:59 +00:00
nginx = {
enable = true;
virtualHosts = {
default = {
default = true;
locations = {
"/" = {
root = "/var/lib/nginx/html";
};
2023-07-18 14:19:59 +00:00
"/files/" = {
2023-07-18 13:52:59 +00:00
alias = downloadDir;
2023-07-22 22:57:35 +00:00
extraConfig = ''
autoindex on;
autoindex_exact_size off;
add_before_body /.theme/header.html;
add_after_body /.theme/footer.html;
'';
2023-07-18 13:52:59 +00:00
};
"/transmission" = {
proxyPass = "http://localhost:9091";
};
2023-07-19 07:08:34 +00:00
# resilio
2023-07-23 22:36:45 +00:00
/*"/gui" = {
2023-07-23 08:28:02 +00:00
proxyPass = "http://localhost:9000";
2023-07-23 22:36:45 +00:00
};*/
2023-07-23 08:23:01 +00:00
2023-07-19 07:08:34 +00:00
2023-07-23 01:06:22 +00:00
2023-07-19 07:08:34 +00:00
# kubo/ipfs
2023-07-22 04:46:08 +00:00
/*
"/ipfs" = {
proxyPass = "http://localhost:8080";
};
"/ipns" = {
proxyPass = "http://localhost:8080";
};
"/ipfs-ui" = {
proxyPass = "http://localhost:5001/webui/";
};
*/
2023-07-18 13:52:59 +00:00
};
};
};
};
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
2023-07-23 01:38:05 +00:00
vim
2023-07-18 13:52:59 +00:00
];
2023-07-18 14:15:45 +00:00
programs = {
git.enable = true;
};
2023-07-18 13:52:59 +00:00
}