diff --git a/checks/customer-portal/default.nix b/checks/customer-portal/default.nix new file mode 100644 index 0000000..24a1512 --- /dev/null +++ b/checks/customer-portal/default.nix @@ -0,0 +1,22 @@ +{ + pkgs, + nixosLib, + clan-core, + ... +}: +nixosLib.runTest ( + { ... }: + { + imports = [ + clan-core.modules.nixosTest.clanTest + ]; + + hostPkgs = pkgs; + + name = "service-customer-portal"; + + testScript = '' + start_all() + ''; + } +) diff --git a/checks/flake-module.nix b/checks/flake-module.nix new file mode 100644 index 0000000..205fc2d --- /dev/null +++ b/checks/flake-module.nix @@ -0,0 +1,15 @@ +{ self, ... }: +let + nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { }; +in +{ + perSystem = { pkgs, lib, ... }: + { + checks = { + service-customer-portal-test = import ./customer-portal { + inherit pkgs lib nixosLib self; + inherit (self.inputs) clan-core; + }; + }; + }; +} diff --git a/clanServices/customer-portal/default.nix b/clanServices/customer-portal/default.nix index dbbe7e6..0bc17dc 100644 --- a/clanServices/customer-portal/default.nix +++ b/clanServices/customer-portal/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ self, ... }: let inherit (builtins) readFile; in @@ -26,6 +26,8 @@ in perInstance = { instanceName, settings, machine, roles, ... }: { nixosModule = { config, pkgs, ... }: { + imports = [ self.inputs.amarth-customer-portal.nixosModules.default ]; + services.amarth-customer-portal = { enable = true; }; diff --git a/clanServices/customer-portal/flake-module.nix b/clanServices/customer-portal/flake-module.nix index fe21877..0952d2e 100644 --- a/clanServices/customer-portal/flake-module.nix +++ b/clanServices/customer-portal/flake-module.nix @@ -1,13 +1,15 @@ -{ ... }: +{ self, lib, ... }: let - module = ./default.nix; + module = lib.modules.importApply ./default.nix { inherit self; }; in { clan.modules.customer-portal = module; perSystem = { ... }: { clan.nixosTests.customer-portal = { - imports = [ ./tests/vm/default.nix ]; + imports = [ + ./tests/vm/default.nix + ]; clan.modules."@amarth/customer-portal" = module; }; diff --git a/devShells/flake-module.nix b/devShells/flake-module.nix index 6fa23fd..a36e822 100644 --- a/devShells/flake-module.nix +++ b/devShells/flake-module.nix @@ -4,9 +4,10 @@ packages = with pkgs; [ bash sops - + just + inputs'.clan-core.packages.clan-cli ]; }; }; -} \ No newline at end of file +} diff --git a/flake.nix b/flake.nix index 21aecf7..03e4d59 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ clan-core.flakeModules.default clan-core.flakeModules.testModule + # ./checks/flake-module.nix ./devShells/flake-module.nix ./clanServices/flake-module.nix ];