fix so sway inherits program env vars
This commit is contained in:
@@ -107,13 +107,16 @@ in
|
|||||||
|
|
||||||
systemd.defaultUnit = "graphical.target";
|
systemd.defaultUnit = "graphical.target";
|
||||||
|
|
||||||
sane.users."${cfg.user}".fs.".profile".symlink.text = lib.optionalString (cfg.afterLogin != null) ''
|
# lib.mkAfter so that launching the DE happens *after* any other .profile setup.
|
||||||
|
# alternatively, we could recurse: exec a new login shell with some env-var signalling to not launch the DE,
|
||||||
|
# run with `-c "{cfg.afterLogin}"`
|
||||||
|
sane.users."${cfg.user}".fs.".profile".symlink.text = lib.mkAfter (lib.optionalString (cfg.afterLogin != null) ''
|
||||||
# if already running a desktop environment, or if running from ssh, then `tty` will show /dev/pts/NN.
|
# if already running a desktop environment, or if running from ssh, then `tty` will show /dev/pts/NN.
|
||||||
if [ "$(tty)" = "/dev/${tty}" ]; then
|
if [ "$(tty)" = "/dev/${tty}" ]; then
|
||||||
echo 'launching default session in ${builtins.toString cfg.delay}s'
|
echo 'launching default session in ${builtins.toString cfg.delay}s'
|
||||||
sleep ${builtins.toString cfg.delay} && exec ${cfg.afterLogin}
|
sleep ${builtins.toString cfg.delay} && exec ${cfg.afterLogin}
|
||||||
fi
|
fi
|
||||||
'';
|
'');
|
||||||
|
|
||||||
# see: `man login.defs`
|
# see: `man login.defs`
|
||||||
# disable timeout for `login` program.
|
# disable timeout for `login` program.
|
||||||
|
@@ -113,6 +113,15 @@ let
|
|||||||
;
|
;
|
||||||
in
|
in
|
||||||
lib.concatStringsSep "\n" env + "\n";
|
lib.concatStringsSep "\n" env + "\n";
|
||||||
|
fs.".profile".symlink.text = ''
|
||||||
|
# source env vars and the like, as systemd would. `man environment.d`
|
||||||
|
for env in ~/.config/environment.d/*.conf; do
|
||||||
|
# surround with `set -o allexport` since environment.d doesn't explicitly `export` their vars
|
||||||
|
set -a
|
||||||
|
source "$env"
|
||||||
|
set +a
|
||||||
|
done
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
fs = lib.mkMerge (mapAttrsToList (serviceName: value:
|
fs = lib.mkMerge (mapAttrsToList (serviceName: value:
|
||||||
|
Reference in New Issue
Block a user