···772772 retry(tty_matches, timeout)
773773774774 def send_chars(self, chars: str, delay: float | None = 0.01) -> None:
775775- """
775775+ r"""
776776 Simulate typing a sequence of characters on the virtual keyboard,
777777 e.g., `send_chars("foobar\n")` will type the string `foobar`
778778 followed by the Enter key.
+1-1
nixos/modules/programs/wayland/sway.nix
···159159 # https://github.com/emersion/xdg-desktop-portal-wlr/pull/315
160160 xdg.portal.config.sway = {
161161 # Use xdg-desktop-portal-gtk for every portal interface...
162162- default = "gtk";
162162+ default = [ "gtk" ];
163163 # ... except for the ScreenCast, Screenshot and Secret
164164 "org.freedesktop.impl.portal.ScreenCast" = "wlr";
165165 "org.freedesktop.impl.portal.Screenshot" = "wlr";
+24
nixos/modules/system/boot/systemd/journald.nix
···22 config,
33 lib,
44 pkgs,
55+ utils,
56 ...
67}:
78let
···7879 '';
7980 };
80818282+ services.journald.audit = lib.mkOption {
8383+ default = null;
8484+ type = lib.types.nullOr lib.types.bool;
8585+ description = ''
8686+ If enabled systemd-journald will turn on auditing on start-up.
8787+ If disabled it will turn it off. If unset it will neither enable nor disable it, leaving the previous state unchanged.
8888+8989+ NixOS defaults to leaving this unset as enabling audit without auditd running leads to spamming /dev/kmesg with random messages
9090+ and if you enable auditd then auditd is responsible for turning auditing on.
9191+9292+ If you want to have audit logs in journald and do not mind audit logs also ending up in /dev/kmesg you can set this option to true.
9393+9494+ If you want to for some ununderstandable reason disable auditing if auditd enabled it then you can set this option to false.
9595+ It is of NixOS' opinion that setting this to false is definitely the wrong thing to do - but it's an option.
9696+ '';
9797+ };
9898+8199 services.journald.extraConfig = lib.mkOption {
82100 default = "";
83101 type = lib.types.lines;
···116134 "syslog.socket"
117135 ];
118136137137+ systemd.sockets.systemd-journald-audit.wantedBy = [
138138+ "systemd-journald.service"
139139+ "sockets.target"
140140+ ];
141141+119142 environment.etc = {
120143 "systemd/journald.conf".text = ''
121144 [Journal]
···129152 ${lib.optionalString (cfg.forwardToSyslog) ''
130153 ForwardToSyslog=yes
131154 ''}
155155+ Audit=${utils.systemdUtils.lib.toOption cfg.audit}
132156 ${cfg.extraConfig}
133157 '';
134158 };
+39-2
nixos/tests/systemd-journal.nix
···77 maintainers = [ lewo ];
88 };
991010- nodes.machine = { };
1010+ nodes.machine = {
1111+ environment.systemPackages = [ pkgs.audit ];
1212+ };
1313+ nodes.auditd = {
1414+ security.auditd.enable = true;
1515+ environment.systemPackages = [ pkgs.audit ];
1616+ };
1717+ nodes.journaldAudit = {
1818+ services.journald.audit = true;
1919+ environment.systemPackages = [ pkgs.audit ];
2020+ };
11211222 testScript = ''
1323 machine.wait_for_unit("multi-user.target")
2424+ machine.succeed("journalctl --grep=systemd")
14251515- machine.succeed("journalctl --grep=systemd")
2626+ with subtest("no audit messages"):
2727+ machine.fail("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
2828+ machine.fail("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
2929+3030+ with subtest("auditd enabled"):
3131+ auditd.wait_for_unit("multi-user.target")
3232+3333+ # logs should end up in the journald
3434+ auditd.succeed("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
3535+ # logs should end up in the auditd audit log
3636+ auditd.succeed("grep 'unit=systemd-journald' /var/log/audit/audit.log")
3737+ # logs should not end up in kmesg
3838+ machine.fail("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
3939+4040+4141+ with subtest("journald audit"):
4242+ journaldAudit.wait_for_unit("multi-user.target")
4343+4444+ # logs should end up in the journald
4545+ journaldAudit.succeed("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
4646+ # logs should NOT end up in audit log
4747+ journaldAudit.fail("grep 'unit=systemd-journald' /var/log/audit/audit.log")
4848+ # FIXME: If systemd fixes #15324 this test will start failing.
4949+ # You can fix this text by removing the below line.
5050+ # logs ideally should NOT end up in kmesg, but they do due to
5151+ # https://github.com/systemd/systemd/issues/15324
5252+ journaldAudit.succeed("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
1653 '';
1754 }
1855)