From 9f8a215f9e21599e4f307dc95d713760a3029462 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 13 Sep 2023 16:52:20 -0300 Subject: [PATCH] wip: simple nixos test --- flake.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/flake.nix b/flake.nix index bca870a..f354741 100644 --- a/flake.nix +++ b/flake.nix @@ -318,6 +318,21 @@ mv logfile $out ''; + simpleNixosTest = pkgs.nixosTest { + name = "simple-nixos-test"; + nodes.machine = { + users.users.nixos = { + isNormalUser = true; + initialHashedPassword = "nixos"; + }; + }; + testScript = '' + start_all(); + + machine.succeed("sudo -u nixos whoami") + ''; + }; + in rec { # The list of all packages that can be built with 'nix build'. The list # of names that can be used can be shown with 'nix flake show' @@ -335,6 +350,7 @@ checks = { psql_14 = makeCheckHarness basePackages.psql_14.bin; psql_15 = makeCheckHarness basePackages.psql_15.bin; + inherit simpleNixosTest; }; # Apps is a list of names of things that can be executed with 'nix run';