nixos: services: flood: use upstream module
All checks were successful
ci/woodpecker/push/check Pipeline was successful

This commit is contained in:
Bruno BELANYI 2024-06-21 15:38:32 +00:00
parent c2362795d8
commit b73f6af5e0

View file

@ -1,5 +1,5 @@
# A nice UI for various torrent clients # A nice UI for various torrent clients
{ config, lib, pkgs, ... }: { config, lib, ... }:
let let
cfg = config.my.services.flood; cfg = config.my.services.flood;
in in
@ -13,31 +13,13 @@ in
example = 3000; example = 3000;
description = "Internal port for Flood UI"; description = "Internal port for Flood UI";
}; };
stateDir = mkOption {
type = types.str;
default = "flood";
example = "floodUI";
description = "Directory under `/var/run` for storing Flood's files";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services.flood = { services.flood = {
description = "Flood torrent UI"; enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = { inherit (cfg) port;
ExecStart = lib.concatStringsSep " " [
(lib.getExe pkgs.flood)
"--port ${builtins.toString cfg.port}"
"--rundir /var/lib/${cfg.stateDir}"
];
DynamicUser = true;
StateDirectory = cfg.stateDir;
ReadWritePaths = "";
};
}; };
my.services.nginx.virtualHosts = { my.services.nginx.virtualHosts = {