From cd7cee887b539f4742d27dfc00617f56f4632f25 Mon Sep 17 00:00:00 2001 From: picnoir Date: Wed, 8 Apr 2026 08:29:06 +0200 Subject: [PATCH 1/2] fix: remove hardcoded /etc reference. This is breaking --ephemeral --- crates/system-manager-engine/src/activate/etc_files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/system-manager-engine/src/activate/etc_files.rs b/crates/system-manager-engine/src/activate/etc_files.rs index 96bf503d..19de5ed8 100644 --- a/crates/system-manager-engine/src/activate/etc_files.rs +++ b/crates/system-manager-engine/src/activate/etc_files.rs @@ -255,7 +255,7 @@ fn list_static_entries(config_entries: &EtcFilesConfig) -> anyhow::Result Date: Wed, 8 Apr 2026 08:29:22 +0200 Subject: [PATCH 2/2] Tests: add a --ephemeral container test --ephemeral is sadly currently broken: [2026-04-08T06:25:16Z ERROR system_manager_engine::activate] Error during activation: The directory /run/systemd/system exists and is not empty, we cannot symlink it. --- .../container-tests/check-ephemeral-flag.nix | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 testFlake/container-tests/check-ephemeral-flag.nix diff --git a/testFlake/container-tests/check-ephemeral-flag.nix b/testFlake/container-tests/check-ephemeral-flag.nix new file mode 100644 index 00000000..ef8aabaf --- /dev/null +++ b/testFlake/container-tests/check-ephemeral-flag.nix @@ -0,0 +1,45 @@ +{ + forEachDistro, + system, + system-manager-v1-1-0, + ... +}: + +forEachDistro "check-ephemeral-flag" { + modules = [ + { + environment.etc = { + "a/bar" = { + text = "bar"; + mode = "0700"; + user = "root"; + group = "root"; + }; + }; + } + ]; + testScriptFunction = + { toplevel, hostPkgs, ... }: + '' + # Start the container + start_all() + + # Wait for systemd to be ready + machine.wait_for_unit("multi-user.target") + + def check_file(path, content): + file = machine.file(path) + assert file.exists, f"{path} should exist" + assert file.is_file, f"{path} should be a file" + assert file.contains(content), f"{path} should contain {content}" + + # Let's activate the profile with a v0 state file (using an old system-manager checkout) + activation_logs = machine.succeed("${toplevel}/bin/activate --ephemeral") + for line in activation_logs.split("\n"): + assert not "ERROR" in line, line + machine.wait_for_unit("system-manager.target") + + with subtest("Verify correct files are created"): + check_file("/run/etc/a/bar", "bar") + ''; +}