Summary Files Commits Branches @commit @diff @stats
path: root / machines / marduk / configuration.nix
diff options
context:
space:
mode:
Commit1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Files4890638ba55b5d7c4ae05b751fe14c8f0b9b1713 /machines/marduk/configuration.nix
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar.gz
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.zip
Parent5a7f3676d1dd5c0792a4c1637aca04c3609b3db6 (diff)
feat(machines/marduk): Split configuration into multiple files and make code more generic
1 files changed, 20 insertions, 45 deletions
-rw-r--r--machines/marduk/configuration.nix65
diff --git a/machines/marduk/configuration.nix b/machines/marduk/configuration.nix
index 7a72ffd..d9dfc23 100644
--- a/machines/marduk/configuration.nix
+++ b/machines/marduk/configuration.nix
@@ -1,53 +1,28 @@
-{ pkgs, ... }: {
- services.dnsmasq.settings.address = [
- "/server.int/ftp.int/samba.int/mail.int/192.168.0.10"
+# This is device is meant to be a home, LOCAL ONLY server!
+# The configurations you will find are woefully insecure and hard-coded.
+{ lib, ... }: {
+ imports = [
+ ./httpd.nix
+ ./mail.nix
];
- services.httpd = {
- virtualHosts = {
- "server.int" = {
- listen = [ { port = 80; } ];
- documentRoot = "/var/www/server";
- locations."/server-status".extraConfig = ''
- SetHandler server-status
- '';
- };
-
- #== File servers ==#
-
- "samba.int" = rec {
- listen = [ { port = 80; } ];
- documentRoot = "/NetworkDirectory";
- extraConfig = ''
- <Directory "${documentRoot}">
- IndexOptions +NameWidth=* +Charset=UTF-8
- </Directory>
- '';
- };
- "ftp.int" = rec {
- listen = [ { port = 80; } ];
- documentRoot = "/home/ftp";
- extraConfig = ''
- <Directory "${documentRoot}">
- IndexOptions +NameWidth=* +Charset=UTF-8
- </Directory>
- '';
- };
+ options = {
+ constants = lib.mkOption {
+ type = lib.types.attrs;
};
};
- services.maddy = {
- localDomains = [ "mail.int" ];
-
- ensureAccounts = [
- "john@mail.int"
- "yorgus@mail.int"
- ];
- ensureCredentials = {
- # Do not use this in production. This will make passwords world-readable
- # in the Nix store
- "john@mail.int".passwordFile = "${pkgs.writeText "postmaster" "john"}";
- "yorgus@mail.int".passwordFile = "${pkgs.writeText "postmaster" "yorgus"}";
+ config = {
+ constants = {
+ # I've currently set this IP in my router configuration.
+ # It would be better to write a proper static IP NixOS config, but its
+ # fine like that.
+ ip = "192.168.0.10";
+ # This is actually a fantastic TLD. Very few sites use it, you may
+ # consider it as an abbreviation of "internal" and is one of the
+ # "original" gTLDs, introduced in 1988, so every device will always
+ # work with it.
+ tld = "int";
};
};
}