mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
login: source session init in shell configs
If a shell is not started via login-inner (e.g. via ssh) it will not source the sessionInit script. The solution is to source this file in the respective config files for bash and zsh (more shell support can be easily added). The -u option is not necessary for the few lines in login-inner and should not be activated after sourcing sessionInit in bash or zsh setup.
This commit is contained in:
parent
b4b228eb27
commit
b201d656b9
3 changed files with 34 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ in
|
|||
writeText "login-inner" ''
|
||||
# This file is generated by nix-on-droid. DO NOT EDIT.
|
||||
|
||||
set -eu -o pipefail
|
||||
set -eo pipefail
|
||||
|
||||
if [ "$#" -eq 0 ]; then # if script is called from within nix-on-droid app
|
||||
echo "Welcome to Nix-on-Droid!"
|
||||
|
|
|
|||
32
modules/environment/shell.nix
Normal file
32
modules/environment/shell.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = {
|
||||
|
||||
environment.etc = {
|
||||
"profile".text = ''
|
||||
. "${config.build.sessionInit}/etc/profile.d/nix-on-droid-session-init.sh"
|
||||
'';
|
||||
|
||||
"zshenv".text = ''
|
||||
. "${config.build.sessionInit}/etc/profile.d/nix-on-droid-session-init.sh"
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
./environment/nix.nix
|
||||
./environment/path.nix
|
||||
./environment/session-init.nix
|
||||
./environment/shell.nix
|
||||
./home-manager.nix
|
||||
./nixpkgs/options.nix
|
||||
./time.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue