summaryrefslogtreecommitdiff
path: root/hosts/fscusat/modules
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-02-17 18:31:41 +0530
committersinanmohd <sinan@sinanmohd.com>2024-02-17 21:24:02 +0530
commitbf12a289b2e4c8f22d1be781408a6d1273fd3b04 (patch)
tree6bf2eb88598db2d47119247d92be7bfb7b688b48 /hosts/fscusat/modules
parent60ed7bde534f23be9e3ee5429f72cf63ac8bfff2 (diff)
fscusat/modules/mirror: init
Diffstat (limited to 'hosts/fscusat/modules')
-rw-r--r--hosts/fscusat/modules/mirror/debian/default.nix (renamed from hosts/fscusat/modules/ftpsync/default.nix)3
-rw-r--r--hosts/fscusat/modules/mirror/debian/ftpsync.nix (renamed from hosts/fscusat/modules/ftpsync/ftpsync.nix)3
-rw-r--r--hosts/fscusat/modules/mirror/default.nix11
-rw-r--r--hosts/fscusat/modules/mirror/www.nix11
-rw-r--r--hosts/fscusat/modules/www.nix5
5 files changed, 26 insertions, 7 deletions
diff --git a/hosts/fscusat/modules/ftpsync/default.nix b/hosts/fscusat/modules/mirror/debian/default.nix
index aa214ac..da56ade 100644
--- a/hosts/fscusat/modules/ftpsync/default.nix
+++ b/hosts/fscusat/modules/mirror/debian/default.nix
@@ -12,10 +12,11 @@ in {
RSYNC_PATH = "debian";
ARCH_INCLUDE = "amd64 riscv64";
- INFO_MAINTAINER="${name} <${email}>";
+ INFO_MAINTAINER = "${name} <${email}>";
INFO_COUNTRY = "IN";
INFO_LOCATION = "Kochi, Kerala";
INFO_THROUGHPUT = "1Gb";
+ MAILTO = email;
};
};
}
diff --git a/hosts/fscusat/modules/ftpsync/ftpsync.nix b/hosts/fscusat/modules/mirror/debian/ftpsync.nix
index 8c1d170..29fb55b 100644
--- a/hosts/fscusat/modules/ftpsync/ftpsync.nix
+++ b/hosts/fscusat/modules/mirror/debian/ftpsync.nix
@@ -2,7 +2,7 @@
let
cfg = config.services.ftpsync;
- archvsync = pkgs.callPackage ../../pkgs/archvsync {};
+ archvsync = pkgs.callPackage ../../../pkgs/archvsync {};
formatKeyValue = k: v: '' ${k}="${v}" '';
configFormat = pkgs.formats.keyValue { mkKeyValue = formatKeyValue; };
@@ -54,7 +54,6 @@ in
services.${name} = meta // {
serviceConfig = {
- DynamicUser = true;
LogsDirectory = name;
StateDirectory = name;
diff --git a/hosts/fscusat/modules/mirror/default.nix b/hosts/fscusat/modules/mirror/default.nix
new file mode 100644
index 0000000..c5fd462
--- /dev/null
+++ b/hosts/fscusat/modules/mirror/default.nix
@@ -0,0 +1,11 @@
+{ ... }: {
+ imports = [
+ ./debian
+ ./www.nix
+ ];
+
+ systemd.tmpfiles.rules = [
+ "d /var/cache/mirror/ 0755 root root"
+ "L /var/cache/mirror/debian - - - - /var/lib/ftpsync/"
+ ];
+}
diff --git a/hosts/fscusat/modules/mirror/www.nix b/hosts/fscusat/modules/mirror/www.nix
new file mode 100644
index 0000000..ebde425
--- /dev/null
+++ b/hosts/fscusat/modules/mirror/www.nix
@@ -0,0 +1,11 @@
+{ ... }:
+
+let
+ domain = "foss.fscusat.ac.in";
+in
+{
+ services.nginx.virtualHosts.${domain}.locations."/mirror/" = {
+ alias = "/var/cache/mirror/";
+ extraConfig = "autoindex on;";
+ };
+}
diff --git a/hosts/fscusat/modules/www.nix b/hosts/fscusat/modules/www.nix
index 464aaa6..24398da 100644
--- a/hosts/fscusat/modules/www.nix
+++ b/hosts/fscusat/modules/www.nix
@@ -30,10 +30,7 @@ in
sslCertificateKey = config.sops.secrets."cusat.ac.in/key".path;
sslCertificate = config.sops.secrets."cusat.ac.in/crt".path;
- locations."/" = {
- return = "200 '<h1>under construction</h1>'";
- extraConfig = "add_header Content-Type text/html;";
- };
+ locations."/".extraConfig = "return 307 $scheme://$host/mirror/;";
};
};
}