From 06d4f39e7b42fd601eae247e458ac82fece349d0 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 24 Nov 2017 12:31:08 +0100 Subject: home-manager: use `shellHook` to install 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`. --- home-manager/install.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 home-manager/install.nix (limited to 'home-manager') diff --git a/home-manager/install.nix b/home-manager/install.nix new file mode 100644 index 00000000000..c6d3aa4e4ca --- /dev/null +++ b/home-manager/install.nix @@ -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 <