This changes the installation command from nix-shell $HM_PATH -A install --run 'home-manager switch' to nix-shell $HM_PATH -A install The added shell hook will print some useful information and run `home-manager switch`.wip/yesman
parent
a1e36a9a37
commit
06d4f39e7b
@ -0,0 +1,37 @@ |
||||
{ home-manager, pkgs }: |
||||
|
||||
pkgs.runCommand |
||||
"home-manager-install" |
||||
{ |
||||
propagatedBuildInputs = [ home-manager ]; |
||||
shellHook = '' |
||||
echo |
||||
echo "Creating initial Home Manager generation..." |
||||
echo |
||||
|
||||
if home-manager switch; then |
||||
cat <<EOF |
||||
|
||||
All done! The home-manager tool should now be installed and you |
||||
can edit |
||||
|
||||
''${XDG_CONFIG_HOME:-~/.config}/nixpkgs/home.nix |
||||
|
||||
to configure Home Manager. Run 'man home-configuration.nix' to |
||||
see all available options. |
||||
EOF |
||||
exit 0 |
||||
else |
||||
cat <<EOF |
||||
|
||||
Uh oh, the installation failed! Please create an issue at |
||||
|
||||
https://github.com/rycee/home-manager/issues |
||||
|
||||
if the error seems to be the fault of Home Manager. |
||||
EOF |
||||
exit 1 |
||||
fi |
||||
''; |
||||
} |
||||
"" |
Loading…
Reference in new issue