diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-05-31 09:59:33 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-05-31 09:59:57 +0000 |
commit | 9ff36293d1e428cd7bf03e8d4b03611b6d361c28 (patch) | |
tree | 1ab51a42b868c55b83f6ccdb80371b9888739dd9 /nixos/doc/manual/from_md/development/sources.chapter.xml | |
parent | 1c4fcd0d4b0541e674ee56ace1053e23e562cc80 (diff) | |
parent | ddc3c396a51918043bb0faa6f676abd9562be62c (diff) | |
download | nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar.gz nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar.bz2 nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar.lz nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar.xz nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.tar.zst nixpkgs-9ff36293d1e428cd7bf03e8d4b03611b6d361c28.zip |
Last good Nixpkgs for Weston+nouveau? archive
I came this commit hash to terwiz[m] on IRC, who is trying to figure out what the last version of Spectrum that worked on their NUC with Nvidia graphics is.
Diffstat (limited to 'nixos/doc/manual/from_md/development/sources.chapter.xml')
-rw-r--r-- | nixos/doc/manual/from_md/development/sources.chapter.xml | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/nixos/doc/manual/from_md/development/sources.chapter.xml b/nixos/doc/manual/from_md/development/sources.chapter.xml new file mode 100644 index 00000000000..aac18c9d06c --- /dev/null +++ b/nixos/doc/manual/from_md/development/sources.chapter.xml @@ -0,0 +1,90 @@ +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-getting-sources"> + <title>Getting the Sources</title> + <para> + By default, NixOS’s <literal>nixos-rebuild</literal> command uses + the NixOS and Nixpkgs sources provided by the + <literal>nixos</literal> channel (kept in + <literal>/nix/var/nix/profiles/per-user/root/channels/nixos</literal>). + To modify NixOS, however, you should check out the latest sources + from Git. This is as follows: + </para> + <programlisting> +$ git clone https://github.com/NixOS/nixpkgs +$ cd nixpkgs +$ git remote update origin +</programlisting> + <para> + This will check out the latest Nixpkgs sources to + <literal>./nixpkgs</literal> the NixOS sources to + <literal>./nixpkgs/nixos</literal>. (The NixOS source tree lives in + a subdirectory of the Nixpkgs repository.) The + <literal>nixpkgs</literal> repository has branches that correspond + to each Nixpkgs/NixOS channel (see <xref linkend="sec-upgrading" /> + for more information about channels). Thus, the Git branch + <literal>origin/nixos-17.03</literal> will contain the latest built + and tested version available in the <literal>nixos-17.03</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, then the + binary cache may not have caught up yet and you’ll have to rebuild + everything from source. So you may want to create a local branch + based on your current NixOS version: + </para> + <programlisting> +$ nixos-version +17.09pre104379.6e0b727 (Hummingbird) + +$ git checkout -b local 6e0b727 +</programlisting> + <para> + Or, to base your local branch on the latest version available in a + NixOS channel: + </para> + <programlisting> +$ git remote update origin +$ git checkout -b local origin/nixos-17.03 +</programlisting> + <para> + (Replace <literal>nixos-17.03</literal> with the name of the channel + you want to use.) You can use <literal>git merge</literal> or + <literal>git rebase</literal> to keep your local branch in sync with + the channel, e.g. + </para> + <programlisting> +$ git remote update origin +$ git merge origin/nixos-17.03 +</programlisting> + <para> + You can use <literal>git cherry-pick</literal> to copy commits from + your local branch to the upstream branch. + </para> + <para> + If you want to rebuild your system using your (modified) sources, + you need to tell <literal>nixos-rebuild</literal> about them using + the <literal>-I</literal> flag: + </para> + <programlisting> +# nixos-rebuild switch -I nixpkgs=/my/sources/nixpkgs +</programlisting> + <para> + If you want <literal>nix-env</literal> to use the expressions in + <literal>/my/sources</literal>, use + <literal>nix-env -f /my/sources/nixpkgs</literal>, or change the + default by adding a symlink in <literal>~/.nix-defexpr</literal>: + </para> + <programlisting> +$ ln -s /my/sources/nixpkgs ~/.nix-defexpr/nixpkgs +</programlisting> + <para> + You may want to delete the symlink + <literal>~/.nix-defexpr/channels_root</literal> to prevent root’s + NixOS channel from clashing with your own tree (this may break the + command-not-found utility though). If you want to go back to the + default state, you may just remove the + <literal>~/.nix-defexpr</literal> directory completely, log out and + log in again and it should have been recreated with a link to the + root channels. + </para> +</chapter> |