From f073b74c1343b8d3bc93d9f0c5bba5e8bbeabd24 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 11 Mar 2020 20:17:46 +0100 Subject: [PATCH] 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. --- nixos/modules/programs/captive-browser.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/programs/captive-browser.nix b/nixos/modules/programs/captive-browser.nix index 55d474e5c9db07..26db167507271c 100644 --- a/nixos/modules/programs/captive-browser.nix +++ b/nixos/modules/programs/captive-browser.nix @@ -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''