Change:
Describe the bug After upgrade to 20.03 nixos-activation.service don't start . Error log: nixos-activation.service - Run user-specific NixOS activation Loaded: loaded (/nix/store/jcv2nvwkdc4hlhfx2dcchw3xgnmgyk8n-unit-nixos-activation.service/nixos-activation.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-02-21 11:57:14 CET; 8s ago Process: ExecStart=/nix/store/6hls8gx0c7prqf6gc2s1q9kp5w57jnb4-unit-script-nixos-activation-start (code=exited, status=1/FAILURE) Main PID: (code=exited, status=1/FAILURE) lut 21 11:57:14 nixos systemd[1389]: Starting Run user-specific NixOS activation... lut 21 11:57:14 nixos 6hls8gx0c7prqf6gc2s1q9kp5w57jnb4-unit-script-nixos-activation-start[]: /nix/store/6hls8gx0c7prqf6gc2s1q9kp5w57jnb4-unit-script-nixos-activation-start: line 22: XDGCONFIGHOME: parameter null or not set lut 21 11:57:14 nixos systemd[1389]: nixos-activation.service: Main process exited, code=exited, status=1/FAILURE lut 21 11:57:14 nixos systemd[1389]: nixos-activation.service: Failed with result 'exit-code'. lut 21 11:57:14 nixos systemd[1389]: Failed to start Run user-specific NixOS activation. I am using home manager but empty profile without home manager is also broken. After switch channel to 19.09 everything is OK. To Reproduce Steps to reproduce the behavior: to 20.03 Additional context I am using KDE. Adding XDGCONFIGHOME to this file does not solve the problem completely. Service start but for ex. flatpak app not. Metadata Please run and paste the result. nix-shell -p nix-info --run "nix-info -m" system: host os: multi-user?: sandbox: version: channels(root): channels(piotrek): nixpkgs: Maintainer information:
caused by
I had this issue too, and it can be fixed by enabling this : I am not really sure why, this fix come from another issue that is plasma related.
cc
Yes, it's solve error related to XDGCONFIGHOME but flatpak app still fail to launch. Starting KeePassXC result in error: The name org.freedesktop.Accounts was not provided by any .service files. Unrelated problem? EDIT: Yes, it's
As far as I understand this is actually a workaround and not a real solution. iirc the suggested workaround was for a now fixed problem where plasma wouldn't start due to a hardcoded limit on env vars
It is indeed a workaround, sorry for the bad phrasing. I know this is a workaround for another issue that has been merged, but it has fixed the issue for me.

Discussion:
''; activationScript = '' <ins> ${set_XDG_CONFIG_HOME} </ins> # The KDE icon cache is supposed to update itself automatically, but it uses # the timestamp on the icon theme directory as a trigger. This doesn't work # on NixOS because the timestamp never changes. As a workaround, delete the

# xdg-desktop-settings generates this empty file but # it makes kbuildsyscoca5 fail silently. To fix this # remove that menu if it exists. <del> rm -fv ''${XDG_CONFIG_HOME:?}/menus/applications-merged/xdg-desktop-menu-dummy.menu </del> <ins> rm -fv ''${XDG_CONFIG_HOME}/menus/applications-merged/xdg-desktop-menu-dummy.menu </ins> # Qt writes a weird ‘libraryPath’ line to # ~/.config/Trolltech.conf that causes the KDE plugin

# disastrous, so here we nuke references to the Nix store # in Trolltech.conf.  A better solution would be to stop # Qt from doing this wackiness in the first place. <del> trolltech_conf="''${XDG_CONFIG_HOME:?}/Trolltech.conf" </del> <ins> trolltech_conf="''${XDG_CONFIG_HOME}/Trolltech.conf" </ins> if [ -e "$trolltech_conf" ]; then ${sed} -i "$trolltech_conf" -e '/nixstore|nix/store/ d' fi

${pkgs.libsForQt5.kservice}/bin/kbuildsycoca5 ''; <ins> set_XDG_CONFIG_HOME = '' # Set the default XDG_CONFIG_HOME if it is unset. # Per the XDG Base Directory Specification: # https://specifications.freedesktop.org/basedir-spec/latest # 1. Never export this variable! If it is unset, then child processes are # expected to set the default themselves. # 2. Contaminate / if $HOME is unset; do not check if $HOME is set. XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config} ''; </ins> startplasma = '' <del> export XDG_CONFIG_HOME="''${XDG_CONFIG_HOME:-$HOME/.config}" mkdir -p "''${XDG_CONFIG_HOME:?}" </del> <ins> ${set_XDG_CONFIG_HOME} mkdir -p "''${XDG_CONFIG_HOME}" </ins> '' + optionalString pulseaudio.enable ''

${activationScript} # Create default configurations if Plasma has never been started. <del> kdeglobals="''${XDG_CONFIG_HOME:?}/kdeglobals" </del> <ins> kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals" </ins> if ! [ -f "$kdeglobals" ] then <del> kcminputrc="''${XDG_CONFIG_HOME:?}/kcminputrc" </del> <ins> kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc" </ins> if ! [ -f "$kcminputrc" ] then cat ${kcminputrc} >"$kcminputrc"

cat ${gtkrc2} >"$gtkrc2" fi <del> gtk3_settings="''${XDG_CONFIG_HOME:?}/gtk-3.0/settings.ini" </del> <ins> gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini" </ins> if ! [ -f "$gtk3_settings" ] then mkdir -p "$(dirname "$gtk3_settings")"