From 52f7ec87aecbc622ca4adffeba55a9797b4b72fa Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 9 Jun 2021 23:44:03 +0200 Subject: [PATCH] Configure the mutable systemd unit path when required --- nixproc/backends/systemd/test-module/default.nix | 3 ++- nixproc/backends/systemd/test-module/systemd-path.nix | 5 +++++ tests/webapps-agnostic-systemd.nix | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 nixproc/backends/systemd/test-module/systemd-path.nix diff --git a/nixproc/backends/systemd/test-module/default.nix b/nixproc/backends/systemd/test-module/default.nix index 66a340e..eddc0b3 100644 --- a/nixproc/backends/systemd/test-module/default.nix +++ b/nixproc/backends/systemd/test-module/default.nix @@ -16,7 +16,8 @@ in { inherit (profileSettings) params; - nixosModules = pkgs.lib.optional profileSettings.params.forceDisableUserChange ./xserver-autologin-module.nix; + nixosModules = pkgs.lib.optional profileSettings.params.forceDisableUserChange ./xserver-autologin-module.nix + ++ pkgs.lib.optional (!profileSettings.params.forceDisableUserChange) ./systemd-path.nix; systemPackages = [ tools.systemd diff --git a/nixproc/backends/systemd/test-module/systemd-path.nix b/nixproc/backends/systemd/test-module/systemd-path.nix new file mode 100644 index 0000000..3b885fc --- /dev/null +++ b/nixproc/backends/systemd/test-module/systemd-path.nix @@ -0,0 +1,5 @@ +{...}: + +{ + boot.extraSystemdUnitPaths = [ "/etc/systemd-mutable/system" ]; +} diff --git a/tests/webapps-agnostic-systemd.nix b/tests/webapps-agnostic-systemd.nix index 2e1dbb7..b63957a 100644 --- a/tests/webapps-agnostic-systemd.nix +++ b/tests/webapps-agnostic-systemd.nix @@ -44,6 +44,8 @@ makeTest { virtualisation.writableStore = true; virtualisation.memorySize = 1024; + boot.extraSystemdUnitPaths = [ "/etc/systemd-mutable/system" ]; + # We can't download any substitutes in a test environment. To make tests # faster, we disable substitutes so that Nix does not waste any time by # attempting to download them.