summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <dasJ@users.noreply.github.com>2022-12-28 01:43:03 +0100
committerGitHub <noreply@github.com>2022-12-28 01:43:03 +0100
commit18be00a2d947ad5dd2ff6884223750f7d2e3c37e (patch)
tree0966df7d65c83da91598639dd679b5b673e468ea
parentadfc8fec7b87e598e3611eaa32f131f18b551bb3 (diff)
parent9a497aab1bcc2fc7a8acf2119df83a83290ff9ba (diff)
downloadnixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar.gz
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar.bz2
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar.lz
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar.xz
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.tar.zst
nixpkgs-18be00a2d947ad5dd2ff6884223750f7d2e3c37e.zip
Merge pull request #207801 from ElvishJerricco/systemd-stage-1-test-instrumentation
systemd-stage-1: Improve test-instrumentation output
-rw-r--r--nixos/modules/system/boot/systemd/initrd.nix11
-rw-r--r--nixos/modules/testing/test-instrumentation.nix8
2 files changed, 19 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix
index 31702499b0f..196f44ccd78 100644
--- a/nixos/modules/system/boot/systemd/initrd.nix
+++ b/nixos/modules/system/boot/systemd/initrd.nix
@@ -148,6 +148,16 @@ in {
       visible = false;
     };
 
+    extraConfig = mkOption {
+      default = "";
+      type = types.lines;
+      example = "DefaultLimitCORE=infinity";
+      description = lib.mdDoc ''
+        Extra config options for systemd. See systemd-system.conf(5) man page
+        for available options.
+      '';
+    };
+
     contents = mkOption {
       description = lib.mdDoc "Set of files that have to be linked into the initrd";
       example = literalExpression ''
@@ -352,6 +362,7 @@ in {
         "/etc/systemd/system.conf".text = ''
           [Manager]
           DefaultEnvironment=PATH=/bin:/sbin ${optionalString (isBool cfg.emergencyAccess && cfg.emergencyAccess) "SYSTEMD_SULOGIN_FORCE=1"}
+          ${cfg.extraConfig}
         '';
 
         "/lib/modules".source = "${modulesClosure}/lib/modules";
diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix
index 4ab2578eb81..028099c6464 100644
--- a/nixos/modules/testing/test-instrumentation.nix
+++ b/nixos/modules/testing/test-instrumentation.nix
@@ -96,6 +96,12 @@ in
         MaxLevelConsole=debug
       '';
 
+    boot.initrd.systemd.contents."/etc/systemd/journald.conf".text = ''
+      [Journal]
+      ForwardToConsole=yes
+      MaxLevelConsole=debug
+    '';
+
     systemd.extraConfig = ''
       # Don't clobber the console with duplicate systemd messages.
       ShowStatus=no
@@ -107,6 +113,8 @@ in
       DefaultTimeoutStartSec=300
     '';
 
+    boot.initrd.systemd.extraConfig = config.systemd.extraConfig;
+
     boot.consoleLogLevel = 7;
 
     # Prevent tests from accessing the Internet.