diff options
author | Robert Helgesson <robert@rycee.net> | 2018-12-03 00:48:07 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2018-12-04 00:59:52 +0100 |
commit | a37b5c9c61d10911b4f094bd9357b4618eb7fa65 (patch) | |
tree | a72178fd7648d2a893c82555ca633076f20e9706 /home-manager | |
parent | 30f3baabafabc25e003dfef5a13f2ea57ef668ab (diff) |
Change installation instructions to use nix-channel
This avoids the uncontrollable nature of fetching the tarball as part
of the evaluation. Instead the user can decide when to update and also
perform rollbacks, if necessary.
Diffstat (limited to 'home-manager')
-rw-r--r-- | home-manager/install.nix | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/home-manager/install.nix b/home-manager/install.nix index be9f17df067..28ffe221bad 100644 --- a/home-manager/install.nix +++ b/home-manager/install.nix @@ -7,6 +7,23 @@ pkgs.runCommand preferLocalBuild = true; allowSubstitutes = false; shellHook = '' + confFile="''${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix" + + if [[ ! -e $confFile ]]; then + echo + echo "Creating initial Home Manager configuration..." + + mkdir -p "$(dirname "$confFile")" + cat > $confFile <<EOF + { config, pkgs, ... }: + + { + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + } + EOF + fi + echo echo "Creating initial Home Manager generation..." echo @@ -17,7 +34,7 @@ pkgs.runCommand All done! The home-manager tool should now be installed and you can edit - ''${XDG_CONFIG_HOME:-~/.config}/nixpkgs/home.nix + $confFile to configure Home Manager. Run 'man home-configuration.nix' to see all available options. |