Append to /etc/inputrc

How can one append something to the default inputrc? This trick

    etc."inputrc".text = lib.mkDefault (
      lib.mkAfter ''
        # Prefix history
        "\e[A": history-search-backward
        "\e[B": history-search-forward
        "\eB": vi-bWord
        "\eF": vi-fWord
      ''
    );

does NOT work since the text is null and the actual default passed to source. I wouldn’t mind using the source if I could somehow pass there a custom merge function.

No clean way to do this, I’m afraid. It’s a known weakness of the text/source pattern.

Best you can do is find the particular default source you want to extend, and read that into text directly:

environment.etc.inputrc.text = ''
  ${builtins.readFile <nixpkgs/nixos/modules/programs/bash/inputrc>}
  # Your appended stuff here...
'';
1 Like

That’s a little sad but thank you for confirming that there’s no clean way.

1 Like