···772 retry(tty_matches, timeout)
773774 def send_chars(self, chars: str, delay: float | None = 0.01) -> None:
775- """
776 Simulate typing a sequence of characters on the virtual keyboard,
777 e.g., `send_chars("foobar\n")` will type the string `foobar`
778 followed by the Enter key.
···772 retry(tty_matches, timeout)
773774 def send_chars(self, chars: str, delay: float | None = 0.01) -> None:
775+ r"""
776 Simulate typing a sequence of characters on the virtual keyboard,
777 e.g., `send_chars("foobar\n")` will type the string `foobar`
778 followed by the Enter key.
+1-1
nixos/modules/programs/wayland/sway.nix
···159 # https://github.com/emersion/xdg-desktop-portal-wlr/pull/315
160 xdg.portal.config.sway = {
161 # Use xdg-desktop-portal-gtk for every portal interface...
162- default = "gtk";
163 # ... except for the ScreenCast, Screenshot and Secret
164 "org.freedesktop.impl.portal.ScreenCast" = "wlr";
165 "org.freedesktop.impl.portal.Screenshot" = "wlr";
···159 # https://github.com/emersion/xdg-desktop-portal-wlr/pull/315
160 xdg.portal.config.sway = {
161 # Use xdg-desktop-portal-gtk for every portal interface...
162+ default = [ "gtk" ];
163 # ... except for the ScreenCast, Screenshot and Secret
164 "org.freedesktop.impl.portal.ScreenCast" = "wlr";
165 "org.freedesktop.impl.portal.Screenshot" = "wlr";
···2 config,
3 lib,
4 pkgs,
5+ utils,
6 ...
7}:
8let
···79 '';
80 };
8182+ services.journald.audit = lib.mkOption {
83+ default = null;
84+ type = lib.types.nullOr lib.types.bool;
85+ description = ''
86+ If enabled systemd-journald will turn on auditing on start-up.
87+ If disabled it will turn it off. If unset it will neither enable nor disable it, leaving the previous state unchanged.
88+89+ NixOS defaults to leaving this unset as enabling audit without auditd running leads to spamming /dev/kmesg with random messages
90+ and if you enable auditd then auditd is responsible for turning auditing on.
91+92+ 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.
93+94+ If you want to for some ununderstandable reason disable auditing if auditd enabled it then you can set this option to false.
95+ It is of NixOS' opinion that setting this to false is definitely the wrong thing to do - but it's an option.
96+ '';
97+ };
98+99 services.journald.extraConfig = lib.mkOption {
100 default = "";
101 type = lib.types.lines;
···134 "syslog.socket"
135 ];
136137+ systemd.sockets.systemd-journald-audit.wantedBy = [
138+ "systemd-journald.service"
139+ "sockets.target"
140+ ];
141+142 environment.etc = {
143 "systemd/journald.conf".text = ''
144 [Journal]
···152 ${lib.optionalString (cfg.forwardToSyslog) ''
153 ForwardToSyslog=yes
154 ''}
155+ Audit=${utils.systemdUtils.lib.toOption cfg.audit}
156 ${cfg.extraConfig}
157 '';
158 };
···7 maintainers = [ lewo ];
8 };
910+ nodes.machine = {
11+ environment.systemPackages = [ pkgs.audit ];
12+ };
13+ nodes.auditd = {
14+ security.auditd.enable = true;
15+ environment.systemPackages = [ pkgs.audit ];
16+ };
17+ nodes.journaldAudit = {
18+ services.journald.audit = true;
19+ environment.systemPackages = [ pkgs.audit ];
20+ };
2122 testScript = ''
23 machine.wait_for_unit("multi-user.target")
24+ machine.succeed("journalctl --grep=systemd")
2526+ with subtest("no audit messages"):
27+ machine.fail("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
28+ machine.fail("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
29+30+ with subtest("auditd enabled"):
31+ auditd.wait_for_unit("multi-user.target")
32+33+ # logs should end up in the journald
34+ auditd.succeed("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
35+ # logs should end up in the auditd audit log
36+ auditd.succeed("grep 'unit=systemd-journald' /var/log/audit/audit.log")
37+ # logs should not end up in kmesg
38+ machine.fail("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
39+40+41+ with subtest("journald audit"):
42+ journaldAudit.wait_for_unit("multi-user.target")
43+44+ # logs should end up in the journald
45+ journaldAudit.succeed("journalctl _TRANSPORT=audit --grep 'unit=systemd-journald'")
46+ # logs should NOT end up in audit log
47+ journaldAudit.fail("grep 'unit=systemd-journald' /var/log/audit/audit.log")
48+ # FIXME: If systemd fixes #15324 this test will start failing.
49+ # You can fix this text by removing the below line.
50+ # logs ideally should NOT end up in kmesg, but they do due to
51+ # https://github.com/systemd/systemd/issues/15324
52+ journaldAudit.succeed("journalctl _TRANSPORT=kernel --grep 'unit=systemd-journald'")
53 '';
54 }
55)