From fcdab6a62df47e0b23ef9bd0e4ff2a9452277f71 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 15 Aug 2019 23:23:43 +0200 Subject: [PATCH] install: restrict to nix-shell This commit adds a "build" command to the install derivation that tells the user that `nix-shell` should be used. A derivation attribute `shellHookOnly = true` is also added with the intent to indicate that the shell hook is the entire point of the derivation. --- home-manager/install.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home-manager/install.nix b/home-manager/install.nix index 8abf6af9..c58c0ba7 100644 --- a/home-manager/install.nix +++ b/home-manager/install.nix @@ -6,6 +6,7 @@ runCommand propagatedBuildInputs = [ home-manager ]; preferLocalBuild = true; allowSubstitutes = false; + shellHookOnly = true; shellHook = '' confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix" @@ -53,4 +54,7 @@ runCommand fi ''; } - "" + '' + echo This derivation is not buildable, instead run it using nix-shell. + exit 1 + ''