nixos-checkout: Remove
This command was useful when NixOS was spread across multiple repositories, but now it's pretty pointless (and obfuscates what happens, i.e. "git clone git://github.com/NixOS/nixpkgs.git").
This commit is contained in:
parent
0087d16120
commit
25387a1bed
@ -11,35 +11,25 @@ uses the NixOS and Nixpkgs sources provided by the
|
||||
<literal>nixos-unstable</literal> channel (kept in
|
||||
<filename>/nix/var/nix/profiles/per-user/root/channels/nixos</filename>).
|
||||
To modify NixOS, however, you should check out the latest sources from
|
||||
Git. This is done using the following command:
|
||||
Git. This is as follows:
|
||||
|
||||
<screen>
|
||||
$ nixos-checkout <replaceable>/my/sources</replaceable>
|
||||
</screen>
|
||||
|
||||
or
|
||||
|
||||
<screen>
|
||||
$ mkdir -p <replaceable>/my/sources</replaceable>
|
||||
$ cd <replaceable>/my/sources</replaceable>
|
||||
$ nix-env -i git
|
||||
$ git clone git://github.com/NixOS/nixpkgs.git
|
||||
$ cd nixpkgs
|
||||
$ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
|
||||
$ git remote update channels
|
||||
</screen>
|
||||
|
||||
This will check out the latest NixOS sources to
|
||||
<filename><replaceable>/my/sources</replaceable>/nixpkgs/nixos</filename>
|
||||
and the Nixpkgs sources to
|
||||
<filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>.
|
||||
(The NixOS source tree lives in a subdirectory of the Nixpkgs
|
||||
repository.) The remote <literal>channels</literal> refers to a
|
||||
read-only repository that tracks the Nixpkgs/NixOS channels (see <xref
|
||||
linkend="sec-upgrading"/> for more information about channels). Thus,
|
||||
the Git branch <literal>channels/nixos-14.12</literal> will contain
|
||||
the latest built and tested version available in the
|
||||
<literal>nixos-14.12</literal> channel.</para>
|
||||
This will check out the latest Nixpkgs sources to
|
||||
<filename>./nixpkgs</filename> the NixOS sources to
|
||||
<filename>./nixpkgs/nixos</filename>. (The NixOS source tree lives in
|
||||
a subdirectory of the Nixpkgs repository.) The remote
|
||||
<literal>channels</literal> refers to a read-only repository that
|
||||
tracks the Nixpkgs/NixOS channels (see <xref linkend="sec-upgrading"/>
|
||||
for more information about channels). Thus, the Git branch
|
||||
<literal>channels/nixos-14.12</literal> will contain the latest built
|
||||
and tested version available in the <literal>nixos-14.12</literal>
|
||||
channel.</para>
|
||||
|
||||
<para>It’s often inconvenient to develop directly on the master
|
||||
branch, since if somebody has just committed (say) a change to GCC,
|
||||
|
@ -52,8 +52,7 @@ in
|
||||
# Include some utilities that are useful for installing or repairing
|
||||
# the system.
|
||||
environment.systemPackages =
|
||||
[ pkgs.subversion # for nixos-checkout
|
||||
pkgs.w3m # needed for the manual anyway
|
||||
[ pkgs.w3m # needed for the manual anyway
|
||||
pkgs.testdisk # useful for repairing boot problems
|
||||
pkgs.mssys # for writing Microsoft boot sectors / MBRs
|
||||
pkgs.parted
|
||||
|
@ -49,8 +49,7 @@ in
|
||||
# Include some utilities that are useful for installing or repairing
|
||||
# the system.
|
||||
environment.systemPackages =
|
||||
[ pkgs.subversion # for nixos-checkout
|
||||
pkgs.w3m # needed for the manual anyway
|
||||
[ pkgs.w3m # needed for the manual anyway
|
||||
pkgs.ddrescue
|
||||
pkgs.ccrypt
|
||||
pkgs.cryptsetup # needed for dm-crypt volumes
|
||||
|
@ -1,60 +0,0 @@
|
||||
# This module generates the nixos-checkout script, which performs a
|
||||
# checkout of the Nixpkgs Git repository.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
nixosCheckout = pkgs.substituteAll {
|
||||
name = "nixos-checkout";
|
||||
dir = "bin";
|
||||
isExecutable = true;
|
||||
src = pkgs.writeScript "nixos-checkout"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
|
||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
||||
echo "Usage: `basename $0` [PREFIX]. See NixOS Manual for more info."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
prefix="$1"
|
||||
if [ -z "$prefix" ]; then prefix=/etc/nixos; fi
|
||||
mkdir -p "$prefix"
|
||||
cd "$prefix"
|
||||
|
||||
if [ -z "$(type -P git)" ]; then
|
||||
echo "installing Git..."
|
||||
nix-env -iA nixos.git
|
||||
fi
|
||||
|
||||
# Move any old nixpkgs directories out of the way.
|
||||
backupTimestamp=$(date "+%Y%m%d%H%M%S")
|
||||
|
||||
if [ -e nixpkgs -a ! -e nixpkgs/.git ]; then
|
||||
mv nixpkgs nixpkgs-$backupTimestamp
|
||||
fi
|
||||
|
||||
# Check out the Nixpkgs sources.
|
||||
if ! [ -e nixpkgs/.git ]; then
|
||||
echo "Creating repository in $prefix/nixpkgs..."
|
||||
git init --quiet nixpkgs
|
||||
else
|
||||
echo "Updating repository in $prefix/nixpkgs..."
|
||||
fi
|
||||
cd nixpkgs
|
||||
git remote add origin git://github.com/NixOS/nixpkgs.git || true
|
||||
git remote add channels git://github.com/NixOS/nixpkgs-channels.git || true
|
||||
git remote set-url origin --push git@github.com:NixOS/nixpkgs.git
|
||||
git remote update
|
||||
git checkout master
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
environment.systemPackages = [ nixosCheckout ];
|
||||
}
|
@ -47,7 +47,6 @@
|
||||
./i18n/input-method/nabi.nix
|
||||
./i18n/input-method/uim.nix
|
||||
./installer/tools/auto-upgrade.nix
|
||||
./installer/tools/nixos-checkout.nix
|
||||
./installer/tools/tools.nix
|
||||
./misc/assertions.nix
|
||||
./misc/crashdump.nix
|
||||
|
Loading…
Reference in New Issue
Block a user