Unverified Commit 989c0760 authored by Lin Jian's avatar Lin Jian Committed by GitHub
Browse files

nixos/kmonad: create determinate symlinks (#370053)

parents 2f8f9a06 9695e75d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -306,6 +306,8 @@

- For matrix homeserver Synapse we are now following the upstream recommendation to enable jemalloc as the memory allocator by default.

- `services.kmonad` now creates a determinate symlink (in `/dev/input/by-id/`) to each of KMonad virtual devices.

- `bind.cacheNetworks` now only controls access for recursive queries, where it previously controlled access for all queries.

- Caddy can now be built with plugins by using `caddy.withPlugins`, a `passthru` function that accepts an attribute set as a parameter. The `plugins` argument represents a list of Caddy plugins, with each Caddy plugin being a versioned module. The `hash` argument represents the `vendorHash` of the resulting Caddy source code with the plugins added.
+11 −0
Original line number Diff line number Diff line
@@ -195,6 +195,17 @@ in
  config = lib.mkIf cfg.enable {
    hardware.uinput.enable = true;

    services.udev.extraRules =
      let
        mkRule = name: ''
          ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="${name}", ATTRS{id/product}=="5679", ATTRS{id/vendor}=="1235", SYMLINK+="input/by-id/${name}"
        '';
      in
      lib.foldlAttrs (
        rules: _: keyboard:
        rules + "\n" + mkRule (mkName keyboard.name)
      ) "" cfg.keyboards;

    systemd = {
      paths = lib.mapAttrs' (_: mkPath) cfg.keyboards;
      services = lib.mapAttrs' (_: mkService) cfg.keyboards;
+2 −0
Original line number Diff line number Diff line
@@ -43,5 +43,7 @@

    with subtest("kmonad is running"):
         machine.succeed(f"systemctl status {service_name}")
    with subtest("kmonad symlink is created"):
         machine.wait_for_file(f"/dev/input/by-id/{service_name}", timeout=5)
  '';
}