Support running custom commands with login script

This commit is contained in:
Alexander Sosedkin 2019-03-09 18:14:48 +07:00
parent a5ab93eaec
commit 8629f29639

6
script
View file

@ -152,6 +152,7 @@ fi
echo "Sourcing home-manager environment..." echo "Sourcing home-manager environment..."
. "\$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" . "\$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
if [ -z "$@" ]; then
echo "Dropping you into a shell." echo "Dropping you into a shell."
echo "You can summon software from nixpkgs (e.g. gitMinimal) with:" echo "You can summon software from nixpkgs (e.g. gitMinimal) with:"
echo " * nix run nixpkgs.gitMinimal" echo " * nix run nixpkgs.gitMinimal"
@ -159,7 +160,10 @@ echo " * nix-env -iA nixpkgs.gitMinimal"
echo " * [edit ~/.config/nixpkgs/home.nix and run] home-manager switch" echo " * [edit ~/.config/nixpkgs/home.nix and run] home-manager switch"
echo "or a myriad other ways." echo "or a myriad other ways."
echo "Happy hacking!" echo "Happy hacking!"
exec /usr/bin/env bash "\$@" exec /usr/bin/env bash
else
exec /usr/bin/env "$@"
fi
EOF EOF
chmod +x bootstrap/bin/.login-inner chmod +x bootstrap/bin/.login-inner