Some changes
This commit is contained in:
parent
67faa4a5a8
commit
39eee39807
6 changed files with 26 additions and 132 deletions
|
|
@ -33,7 +33,6 @@
|
||||||
kmonad.nixosModules.default
|
kmonad.nixosModules.default
|
||||||
agenix.nixosModule
|
agenix.nixosModule
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
self.nixosModules.flood
|
|
||||||
{ nixpkgs.overlays = [ nur.overlay agenix.overlay ]; }
|
{ nixpkgs.overlays = [ nur.overlay agenix.overlay ]; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
@ -65,8 +64,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.flood = import ./modules/flood.nix;
|
|
||||||
|
|
||||||
packages.x86_64-linux = {
|
packages.x86_64-linux = {
|
||||||
install-iso = nixos-generators.nixosGenerate {
|
install-iso = nixos-generators.nixosGenerate {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
|
||||||
|
|
@ -2,39 +2,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
transmission = {
|
|
||||||
enable = true;
|
|
||||||
group = "hosted";
|
|
||||||
settings = {
|
|
||||||
download-dir = "/data/torrent_storage/completed";
|
|
||||||
incomplete-dir = "/data/torrent_storage/incomplete";
|
|
||||||
incomplete-dir-enabled = true;
|
|
||||||
rpc-authentication-required = false;
|
|
||||||
rpc-host-whitelist-enabled = true;
|
|
||||||
rpc-whitelist-enabled = true;
|
|
||||||
peer-port = 57298;
|
|
||||||
speed-limit-down = 5000;
|
|
||||||
speed-limit-down-enabled = true;
|
|
||||||
speed-limit-up = 500;
|
|
||||||
speed-limit-up-enabled = true;
|
|
||||||
alt-speed-down = 5000;
|
|
||||||
alt-speed-enabled = false;
|
|
||||||
alt-speed-time-begin = 240;
|
|
||||||
alt-speed-time-day = 127;
|
|
||||||
alt-speed-time-enabled = true;
|
|
||||||
alt-speed-time-end = 480;
|
|
||||||
alt-speed-up = 1500;
|
|
||||||
utp-enabled = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
flood = {
|
|
||||||
enable = true;
|
|
||||||
user = "transmission";
|
|
||||||
group = "hosted";
|
|
||||||
port = "${config.ports.flood}";
|
|
||||||
};
|
|
||||||
|
|
||||||
jellyfin = {
|
jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
group = "hosted";
|
group = "hosted";
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
"librespeed" = {
|
"librespeed" = {
|
||||||
image = "lscr.io/linuxserver/librespeed:latest";
|
image = "lscr.io/linuxserver/librespeed:latest";
|
||||||
environment = {
|
environment = {
|
||||||
TZ = "Europe/Berlin";
|
TZ = "America/Bahia";
|
||||||
};
|
};
|
||||||
ports = [
|
ports = [
|
||||||
"${config.ports.librespeed}:80"
|
"${config.ports.librespeed}:80"
|
||||||
|
|
@ -27,12 +27,32 @@
|
||||||
"--pull=always"
|
"--pull=always"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
"qflood" = {
|
||||||
|
image = "cr.hotio.dev/hotio/qflood";
|
||||||
|
environment = {
|
||||||
|
PUID = "1000";
|
||||||
|
PGID = "100";
|
||||||
|
UMASK = "002";
|
||||||
|
TZ = "America/Bahia";
|
||||||
|
FLOOD_AUTH = "false";
|
||||||
|
};
|
||||||
|
volumes = [
|
||||||
|
"/data/qflood:/config"
|
||||||
|
];
|
||||||
|
ports = [
|
||||||
|
"${config.ports.flood}:3000"
|
||||||
|
"${config.ports.qbittorrent}:8080"
|
||||||
|
];
|
||||||
|
extraOptions = [
|
||||||
|
"--pull=always"
|
||||||
|
];
|
||||||
|
};
|
||||||
"syncthing" = {
|
"syncthing" = {
|
||||||
image = "lscr.io/linuxserver/syncthing:1.20.4";
|
image = "lscr.io/linuxserver/syncthing:1.20.4";
|
||||||
environment = {
|
environment = {
|
||||||
PUID = "1000";
|
PUID = "1000";
|
||||||
PGID = "100";
|
PGID = "100";
|
||||||
TZ = "Europe/Berlin";
|
TZ = "America/Bahia";
|
||||||
};
|
};
|
||||||
volumes = [
|
volumes = [
|
||||||
"/data/syncthing/config:/config"
|
"/data/syncthing/config:/config"
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
group = "hosted";
|
group = "hosted";
|
||||||
behindProxy = true;
|
behindProxy = true;
|
||||||
datastorePath = "/data/changedetection";
|
datastorePath = "/data/changedetection";
|
||||||
port = "${config.ports.changedetection-io}";
|
port = lib.toInt "${config.ports.changedetection-io}";
|
||||||
baseURL = "https://detect.baduhai.me";
|
baseURL = "https://detect.baduhai.me";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
dataDir = "/data/paperless/data";
|
dataDir = "/data/paperless/data";
|
||||||
mediaDir = "/data/paperless/media";
|
mediaDir = "/data/paperless/media";
|
||||||
passwordFile = config.age.secrets.paperless-pass.path;
|
passwordFile = config.age.secrets.paperless-pass.path;
|
||||||
port = "${config.ports.paperless}";
|
port = lib.toInt "${config.ports.paperless}";
|
||||||
consumptionDirIsPublic = true;
|
consumptionDirIsPublic = true;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
PAPERLESS_OCR_LANGUAGE = "eng+por+deu";
|
PAPERLESS_OCR_LANGUAGE = "eng+por+deu";
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
shiori = {
|
shiori = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = "${config.ports.shiori}";
|
port = lib.toInt "${config.ports.shiori}";
|
||||||
};
|
};
|
||||||
|
|
||||||
n8n.enable = true;
|
n8n.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ in
|
||||||
jellyfin = mkStringOption "8096";
|
jellyfin = mkStringOption "8096";
|
||||||
whoogle = mkStringOption "8007";
|
whoogle = mkStringOption "8007";
|
||||||
flood = mkStringOption "8008";
|
flood = mkStringOption "8008";
|
||||||
|
qbittorrent = mkStringOption "8009";
|
||||||
sonarr = mkStringOption "8989";
|
sonarr = mkStringOption "8989";
|
||||||
prowlarr = mkStringOption "9696";
|
prowlarr = mkStringOption "9696";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
with lib;
|
|
||||||
let cfg = config.services.flood;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
services.flood = {
|
|
||||||
enable = mkEnableOption (lib.mdDoc "Flood");
|
|
||||||
|
|
||||||
runDir = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "/var/lib/flood";
|
|
||||||
};
|
|
||||||
|
|
||||||
port = mkOption {
|
|
||||||
type = types.port;
|
|
||||||
default = 3030;
|
|
||||||
description = ''
|
|
||||||
The port for the Flood web interface
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
openFirewall = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Open ports in the firewall for the Flood web interface
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "flood";
|
|
||||||
description = lib.mdDoc "User account under which Flood runs.";
|
|
||||||
};
|
|
||||||
|
|
||||||
group = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "flood";
|
|
||||||
description = lib.mdDoc "Group under which Flood runs.";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = types.package;
|
|
||||||
default = pkgs.flood;
|
|
||||||
defaultText = literalExpression "pkgs.flood";
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Flood package to use.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
systemd.tmpfiles.rules =
|
|
||||||
[ "d '${cfg.runDir}' 0700 ${cfg.user} ${cfg.group} - -" ];
|
|
||||||
|
|
||||||
systemd.services.flood = {
|
|
||||||
enable = true;
|
|
||||||
description = "Flood torrent UI";
|
|
||||||
after = [ "network.target" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "simple";
|
|
||||||
ExecStart = lib.concatStringsSep " " [
|
|
||||||
"${pkgs.flood}/bin/flood"
|
|
||||||
"--port ${toString cfg.port}"
|
|
||||||
"--host 0.0.0.0"
|
|
||||||
"--rundir ${cfg.runDir}"
|
|
||||||
];
|
|
||||||
User = cfg.user;
|
|
||||||
Group = cfg.group;
|
|
||||||
Restart = "on-failure";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall =
|
|
||||||
mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; };
|
|
||||||
|
|
||||||
users.users = mkIf (cfg.user == "flood") {
|
|
||||||
flood = {
|
|
||||||
group = cfg.group;
|
|
||||||
home = cfg.runDir;
|
|
||||||
uid = config.ids.uids.flood;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups =
|
|
||||||
mkIf (cfg.group == "flood") { flood.gid = config.ids.gids.flood; };
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue