Working refactored (on a test server)

This commit is contained in:
Root
2021-02-25 20:45:50 +00:00
parent 372cf5fc6a
commit 42e01b0840
31 changed files with 400 additions and 194 deletions
+26 -4
View File
@@ -17,6 +17,11 @@ let
default = "fudo.org";
};
site = mkOption {
type = types.str;
description = "Site at which the host is located.";
};
local-networks = mkOption {
type = with types; listof str;
description =
@@ -51,6 +56,12 @@ let
default = [ ];
};
description = mkOption {
type = types.str;
description = "Description of this host.";
default = "Another Fudo Host.";
};
local-admins = mkOption {
type = with types; listOf str;
description =
@@ -58,6 +69,17 @@ let
default = [ ];
};
local-groups = mkOption {
type = with types; listOf str;
description = "List of groups which should exist on this host.";
default = [ ];
};
hardware-config = mkOption {
type = types.str;
description = "Path to the hardware configuration for this host.";
};
enable-gui = mkEnableOption "Install desktop GUI software.";
docker-server = mkEnableOption "Enable Docker on the current host.";
@@ -75,7 +97,7 @@ in {
hostname = config.instance.hostname;
host-cfg = config.fudo.hosts.${hostname};
site-name = host-cfg.site;
site = config.fudo.site.${site-name};
site = config.fudo.sites.${site-name};
domain-name = host-cfg.domain;
domain = config.fudo.domain.${domain-name};
@@ -96,12 +118,12 @@ in {
services.cron.mailto = domain.admin-email;
environment.systemPackages = with pkgs;
mkIf (cfg.docker-server) [ docker nix-prefetch-docker ];
mkIf (host-cfg.docker-server) [ docker nix-prefetch-docker ];
virtualisation.docker = mkIf (cfg.docker-server) {
virtualisation.docker = mkIf (host-cfg.docker-server) {
enable = true;
enableOnBoot = true;
autoprune.enable = true;
autoPrune.enable = true;
};
};
}