From b776bd07bcdeea14426bc502ee899c92c793d198 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Thu, 23 Jan 2025 20:35:44 +0100 Subject: [PATCH] refactor pkgs in tests --- test/common.nix | 4 ++-- test/services/arr.nix | 6 ++---- test/services/audiobookshelf.nix | 6 ++---- test/services/deluge.nix | 6 ++---- test/services/forgejo.nix | 8 +++----- test/services/hledger.nix | 6 ++---- test/services/home-assistant.nix | 4 +--- test/services/jellyfin.nix | 8 +++----- test/services/monitoring.nix | 2 -- test/services/nextcloud.nix | 7 +++---- test/services/vaultwarden.nix | 6 ++---- 11 files changed, 22 insertions(+), 41 deletions(-) diff --git a/test/common.nix b/test/common.nix index 61071bc..0d61a7a 100644 --- a/test/common.nix +++ b/test/common.nix @@ -191,7 +191,7 @@ in systemd.services.nginx.requires = [ config.shb.certs.certs.selfsigned.n.systemdService ]; }; - ldap = pkgs: { config, ... }: { + ldap = { config, pkgs, ... }: { imports = [ ../modules/blocks/ldap.nix ]; @@ -221,7 +221,7 @@ in }; }; - sso = pkgs: ssl: { config, ... }: { + sso = ssl: { config, pkgs, ... }: { imports = [ ../modules/blocks/authelia.nix ]; diff --git a/test/services/arr.nix b/test/services/arr.nix index 0d96cad..e991473 100644 --- a/test/services/arr.nix +++ b/test/services/arr.nix @@ -1,7 +1,5 @@ { pkgs, lib, ... }: let - pkgs' = pkgs; - healthUrl = "/health"; loginUrl = "/UI/Login"; @@ -130,8 +128,8 @@ let testLib.certs (basic appname) (https appname) - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) (sso appname) ]; }; diff --git a/test/services/audiobookshelf.nix b/test/services/audiobookshelf.nix index be0467b..6ee0624 100644 --- a/test/services/audiobookshelf.nix +++ b/test/services/audiobookshelf.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; commonTestScript = testLib.accessScript { @@ -91,8 +89,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/deluge.nix b/test/services/deluge.nix index 40a085e..79a5a44 100644 --- a/test/services/deluge.nix +++ b/test/services/deluge.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; commonTestScript = testLib.mkScripts { @@ -182,8 +180,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/forgejo.nix b/test/services/forgejo.nix index 24c20c9..a4322a9 100644 --- a/test/services/forgejo.nix +++ b/test/services/forgejo.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; adminPassword = "AdminPassword"; @@ -154,7 +152,7 @@ in testLib.baseModule ../../modules/services/forgejo.nix basic - (testLib.ldap pkgs') + testLib.ldap ldap ]; }; @@ -174,8 +172,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/hledger.nix b/test/services/hledger.nix index 0081f68..905543f 100644 --- a/test/services/hledger.nix +++ b/test/services/hledger.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; adminPassword = "AdminPassword"; @@ -99,8 +97,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/home-assistant.nix b/test/services/home-assistant.nix index 34b5d05..25a5109 100644 --- a/test/services/home-assistant.nix +++ b/test/services/home-assistant.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; commonTestScript = testLib.mkScripts { @@ -165,7 +163,7 @@ in testLib.baseModule ../../modules/services/home-assistant.nix basic - (testLib.ldap pkgs') + testLib.ldap ldap ]; }; diff --git a/test/services/jellyfin.nix b/test/services/jellyfin.nix index e875816..f2bbf1d 100644 --- a/test/services/jellyfin.nix +++ b/test/services/jellyfin.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; commonTestScript = testLib.mkScripts { @@ -130,7 +128,7 @@ in testLib.baseModule ../../modules/services/jellyfin.nix basic - (testLib.ldap pkgs') + testLib.ldap ldap ]; }; @@ -150,8 +148,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/monitoring.nix b/test/services/monitoring.nix index 60a7cd3..112518f 100644 --- a/test/services/monitoring.nix +++ b/test/services/monitoring.nix @@ -1,7 +1,5 @@ { pkgs, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; password = "securepw"; diff --git a/test/services/nextcloud.nix b/test/services/nextcloud.nix index 2960f3a..30beb6d 100644 --- a/test/services/nextcloud.nix +++ b/test/services/nextcloud.nix @@ -1,6 +1,5 @@ { pkgs, lib, ... }: let - pkgs' = pkgs; adminUser = "root"; adminPass = "rootpw"; oidcSecret = "oidcSecret"; @@ -332,7 +331,7 @@ in testLib.certs basic https - (testLib.ldap pkgs') + testLib.ldap ldap ]; }; @@ -352,9 +351,9 @@ in testLib.certs basic https - (testLib.ldap pkgs') + testLib.ldap ldap - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; }; diff --git a/test/services/vaultwarden.nix b/test/services/vaultwarden.nix index c938e62..43e79bc 100644 --- a/test/services/vaultwarden.nix +++ b/test/services/vaultwarden.nix @@ -1,7 +1,5 @@ { pkgs, lib, ... }: let - pkgs' = pkgs; - testLib = pkgs.callPackage ../common.nix {}; commonTestScript = testLib.mkScripts { @@ -155,8 +153,8 @@ in testLib.certs basic https - (testLib.ldap pkgs') - (testLib.sso pkgs' config.shb.certs.certs.selfsigned.n) + testLib.ldap + (testLib.sso config.shb.certs.certs.selfsigned.n) sso ]; };