forked from Fediversity/Fediversity
48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
let
|
|
inherit (import ../default.nix { }) pkgs;
|
|
inherit (pkgs) lib;
|
|
eval =
|
|
module:
|
|
(lib.evalModules {
|
|
modules = [
|
|
module
|
|
./data-model.nix
|
|
];
|
|
}).config;
|
|
in
|
|
{
|
|
_class = "nix-unit";
|
|
|
|
test-eval = {
|
|
expr =
|
|
let
|
|
example = eval {
|
|
runtime-configurations.nixos =
|
|
{ ... }:
|
|
{
|
|
system.stateVersion = "25.05";
|
|
};
|
|
runtime-environments.bar.nixos = { };
|
|
applications.foo = {
|
|
module =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = [
|
|
pkgs.hello
|
|
];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
has-runtime-configuration = lib.isAttrs example.runtime-configurations.nixos;
|
|
has-runtime-environment = lib.isAttrs example.runtime-environments.bar.nixos.module;
|
|
has-application = lib.isAttrs example.applications.foo.module;
|
|
};
|
|
expected = {
|
|
has-runtime-configuration = true;
|
|
has-runtime-environment = true;
|
|
has-application = true;
|
|
};
|
|
};
|
|
}
|