nixpkgs/nixos/modules/services/x11
Klemens Nanni 987400b848 nixos/desktop-manager: Use literal newline to fix shell syntax
Running `nixos/tests/keepassxc.nix` shows:
```
machine # [   18.705390] xsession[985]: /nix/store/2g2jx5c6x3p152wbiijr0rmky7byqivc-xsession: line 13: nn: command not found
```

This garbled bash script runs without `set -o errexit` and thus skips
"\n\n" as invalid command:
```
$ cat -n /nix/store/2g2jx5c6x3p152wbiijr0rmky7byqivc-xsession
...
\n\n
            if [ -e $HOME/.background-image ]; then
              /nix/store/wq1d1ph8wj4alpx78akvpbd0a0m9qkd1-feh-3.8/bin/feh --bg-scale  $HOME/.background-image
            fi
...
```

KeePassXC uses it through
`nixos/modules/services/x11/display-managers/default.nix`:
```
...
        # Script responsible for starting the window manager and the desktop manager.
        xsession = dm: wm: pkgs.writeScript "xsession" ''
          #! ${pkgs.bash}/bin/bash

          # Legacy session script used to construct .desktop files from
          # `services.xserver.displayManager.session` entries. Called from
          # `sessionWrapper`.

          # Start the window manager.
          ${wm.start}

          # Start the desktop manager.
          ${dm.start}
...
        '';
...
```

The bogus line was introduced in PR #160752:
```
commit 0bc0dc8090
Author: Shaw Vrana <shaw@vranix.com>
Date:   Fri Feb 18 11:27:42 2022 -0800

    desktop manager script: start properly

    Adds a missing line feed when X is enabled to the start script name
    and the appended if check. Resolves #160735
```

I have not tried to reproduce the original issue and thus don't know
why "\n\n" apparently gets interpreted fine in one place but remains
literal the `xsession` case.

However, using a literal newline must be valid for all cases and
certainly fixes the warning seen in KeePassXC tests.

Furthermore, starting the nix string (`''`) with a newline as usual also
fixes its overall indentation.
2022-07-01 16:30:47 +04:00
..
desktop-managers nixos/desktop-manager: Use literal newline to fix shell syntax 2022-07-01 16:30:47 +04:00
display-managers xpra: fix whitespace 2022-06-19 18:26:10 +10:00
hardware treewide: set defaultText for options using simple path defaults 2021-12-09 01:12:13 +01:00
window-managers nixos/xmonad: adjust example to reflect v0.17.0 update of xmonad 2022-05-19 18:10:55 +02:00
clight.nix Merge pull request #84154 from eadwu/clight/location-assertion 2021-11-12 18:09:40 +01:00
colord.nix nixos/systemd: Implement a packages option for tmpfiles 2020-07-18 00:03:47 +02:00
extra-layouts.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
fractalart.nix
gdk-pixbuf.nix
imwheel.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
picom.nix nixos/picom: remove deprecated refreshRate option 2022-06-11 08:59:20 +02:00
redshift.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
terminal-server.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
touchegg.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
unclutter-xfixes.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
unclutter.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
urserver.nix nixos/urserver: init 2020-08-09 12:33:37 -07:00
urxvtd.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
xautolock.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
xbanish.nix
xfs.conf
xfs.nix
xserver.nix nixos/utils: move removePackagesByName to here from gnome 2022-04-11 15:42:49 +02:00