feat: standardise all services to using `services.skynet."${name}";
` format
This commit is contained in:
parent
54b43c9962
commit
f8c7860eb5
25 changed files with 64 additions and 48 deletions
|
@ -6,7 +6,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_vaultwarden;
|
name = "vaultwarden";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
|
|
||||||
domain_sub = "pw";
|
domain_sub = "pw";
|
||||||
domain = "${domain_sub}.skynet.ie";
|
domain = "${domain_sub}.skynet.ie";
|
||||||
|
@ -17,7 +18,7 @@ in {
|
||||||
../nginx.nix
|
../nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_vaultwarden = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet vaultwarden server";
|
enable = mkEnableOption "Skynet vaultwarden server";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.discord_bot;
|
name = "discord_bot";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.skynet_discord_bot.nixosModule."x86_64-linux"
|
inputs.skynet_discord_bot.nixosModule."x86_64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.discord_bot = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet LDAP backend server";
|
enable = mkEnableOption "Skynet LDAP backend server";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ in {
|
||||||
age.secrets.discord_mail.file = ../secrets/email/details.age;
|
age.secrets.discord_mail.file = ../secrets/email/details.age;
|
||||||
age.secrets.discord_wolves.file = ../secrets/wolves/details.age;
|
age.secrets.discord_wolves.file = ../secrets/wolves/details.age;
|
||||||
|
|
||||||
|
# this is what was imported
|
||||||
services.skynet_discord_bot = {
|
services.skynet_discord_bot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_email;
|
name = "email";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
|
|
||||||
# create teh new strings
|
# create teh new strings
|
||||||
create_filter_array = map (x: "(memberOf=cn=${x},ou=groups,${cfg.ldap.base})");
|
create_filter_array = map (x: "(memberOf=cn=${x},ou=groups,${cfg.ldap.base})");
|
||||||
|
@ -128,7 +129,7 @@ in {
|
||||||
../config/users.nix
|
../config/users.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_email = {
|
options.services.skynet."${name}" = {
|
||||||
# options that need to be passed in to make this work
|
# options that need to be passed in to make this work
|
||||||
|
|
||||||
enable = mkEnableOption "Skynet Email";
|
enable = mkEnableOption "Skynet Email";
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_games;
|
name = "games";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./dns.nix
|
./dns.nix
|
||||||
|
@ -14,7 +15,7 @@ in {
|
||||||
./games/minecraft.nix
|
./games/minecraft.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_games = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet Games";
|
enable = mkEnableOption "Skynet Games";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
@ -74,7 +75,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# the minecraft servers
|
# the minecraft servers
|
||||||
services.skynet_games_minecraft = {
|
services.skynet.games_minecraft = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_games_minecraft;
|
name = "games_minecraft";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
|
|
||||||
# got tired of how long this is so I created a var for it.
|
# got tired of how long this is so I created a var for it.
|
||||||
short_domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
short_domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
||||||
|
@ -19,7 +20,7 @@ in {
|
||||||
inputs.arion.nixosModules.arion
|
inputs.arion.nixosModules.arion
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_games_minecraft = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet Games Minecraft";
|
enable = mkEnableOption "Skynet Games Minecraft";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_gitlab;
|
name = "gitlab";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
|
|
||||||
domain_base = "${cfg.domain.base}.${cfg.domain.tld}";
|
domain_base = "${cfg.domain.base}.${cfg.domain.tld}";
|
||||||
domain_full = "${cfg.domain.sub}.${domain_base}";
|
domain_full = "${cfg.domain.sub}.${domain_base}";
|
||||||
|
@ -17,7 +18,7 @@ in {
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_gitlab = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet Gitlab";
|
enable = mkEnableOption "Skynet Gitlab";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
@ -43,7 +44,7 @@ in {
|
||||||
|
|
||||||
sub = mkOption {
|
sub = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "gitlab";
|
default = name;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,13 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_gitlab_runner;
|
name = "gitlab_runner";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_gitlab_runner = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet Gitlab Runner";
|
enable = mkEnableOption "Skynet Gitlab Runner";
|
||||||
|
|
||||||
runner = {
|
runner = {
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.ldap_backend;
|
name = "ldap_backend";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
port_backend = "8087";
|
port_backend = "8087";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -17,7 +18,7 @@ in {
|
||||||
../../config/users.nix
|
../../config/users.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.ldap_backend = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet LDAP backend server";
|
enable = mkEnableOption "Skynet LDAP backend server";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
@ -74,6 +75,7 @@ in {
|
||||||
locations."/".proxyPass = "http://localhost:${port_backend}";
|
locations."/".proxyPass = "http://localhost:${port_backend}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# this got imported
|
||||||
services.skynet_ldap_backend = {
|
services.skynet_ldap_backend = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_ldap_client;
|
name = "ldap_client";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
|
|
||||||
# always ensure the admin group has access
|
# always ensure the admin group has access
|
||||||
create_filter_check_admin = x:
|
create_filter_check_admin = x:
|
||||||
|
@ -27,9 +28,9 @@ in {
|
||||||
imports = [];
|
imports = [];
|
||||||
|
|
||||||
# give users access to this server
|
# give users access to this server
|
||||||
#services.skynet_ldap_client.groups = ["skynet-users-linux"];
|
#services.skynet.ldap_client.groups = ["skynet-users-linux"];
|
||||||
|
|
||||||
options.services.skynet_ldap_client = {
|
options.services.skynet."${name}" = {
|
||||||
# options that need to be passed in to make this work
|
# options that need to be passed in to make this work
|
||||||
|
|
||||||
enable = mkEnableOption "Skynet LDAP client";
|
enable = mkEnableOption "Skynet LDAP client";
|
||||||
|
|
|
@ -9,7 +9,8 @@ Gonna use a priper nixos module for this
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_ldap;
|
name = "ldap";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
||||||
in {
|
in {
|
||||||
# these are needed for teh program in question
|
# these are needed for teh program in question
|
||||||
|
@ -20,7 +21,7 @@ in {
|
||||||
./backend.nix
|
./backend.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_ldap = {
|
options.services.skynet."${name}" = {
|
||||||
# options that need to be passed in to make this work
|
# options that need to be passed in to make this work
|
||||||
|
|
||||||
enable = mkEnableOption "Skynet LDAP service";
|
enable = mkEnableOption "Skynet LDAP service";
|
||||||
|
@ -65,7 +66,7 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# passthrough to the backend
|
# passthrough to the backend
|
||||||
services.ldap_backend = {
|
services.skynet.ldap_backend = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host.ip = cfg.host.ip;
|
host.ip = cfg.host.ip;
|
||||||
host.name = cfg.host.name;
|
host.name = cfg.host.name;
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_nextcloud;
|
name = "nextcloud";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
domain = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -14,7 +15,7 @@ in {
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_nextcloud = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "Skynet Nextcloud";
|
enable = mkEnableOption "Skynet Nextcloud";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
@ -40,7 +41,7 @@ in {
|
||||||
|
|
||||||
sub = mkOption {
|
sub = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "nextcloud";
|
default = name;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,14 +6,15 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet;
|
name = "website";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./acme.nix
|
./acme.nix
|
||||||
./dns.nix
|
./dns.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet = {
|
options.services.skynet."${name}" = {
|
||||||
host = {
|
host = {
|
||||||
ip = mkOption {
|
ip = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_users;
|
name = "website_users";
|
||||||
php_pool = "skynet_users";
|
cfg = config.services.skynet."${name}";
|
||||||
|
php_pool = name;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./acme.nix
|
./acme.nix
|
||||||
|
@ -15,7 +16,7 @@ in {
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_users = {
|
options.services.skynet."${name}" = {
|
||||||
host = {
|
host = {
|
||||||
ip = mkOption {
|
ip = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -30,7 +31,7 @@ in {
|
||||||
# ssh access
|
# ssh access
|
||||||
|
|
||||||
# allow more than admins access
|
# allow more than admins access
|
||||||
services.skynet_ldap_client = {
|
services.skynet.ldap_client = {
|
||||||
groups = [
|
groups = [
|
||||||
"skynet-admins-linux"
|
"skynet-admins-linux"
|
||||||
"skynet-users-linux"
|
"skynet-users-linux"
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.services.skynet_ulfm;
|
name = "ulfm";
|
||||||
|
cfg = config.services.skynet."${name}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./acme.nix
|
./acme.nix
|
||||||
|
@ -14,7 +15,7 @@ in {
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.skynet_ulfm = {
|
options.services.skynet."${name}" = {
|
||||||
enable = mkEnableOption "ULFM service";
|
enable = mkEnableOption "ULFM service";
|
||||||
|
|
||||||
host = {
|
host = {
|
||||||
|
|
|
@ -98,7 +98,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# skynet-admin-linux will always be added, individual servers can override the groups option
|
# skynet-admin-linux will always be added, individual servers can override the groups option
|
||||||
services.skynet_ldap_client.enable = true;
|
services.skynet.ldap_client.enable = true;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
# every sever needs to be accessable over ssh for admin use at least
|
# every sever needs to be accessable over ssh for admin use at least
|
||||||
|
|
|
@ -53,7 +53,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_nextcloud = {
|
services.skynet.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet = {
|
services.skynet.website = {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_ulfm = {
|
services.skynet.ulfm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# we use this to pass in teh relevent infomation to the
|
# we use this to pass in teh relevent infomation to the
|
||||||
services.skynet_email = {
|
services.skynet.email = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
domain = "skynet.ie";
|
domain = "skynet.ie";
|
||||||
|
|
|
@ -54,7 +54,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_gitlab = {
|
services.skynet.gitlab = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
|
@ -60,16 +60,16 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_ldap = {
|
services.skynet.ldap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.discord_bot = {
|
services.skynet.discord_bot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_vaultwarden = {
|
services.skynet.vaultwarden = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
host = host;
|
host = host;
|
||||||
|
|
|
@ -48,7 +48,7 @@ in {
|
||||||
++ groups_trusted;
|
++ groups_trusted;
|
||||||
|
|
||||||
# allow trainees access
|
# allow trainees access
|
||||||
services.skynet_ldap_client = {
|
services.skynet.ldap_client = {
|
||||||
groups = groups;
|
groups = groups;
|
||||||
sudo_groups = groups;
|
sudo_groups = groups;
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_games = {
|
services.skynet.games = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ in {
|
||||||
|
|
||||||
services.skynet.backup.host = host;
|
services.skynet.backup.host = host;
|
||||||
|
|
||||||
services.skynet_users = {
|
services.skynet.website_users = {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ in {
|
||||||
host = host;
|
host = host;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.skynet_gitlab_runner = {
|
services.skynet.gitlab_runner = {
|
||||||
enable = true;
|
enable = true;
|
||||||
runner.name = "runner01";
|
runner.name = "runner01";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue