* Provide a script "nixos-checkout" to replace the NixOS/Nixpkgs
sources in /etc/nixos with a Subversion checkout of those trees. This should be run after a successful installation if you want to keep NixOS up to date from Subversion. svn path=/nixos/trunk/; revision=7859
This commit is contained in:
parent
97aa1faa33
commit
923348b490
5 changed files with 42 additions and 12 deletions
|
@ -1,9 +0,0 @@
|
|||
#! /bin/sh
|
||||
nix-channel --add http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable
|
||||
nix-channel --update
|
||||
nix-env -i subversion
|
||||
cd /etc/nixos
|
||||
svn co https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk nixos
|
||||
svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk nixpkgs
|
||||
ln -sf ../nixpkgs/pkgs nixos/pkgs
|
||||
ln -sf nixpkgs/pkgs/top-level/all-packages.nix install-source.nix
|
8
installer/nixos-checkout.nix
Normal file
8
installer/nixos-checkout.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{substituteAll}:
|
||||
|
||||
substituteAll {
|
||||
name = "nixos-checkout";
|
||||
src = ./nixos-checkout.sh;
|
||||
dir = "bin";
|
||||
isExecutable = true;
|
||||
}
|
28
installer/nixos-checkout.sh
Normal file
28
installer/nixos-checkout.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#! @shell@ -e
|
||||
set -x
|
||||
|
||||
# Obtain Subversion.
|
||||
nix-channel --add http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable
|
||||
nix-channel --update
|
||||
nix-env -i subversion
|
||||
|
||||
cd /etc/nixos
|
||||
|
||||
# Move any old nixos or nixpkgs directories out of the way.
|
||||
backupTimestamp=$(date "+%Y%m%d%H%M%S")
|
||||
|
||||
if test -e nixos -a ! -e nixos/.svn; then
|
||||
mv nixos nixos-$backupTimestamp
|
||||
fi
|
||||
|
||||
if test -e nixpkgs -a ! -e nixpkgs/.svn; then
|
||||
mv nixpkgs nixpkgs-$backupTimestamp
|
||||
fi
|
||||
|
||||
# Check out the NixOS and Nixpkgs sources.
|
||||
svn co https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk nixos
|
||||
svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk nixpkgs
|
||||
|
||||
# A few symlink.
|
||||
ln -sfn ../nixpkgs/pkgs nixos/pkgs
|
||||
ln -sfn nixpkgs/pkgs/top-level/all-packages.nix install-source.nix
|
|
@ -1,9 +1,8 @@
|
|||
{substituteAll, nix}:
|
||||
{substituteAll}:
|
||||
|
||||
substituteAll {
|
||||
name = "nixos-rebuild";
|
||||
src = ./nixos-rebuild.sh;
|
||||
dir = "bin";
|
||||
isExecutable = true;
|
||||
inherit nix;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,10 @@ rec {
|
|||
|
||||
nixosRebuild = import ../installer/nixos-rebuild.nix {
|
||||
inherit (pkgs) substituteAll;
|
||||
inherit nix;
|
||||
};
|
||||
|
||||
nixosCheckout = import ../installer/nixos-checkout.nix {
|
||||
inherit (pkgs) substituteAll;
|
||||
};
|
||||
|
||||
|
||||
|
@ -192,6 +195,7 @@ rec {
|
|||
nix
|
||||
nixosInstall
|
||||
nixosRebuild
|
||||
nixosCheckout
|
||||
setuidWrapper
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue