From bab9aa46a90a6be42fabdec8b22f3294c1ad4949 Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 25 Nov 2022 19:17:05 +0100 Subject: Add CI Tests (#161) * use systemd-run instead of machinectl * fix systemd user sessions by launching through runuser * skip mounting binfmt_misc if the kernel lacks support for it * link syschdemd/installer to static location * make check happy * test tests * add a simple installer test * add second test for exit codes * make tests responsible for checking exit code * fix: add which to path * overhaul actions workflow * move checks out of flake.nix * use GUID for image name * Split flake checks into matrix job * Check for side-effects * reformat powershell scripts * extend basic test * use pester for tests * "fix" (purposefully) failing test * rename lib -> init * Add test for systemd --user * Add test for docker-native * move release to separate workflow * change downstream workflow path * switch to a class * Test running with different user shells * Add lib implementation for Windows * Add documentation for the tests * readme: docker permissions * remove empty files --- modules/build-tarball.nix | 6 ++++-- modules/installer.nix | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/build-tarball.nix b/modules/build-tarball.nix index feba78d..5eba52d 100644 --- a/modules/build-tarball.nix +++ b/modules/build-tarball.nix @@ -75,8 +75,10 @@ in # These options make no sense without the wsl-distro module anyway system.build.tarball = pkgs.callPackage "${nixpkgs}/nixos/lib/make-system-tarball.nix" { - # No contents, structure will be added by prepare script - contents = [ ]; + + contents = [ + { source = config.users.users.root.shell; target = "/nix/nixos-wsl/entrypoint"; } + ]; fileName = "nixos-wsl-${pkgs.hostPlatform.system}"; diff --git a/modules/installer.nix b/modules/installer.nix index 3fd404f..63bdc9e 100644 --- a/modules/installer.nix +++ b/modules/installer.nix @@ -56,6 +56,7 @@ with builtins; with lib; { { source = passwd; target = "/etc/passwd"; } { source = "${pkgs.busybox}/bin/busybox"; target = "/bin/sh"; } { source = "${pkgs.busybox}/bin/busybox"; target = "/bin/mount"; } + { source = "${installer}"; target = "/nix/nixos-wsl/entrypoint"; } ]; extraCommands = pkgs.writeShellScript "prepare" '' -- cgit v1.2.3