1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

bootstrap: use nix-channel

This commit is contained in:
Daiderd Jordan 2017-06-03 11:02:27 +02:00
parent 4c6d8dc3a6
commit 310ec89642
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -155,19 +155,20 @@ install(){
test -L /run || sudo ln -snf private/var/run /run
# Fetch the nix-darwin repo
echo -e ""$YELLOW"Fetching nix-darwin repo..."$ESC""
nix-env -p "/nix/var/nix/profiles/per-user/$USER/darwin" \
--set $(nix-prefetch-url --unpack --print-path \
--name nix-darwin-17.03 \
https://github.com/LnL7/nix-darwin/archive/master.tar.gz \
| grep nix-darwin)
ln -sfn "/nix/var/nix/profiles/per-user/$USER/darwin" "$HOME/.nix-defexpr/darwin"
echo -e ""$YELLOW"Configuring darwin channel..."$ESC""
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
nix-channel --update
# Create symlink for old NIX_PATH entry
ln -sfn "/nix/var/nix/profiles/per-user/$USER/channels/darwin" "$HOME/.nix-defexpr/darwin"
# Copy the example configuration
echo -e "Copying example configuration to "$YELLOW"~/.nixpkgs/darwin-configuration.nix"$ESC"..."
mkdir -p "$HOME/.nixpkgs"
cp "$HOME/.nix-defexpr/darwin/modules/examples/simple.nix" "$HOME/.nixpkgs/darwin-configuration.nix"
if [ ! -e "$HOME/.nixpkgs/darwin-configuration.nix" ]; then
mkdir -p "$HOME/.nixpkgs"
cp "$HOME/.nix-defexpr/darwin/modules/examples/simple.nix" "$HOME/.nixpkgs/darwin-configuration.nix"
chmod u+w "$HOME/.nixpkgs/darwin-configuration.nix"
fi
# Bootstrap build using default nix.nixPath
echo "Bootstrapping..."