feat: standardise all services to using `services.skynet."${name}";` format

This commit is contained in:
silver 2024-05-30 14:59:20 +01:00
parent 54b43c9962
commit f8c7860eb5
Signed by: silver
GPG key ID: 54E2C71918E93B74
25 changed files with 64 additions and 48 deletions

View file

@ -6,7 +6,8 @@
...
}:
with lib; let
cfg = config.services.ldap_backend;
name = "ldap_backend";
cfg = config.services.skynet."${name}";
port_backend = "8087";
in {
imports = [
@ -17,7 +18,7 @@ in {
../../config/users.nix
];
options.services.ldap_backend = {
options.services.skynet."${name}" = {
enable = mkEnableOption "Skynet LDAP backend server";
host = {
@ -74,6 +75,7 @@ in {
locations."/".proxyPass = "http://localhost:${port_backend}";
};
# this got imported
services.skynet_ldap_backend = {
enable = true;

View file

@ -5,7 +5,8 @@
...
}:
with lib; let
cfg = config.services.skynet_ldap_client;
name = "ldap_client";
cfg = config.services.skynet."${name}";
# always ensure the admin group has access
create_filter_check_admin = x:
@ -27,9 +28,9 @@ in {
imports = [];
# 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
enable = mkEnableOption "Skynet LDAP client";

View file

@ -9,7 +9,8 @@ Gonna use a priper nixos module for this
...
}:
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}";
in {
# these are needed for teh program in question
@ -20,7 +21,7 @@ in {
./backend.nix
];
options.services.skynet_ldap = {
options.services.skynet."${name}" = {
# options that need to be passed in to make this work
enable = mkEnableOption "Skynet LDAP service";
@ -65,7 +66,7 @@ in {
config = mkIf cfg.enable {
# passthrough to the backend
services.ldap_backend = {
services.skynet.ldap_backend = {
enable = true;
host.ip = cfg.host.ip;
host.name = cfg.host.name;