summaryrefslogtreecommitdiff
path: root/os/fscusat/modules
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-06-10 15:55:54 +0530
committersinanmohd <sinan@sinanmohd.com>2025-06-10 22:55:04 +0530
commita41037ef644dbacb3d577933fb3d93c210439b38 (patch)
treea262750bcb1357785ad8cb68b232a5ca242ee671 /os/fscusat/modules
parentcfccbd1e4026d568e23a47c060ae3ae042cceb4c (diff)
chore(repo): reformat with nixfmt-rfc-style
Diffstat (limited to 'os/fscusat/modules')
-rw-r--r--os/fscusat/modules/mirror/debian/default.nix6
-rw-r--r--os/fscusat/modules/mirror/debian/ftpsync.nix59
-rw-r--r--os/fscusat/modules/mirror/default.nix3
-rw-r--r--os/fscusat/modules/network.nix15
-rw-r--r--os/fscusat/modules/www.nix25
5 files changed, 64 insertions, 44 deletions
diff --git a/os/fscusat/modules/mirror/debian/default.nix b/os/fscusat/modules/mirror/debian/default.nix
index c0a35cd..b80c6b8 100644
--- a/os/fscusat/modules/mirror/debian/default.nix
+++ b/os/fscusat/modules/mirror/debian/default.nix
@@ -1,7 +1,9 @@
-{ config, ... }: let
+{ config, ... }:
+let
name = config.global.userdata.name;
email = config.global.userdata.email;
-in {
+in
+{
imports = [ ./ftpsync.nix ];
services.ftpsync = {
diff --git a/os/fscusat/modules/mirror/debian/ftpsync.nix b/os/fscusat/modules/mirror/debian/ftpsync.nix
index 29fb55b..d2394de 100644
--- a/os/fscusat/modules/mirror/debian/ftpsync.nix
+++ b/os/fscusat/modules/mirror/debian/ftpsync.nix
@@ -1,10 +1,15 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
let
cfg = config.services.ftpsync;
- archvsync = pkgs.callPackage ../../../pkgs/archvsync {};
+ archvsync = pkgs.callPackage ../../../pkgs/archvsync { };
- formatKeyValue = k: v: '' ${k}="${v}" '';
+ formatKeyValue = k: v: ''${k}="${v}" '';
configFormat = pkgs.formats.keyValue { mkKeyValue = formatKeyValue; };
configFile = configFormat.generate "ftpsync.conf" cfg.settings;
in
@@ -16,7 +21,7 @@ in
settings = lib.mkOption {
inherit (configFormat) type;
- default = {};
+ default = { };
description = lib.mdDoc ''
Configuration options for ftpsync.
See ftpsync.conf(5) man page for available options.
@@ -33,33 +38,35 @@ in
LOGDIR = lib.mkDefault "$LOGS_DIRECTORY";
};
- systemd = let
- name = "ftpsync";
- meta = {
- description = "Mirror Debian repositories of packages";
- documentation = [ "man:ftpsync(1)" ];
- };
- in {
- timers.${name} = meta // {
- wantedBy = [ "timers.target" ];
+ systemd =
+ let
+ name = "ftpsync";
+ meta = {
+ description = "Mirror Debian repositories of packages";
+ documentation = [ "man:ftpsync(1)" ];
+ };
+ in
+ {
+ timers.${name} = meta // {
+ wantedBy = [ "timers.target" ];
- timerConfig = {
- OnCalendar = "*-*-* 00,06,12,18:00:00";
- Unit="%i.service";
- Persistent = true;
- FixedRandomDelay = true;
- RandomizedDelaySec = "6h";
+ timerConfig = {
+ OnCalendar = "*-*-* 00,06,12,18:00:00";
+ Unit = "%i.service";
+ Persistent = true;
+ FixedRandomDelay = true;
+ RandomizedDelaySec = "6h";
+ };
};
- };
- services.${name} = meta // {
- serviceConfig = {
- LogsDirectory = name;
- StateDirectory = name;
+ services.${name} = meta // {
+ serviceConfig = {
+ LogsDirectory = name;
+ StateDirectory = name;
- ExecStart = "${archvsync}/bin/ftpsync sync:all";
+ ExecStart = "${archvsync}/bin/ftpsync sync:all";
+ };
};
};
- };
};
}
diff --git a/os/fscusat/modules/mirror/default.nix b/os/fscusat/modules/mirror/default.nix
index c5fd462..1648204 100644
--- a/os/fscusat/modules/mirror/default.nix
+++ b/os/fscusat/modules/mirror/default.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
imports = [
./debian
./www.nix
diff --git a/os/fscusat/modules/network.nix b/os/fscusat/modules/network.nix
index 53367f8..fefcd14 100644
--- a/os/fscusat/modules/network.nix
+++ b/os/fscusat/modules/network.nix
@@ -5,14 +5,19 @@ let
in
{
networking = {
- interfaces.${wan}.ipv4.addresses = [{
- address = "10.0.8.101";
- prefixLength = 16;
- }];
+ interfaces.${wan}.ipv4.addresses = [
+ {
+ address = "10.0.8.101";
+ prefixLength = 16;
+ }
+ ];
defaultGateway = {
address = "10.0.0.1";
interface = wan;
};
- nameservers = [ "10.0.0.2" "10.0.0.3" ];
+ nameservers = [
+ "10.0.0.2"
+ "10.0.0.3"
+ ];
};
}
diff --git a/os/fscusat/modules/www.nix b/os/fscusat/modules/www.nix
index 24398da..8392190 100644
--- a/os/fscusat/modules/www.nix
+++ b/os/fscusat/modules/www.nix
@@ -4,19 +4,24 @@ let
domain = "foss.fscusat.ac.in";
in
{
- networking.firewall.allowedTCPPorts = [ 80 443 ];
+ networking.firewall.allowedTCPPorts = [
+ 80
+ 443
+ ];
- sops.secrets = let
- opts = {
- owner = config.services.nginx.user;
- group = config.services.nginx.group;
+ sops.secrets =
+ let
+ opts = {
+ owner = config.services.nginx.user;
+ group = config.services.nginx.group;
+ };
+ in
+ {
+ "cusat.ac.in/key" = opts;
+ "cusat.ac.in/crt" = opts;
};
- in{
- "cusat.ac.in/key" = opts;
- "cusat.ac.in/crt" = opts;
- };
- services.nginx = {
+ services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedZstdSettings = true;