have nas start flood as a service, with rtorrent to come
This commit is contained in:
parent
670918b734
commit
c5aa3bdcf4
2 changed files with 53 additions and 6 deletions
|
|
@ -51,7 +51,10 @@ in
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
deployment.targetHost = nasIp;
|
||||
imports = [ ../system/svalbard/configuration.nix ];
|
||||
imports = [
|
||||
../system/svalbard/configuration.nix
|
||||
../home/programs/flood
|
||||
];
|
||||
networking.wireless.networks.N904.pskRaw = (
|
||||
(import ../system/framework/keys.nix).wifi.N904.pskRaw
|
||||
);
|
||||
|
|
@ -63,10 +66,5 @@ in
|
|||
'';
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 2049 ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
flood
|
||||
rtorrent
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
49
nix/home/programs/flood/default.nix
Normal file
49
nix/home/programs/flood/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
#nginx
|
||||
80
|
||||
443
|
||||
];
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."torrents" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3000";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.extraUsers.flood = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
flood = {
|
||||
enable = true;
|
||||
serviceConfig = {
|
||||
User = "flood";
|
||||
WorkingDirectory = "/home/flood";
|
||||
ExecStart = "${pkgs.flood}/bin/flood";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
};
|
||||
|
||||
# rtorrent = {
|
||||
# enable = true;
|
||||
# serviceConfig = {
|
||||
# User = "flood";
|
||||
# Type = "forking";
|
||||
# ExecStart = "${pkgs.rtorrent}/bin/rtorrent";
|
||||
# Restart = "on-failure";
|
||||
# };
|
||||
# wantedBy = [ "multi-user.target" ];
|
||||
# after = [ "network.target" ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue