2022-09-25 12:10:22 +02:00
|
|
|
{ device }:
|
|
|
|
let
|
|
|
|
overlay = import <liminix/overlay.nix> ;
|
|
|
|
nixpkgs = import <nixpkgs> ( device.system // {overlays = [overlay]; });
|
|
|
|
inherit (nixpkgs) lib pkgs;
|
|
|
|
inherit (lib.asserts) assertMsg;
|
|
|
|
config =
|
2022-09-25 12:22:15 +02:00
|
|
|
(import <liminix/merge-modules.nix>) [./configuration.nix] pkgs;
|
2022-09-25 12:10:22 +02:00
|
|
|
res1 = assertMsg
|
|
|
|
# check we have packages from both modules
|
2022-09-25 12:22:15 +02:00
|
|
|
(config.systemPackages == ( with pkgs; [ units hello ])) "failed";
|
|
|
|
res2 = let s = config.services;
|
2022-09-25 12:10:22 +02:00
|
|
|
in assertMsg (s.a.enable && s.b.enable && (s.z != null) ) "failed";
|
|
|
|
in pkgs.writeText "foo" ''
|
|
|
|
${if res1 then "OK" else "not OK"}
|
|
|
|
${if res2 then "OK" else "not OK"}
|
|
|
|
''
|