nixos/captive-browser: set chromium's data-dir to a XDG-compliant location

To quote the XDG specification:

     There is a single base directory relative to which user-specific
     data files should be written. This directory is defined by the\
     environment variable $XDG_DATA_HOME.

Rather than adding another directory to $HOME, I think that it's better
to follow this standard to avoid a cluttered home-dir.
This commit is contained in:
Maximilian Bosch 2020-03-11 20:17:46 +01:00
parent 9f3ae18145
commit f073b74c13
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -28,7 +28,7 @@ in
browser = mkOption {
type = types.str;
default = concatStringsSep " " [ ''${pkgs.chromium}/bin/chromium''
''--user-data-dir=$HOME/.chromium-captive''
''--user-data-dir=''${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive''
''--proxy-server="socks5://$PROXY"''
''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"''
''--no-first-run''