nixpkgs/nixos/modules
Jules Aguillon df590070b0 types.singleLineStr: strings that don't contain '\n'
Add a new type, inheriting 'types.str' but checking whether the value
doesn't contain any newline characters.

The motivation comes from a problem with the
'users.users.${u}.openssh.authorizedKeys' option.
It is easy to unintentionally insert a newline character at the end of a
string, or even in the middle, for example:

    restricted_ssh_keys = command: keys:
      let
        prefix = ''
          command="${command}",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding
        '';
      in map (key: "${prefix} ${key}") keys;

The 'prefix' string ends with a newline, which ends up in the middle of
a key entry after a few manipulations.

This is problematic because the key file is built by concatenating all
the keys with 'concatStringsSep "\n"', with result in two entries for
the faulty key:

    ''
      command="...",options...
      MY_KEY
    ''

This is hard to debug and might be dangerous. This is now caught at
build time.
2022-01-18 22:06:34 +01:00
..
config nixos/make-options-doc: turn relatedPackages into links 2022-01-02 19:46:13 +01:00
hardware onlykey: set the group correctly in the udev rule (#153618) 2022-01-05 10:29:37 -08:00
i18n/input-method nixos/documentation: split options doc build 2022-01-02 19:46:13 +01:00
installer nixos-install: copy channels before system eval 2022-01-05 18:38:49 +01:00
misc Merge pull request #153426 from 4z3/systemwide-pipewire 2022-01-05 21:33:07 +00:00
profiles Merge pull request #146288 from Artturin/mtoolsandsuch 2021-11-19 00:21:08 +02:00
programs Merge pull request #149532 from pennae/split-docs-build 2022-01-04 22:33:23 +01:00
security Merge pull request #152594 from ju1m/apparmor 2021-12-31 15:09:52 +01:00
services types.singleLineStr: strings that don't contain '\n' 2022-01-18 22:06:34 +01:00
system nixos/documentation: split options doc build 2022-01-02 19:46:13 +01:00
tasks Merge pull request #148637 from hexagonal-sun/network/gre-tap-tun 2022-01-01 17:04:29 +00:00
testing nixos/lib/qemu-flags: rename to qemu-common 2021-09-18 16:58:16 +02:00
virtualisation nixos/make-options-doc: turn relatedPackages into links 2022-01-02 19:46:13 +01:00
module-list.nix nixos/matrix-conduit: init 2022-01-03 15:36:56 +01:00
rename.nix couchpotato, nixos/couchpotato: remove 2022-01-02 13:38:11 +01:00