seafile: removed useless module
This commit is contained in:
parent
5cf17fa66f
commit
fa39f83193
4 changed files with 33 additions and 97 deletions
|
@ -11,8 +11,8 @@
|
|||
./graylog.nix
|
||||
./jenkins.nix
|
||||
./kibana.nix
|
||||
./lektor-gaykraft.nix
|
||||
./lektor-terranix.nix
|
||||
#./lektor-gaykraft.nix
|
||||
#./lektor-terranix.nix
|
||||
./mail-fetcher.nix
|
||||
./packages.nix
|
||||
./prometheus.nix
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
|
||||
hostname = "seafile.gaykraft.com";
|
||||
port = 3030;
|
||||
home = "/home/seafile";
|
||||
serviceName = "seafile-docker";
|
||||
|
||||
in {
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
@ -7,19 +15,34 @@
|
|||
"seafile.${config.networking.hostName}.private" = {
|
||||
serverAliases = [ ];
|
||||
locations."/" = {
|
||||
proxyPass = "http://${config.networking.hostName}.private:${
|
||||
toString config.custom.services.seafile.port
|
||||
}";
|
||||
proxyPass =
|
||||
"http://${config.networking.hostName}.private:${toString port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
custom.services.seafile = {
|
||||
systemd.services."${serviceName}" = {
|
||||
enable = true;
|
||||
hostname = "seafile.gaykraft.com";
|
||||
port = 3030;
|
||||
home = "/home/seafile";
|
||||
description = "seafile service running as docker";
|
||||
after = [ "network.target" "docker.service" ];
|
||||
requires = [ "docker.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
# delete old instance to ensure update
|
||||
${pkgs.docker}/bin/docker stop seafile || true && ${pkgs.docker}/bin/docker rm -f seafile || true
|
||||
# start instance
|
||||
${pkgs.docker}/bin/docker run \
|
||||
--name seafile \
|
||||
--env SEAFILE_SERVER_HOSTNAME=${hostname} \
|
||||
--env SEAFILE_ADMIN_EMAIL="root@${hostname}" \
|
||||
--env SEAFILE_ADMIN_PASSWORD="${
|
||||
lib.fileContents <secrets/seafile/root>
|
||||
}" \
|
||||
--volume ${home}:/shared \
|
||||
--publish ${toString port}:80 \
|
||||
seafileltd/seafile:latest
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = lib.mkDefault true;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
./services/home-assistant.nix
|
||||
./services/lektor.nix
|
||||
./services/samba-share.nix
|
||||
./services/seafile.nix
|
||||
./services/sshd.nix
|
||||
./services/transmission.nix
|
||||
./services/videoencoder.nix
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.custom.services.seafile;
|
||||
|
||||
in {
|
||||
|
||||
options.custom.services.seafile = {
|
||||
enable = mkEnableOption "enable custom.services.seafile";
|
||||
hostname = mkOption {
|
||||
type = with types; string;
|
||||
description = ''
|
||||
hostname of the seafile server
|
||||
'';
|
||||
};
|
||||
port = mkOption {
|
||||
type = with types; int;
|
||||
description = ''
|
||||
port on where ther server runs on
|
||||
'';
|
||||
};
|
||||
home = mkOption {
|
||||
type = with types; path;
|
||||
description = ''
|
||||
folder in where the seafile stuff gets stored
|
||||
'';
|
||||
};
|
||||
serviceName = mkOption {
|
||||
type = with types; string;
|
||||
default = "seafile-docker";
|
||||
description = ''
|
||||
name of the systemd service
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
systemd.services."${cfg.serviceName}" = {
|
||||
enable = true;
|
||||
description = "seafile service running as docker";
|
||||
after = [ "network.target" "docker.service" ];
|
||||
requires = [ "docker.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = # sh
|
||||
''
|
||||
# delete old instance to ensure update
|
||||
${pkgs.docker}/bin/docker stop seafile || true && ${pkgs.docker}/bin/docker rm -f seafile || true
|
||||
# start instance
|
||||
${pkgs.docker}/bin/docker run \
|
||||
--name seafile \
|
||||
--env SEAFILE_SERVER_HOSTNAME=${cfg.hostname} \
|
||||
--env SEAFILE_ADMIN_EMAIL="root@${cfg.hostname}" \
|
||||
--env SEAFILE_ADMIN_PASSWORD="${
|
||||
lib.fileContents <secrets/seafile/root>
|
||||
}" \
|
||||
--volume ${cfg.home}:/shared \
|
||||
--publish ${toString cfg.port}:80 \
|
||||
seafileltd/seafile:latest
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
# ! todo
|
||||
# requires = [ "${config.module.backup.services.encfs."seafile".serviceName}.service" ];
|
||||
|
||||
# krops.keys."seafile".path = toString <keys/seafile/encfs>;
|
||||
#
|
||||
# module.backup.services.encfs = {
|
||||
# "seafile" = {
|
||||
# enable = true;
|
||||
# encryptedFolder = "/home/seafile.ct";
|
||||
# decryptedFolder = "/home/seafile";
|
||||
# keyFile = config.krops.keys."seafile".path;
|
||||
# requires = [ ''${config.krops.keys."seafile".serviceName}.service'' ];
|
||||
# };
|
||||
# };
|
||||
|
Loading…
Reference in a new issue