Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-homepage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f8601434d8ec
Choose a base ref
...
head repository: NixOS/nixos-homepage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4e1f2119e67b
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Apr 14, 2020

  1. Remove Azure image tab

    It's very outdated.
    
    Also update this flake to use NixOS 20.03.
    edolstra committed Apr 14, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    sikmir Nikolay Korotkiy
    Copy the full SHA
    4ebccef View commit details
  2. Also remove GCE images

    edolstra committed Apr 14, 2020
    Copy the full SHA
    4864be8 View commit details
  3. Merge pull request #394 from NixOS/remove-azure

    Remove Azure/GCE image tabs
    edolstra authored Apr 14, 2020
    1
    Copy the full SHA
    4e1f211 View commit details
Showing with 39 additions and 185 deletions.
  1. +0 −2 Makefile
  2. +5 −145 download.tt
  3. +18 −13 flake.lock
  4. +16 −25 flake.nix
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -89,8 +89,6 @@ favicon.ico: favicon.png
--define root=$(ROOT) \
--define fileName=$< \
--define nixosAmis=$(NIXOS_AMIS) \
--define nixosAzureBlobs=$(NIXOS_AZURE_BLOBS) \
--define nixosGCE=$(NIXOS_GCE) \
--pre_process=nix-release.tt --pre_process=nixos-release.tt --pre_process=common.tt \
$< > $@.tmp
xmllint --nonet --noout $@.tmp
150 changes: 5 additions & 145 deletions download.tt
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
<p>Make sure to follow the instructions output by the script.</p>
<p>The installation script requires that you have <code>sudo</code> access to <code>root</code>.</p>
</section>

<section class="tab-pane" id="nix-verify-installation">
<p>You may want to verify the integrity of the installation script using GPG:</p>
<pre class="well">
@@ -41,12 +42,14 @@
<a href="https://github.com/NixOS/nixos-homepage/blob/master/edolstra.gpg">on GitHub</a>.
</p>
</section>

<section class="tab-pane" id="nix-uninstall">
<p>
You can uninstall Nix simply by running <code>rm -rf /nix</code>.
</p>
<!-- TODO: expand this https://github.com/NixOS/nix/issues/1402 -->
</section>

<section class="tab-pane" id="nix-more">
<p>The following release items are also available:</p>
<ul>
@@ -83,8 +86,6 @@
<li class="active"><a href="#nixos-iso">ISO image</a></li>
<li><a href="#nixos-virtualbox">VirtualBox</a></li>
<li><a href="#nixos-amazon">Amazon EC2</a></li>
<li><a href="#nixos-azure">Microsoft Azure</a></li>
<li><a href="#nixos-google">Google Compute Engine</a></li>
<li><a href="#nixos-more">More ...</a></li>
</ul>

@@ -124,6 +125,7 @@
href="[%prefix%]/latest-nixos-minimal-i686-linux.iso.sha256">SHA-256</a>)</li>
</ul>
</section>

<section class="tab-pane" id="nixos-virtualbox">
<p>This is a demo appliance for VirtualBox (in OVA format) that has
X11 and Plasma 5 enabled, as well as the VirtualBox guest additions. To
@@ -139,6 +141,7 @@
href="[%prefix%]/latest-nixos-x86_64-linux.ova.sha256">SHA-256</a>)</li>
</ul>
</section>

<section class="tab-pane" id="nixos-amazon">
<p>If you are an EC2 user, you can deploy a NixOS instance instantly
in your preferred region by using one of the AMIs listed below.</p>
@@ -182,150 +185,7 @@
<pre class="well">
$ ec2-run-instances [% ami %] --region [% region %] -k <em>my-key-pair</em></pre>
</section>
<section class="tab-pane" id="nixos-azure">
<p>If you are an Azure user, you can manually create a NixOS instance
by using one of the bootstrap BLOBs listed below.</p>

<div class="alert alert-block">
Please note that latest release currently lacks Azure image. We hope to
change this soon.
</div>

<div class="row">
<table class="table">
<thead>
<tr>
<th>NixOS version</th>
<th>BLOB URL</th>
</tr>
</thead>
<tbody>
[% blobs = JSON.Escape.json_decode(IO.All.new(nixosAzureBlobs).all) %]
[% FOREACH version IN blobs.keys.sort; blob = blobs.$version %]
<tr>
<td><code>[% version %]</code></td>
<td><a href="[% blob %]"><code>[% blob %]</code></a></td>
</tr>
[% END %]
</tbody>
</table>
</div>

<p>You can create an instance from the command line.
For example, to create an instance of version
<code>[% blob = blobs.$latestNixOSSeries; latestNixOSSeries %]</code>
of NixOS using azure-cli, just run:</p>

<pre class="well">
# settings
# vm name must be lowercase and letters/numbers only because it's also used as the domain name
export VM_NAME="nixosvm"
export RESOURCE_GROUP="rg-nixosvm"
export LOCATION="eastus"
export STORAGE_ACCOUNT="nixosvm"
export SOURCE_URI="<code>[% blob %]</code>"

# create group
az group create \
--name "$RESOURCE_GROUP" \
--location "$LOCATION

# create storage
az storage account create \
--name "$STORAGE_ACCOUNT" \
--group "$RESOURCE_GROUP" \
--location "$LOCATION" \
--sku Standard_LRS

az storage account keys list \
--name "$STORAGE_ACCOUNT" \
--group $RESOURCE_GROUP

# export one of the storage access keys
export STORAGE_ACCOUNT_KEY="..."
echo $STORAGE_ACCOUNT_KEY

az storage container create \
--account-name "$STORAGE_ACCOUNT"
--account-key "$STORAGE_ACCOUNT_KEY"
--name vm-images

# copy the image blob
az storage blob copy start \
--source-uri "$SOURCE_URI" \
--destination-blob "nixos-unstable-nixops.vhd" \
--destination-container "vm-images" \
--account-name "$STORAGE_ACCOUNT" \
--account-key "$STORAGE_ACCOUNT_KEY"

# wait for blob copy status to change pending->success
az storage blob show \
--name "nixos-unstable-nixops.vhd" \
--container-name "vm-images" \
--account-name "$STORAGE_ACCOUNT" \
--account-key "$STORAGE_ACCOUNT_KEY"


# create vm
az vm create \
--name "$VM_NAME" \
--resource-group "$RESOURCE_GROUP" \
--location "$LOCATION" \
--public-ip-address-dns-name "$VM_NAME" \
--image "https://$STORAGE_ACCOUNT.blob.core.windows.net/vm-images/nixos-unstable-nixops.vhd" \
--storage-account "$STORAGE_ACCOUNT" \
--storage-container-name "$VM_NAME" \
--use-unmanaged-disk \
--os-disk-size-gb "32" \
--os-type linux \
--admin-username "azureuser" \
--generate-ssh-keys

# show machine properties and log in
az vm show \
--name "$VM" \
--resource-group "$GROUP"

ssh azureuser@"$VM_NAME"."$LOCATION".cloudapp.azure.com</pre>
</section>
<section class="tab-pane" id="nixos-google">
<p>If you are Google Cloud Platform user, you can create a NixOS image using one of the raw disks listed below. You
can then create a NixOS instance using the image.</p>

<div class="alert alert-block">
Please note that latest release currently lacks GCE image. We hope to
change this soon.
</div>

<div class="row">
<table class="table">
<thead>
<tr>
<th>NixOS version</th>
<th>URL</th>
</tr>
</thead>
<tbody>
[% images = JSON.Escape.json_decode(IO.All.new(nixosGCE).all) %]
[% FOREACH version IN images.keys.sort; url = images.$version %]
<tr>
<td><code>[% version %]</code></td>
<td><a href="[% url %]"><code>[% url %]</code></a></td>
</tr>
[% END %]
</tbody>
</table>
</div>

<p>For example:</p>

<pre class="well">
image=my-nixos-image
source_uri=https://storage.googleapis.com/nixos-cloud-images/nixos-image-18.09.1228.a4c4cbb613c-x86_64-linux.raw.tar.gz
source_uri=$(sed 's%gs:/%https://storage.googleapis.com%' &lt;&lt;&lt; $source_uri)
gcloud compute images create $image --source-uri=$source_uri
gcloud compute instances create instance-1 --image=$image</pre>
</section>
<section class="tab-pane" id="nixos-more">
<h2 id="unstable-releases">Unstable releases</h2>

31 changes: 18 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 16 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -3,39 +3,31 @@

description = "The nixos.org homepage";

inputs.nixpkgsStable.url = "nixpkgs/release-19.09";
inputs.nixpkgs.url = "nixpkgs/nixos-20.03";
inputs.nix-pills = { url = "github:NixOS/nix-pills"; flake = false; };

outputs = { self, nixpkgsStable, nix-pills }:
with import nixpkgsStable { system = "x86_64-linux"; };
outputs = { self, nixpkgs, nix-pills }:
with import nixpkgs { system = "x86_64-linux"; };
rec {

checks.x86_64-linux.build = defaultPackage.x86_64-linux;

packages.x86_64-linux = {

packagesExplorer = import ./packages-explorer nixpkgsStable;
packagesExplorer = import ./packages-explorer nixpkgs;

nixosAmis = writeText "ec2-amis.json"
(builtins.toJSON (
import (nixpkgsStable + "/nixos/modules/virtualisation/ec2-amis.nix")));

nixosAzureBlobs = writeText "azure-blobs.json"
(builtins.toJSON (
import (nixpkgsStable + "/nixos/modules/virtualisation/azure-bootstrap-blobs.nix")));

nixosGCE = writeText "gce-images.json"
(builtins.toJSON (
import (nixpkgsStable + "/nixos/modules/virtualisation/gce-images.nix")));
import (nixpkgs + "/nixos/modules/virtualisation/ec2-amis.nix")));

nixPills = import nix-pills {
inherit pkgs;
revCount = nix-pills.lastModified; # FIXME
revCount = nix-pills.lastModifiedDate; # FIXME
shortRev = nix-pills.shortRev;
};

homepage = stdenv.mkDerivation {
name = "nixos-homepage-${self.lastModified}";
name = "nixos-homepage-${self.lastModifiedDate}";

src = self;

@@ -50,6 +42,7 @@
perlPackages.TemplateToolkit
perlPackages.TemplatePluginJSONEscape
perlPackages.TemplatePluginIOAll
perlPackages.AppConfig
pkgs.nix
imagemagick
xhtml1
@@ -65,11 +58,9 @@

makeFlags =
[ "NIX_MANUAL_IN=${nix.doc}/share/doc/nix/manual"
"NIXOS_MANUAL_IN=${nixpkgsStable.htmlDocs.nixosManual}"
"NIXPKGS_MANUAL_IN=${nixpkgsStable.htmlDocs.nixpkgsManual}"
"NIXOS_MANUAL_IN=${nixpkgs.htmlDocs.nixosManual}"
"NIXPKGS_MANUAL_IN=${nixpkgs.htmlDocs.nixpkgsManual}"
"NIXOS_AMIS=${packages.x86_64-linux.nixosAmis}"
"NIXOS_GCE=${packages.x86_64-linux.nixosGCE}"
"NIXOS_AZURE_BLOBS=${packages.x86_64-linux.nixosAzureBlobs}"
"PACKAGES_EXPLORER=${packages.x86_64-linux.packagesExplorer}/bundle.js"
"NIX_PILLS_MANUAL_IN=${packages.x86_64-linux.nixPills}/share/doc/nix-pills"
];
@@ -81,11 +72,9 @@

shellHook = ''
export NIX_MANUAL_IN="${nix.doc}/share/doc/nix/manual"
export NIXOS_MANUAL_IN="${nixpkgsStable.htmlDocs.nixosManual}"
export NIXPKGS_MANUAL_IN="${nixpkgsStable.htmlDocs.nixpkgsManual}"
export NIXOS_MANUAL_IN="${nixpkgs.htmlDocs.nixosManual}"
export NIXPKGS_MANUAL_IN="${nixpkgs.htmlDocs.nixpkgsManual}"
export NIXOS_AMIS="${packages.x86_64-linux.nixosAmis}"
export NIXOS_GCE="${packages.x86_64-linux.nixosGCE}"
export NIXOS_AZURE_BLOBS="${packages.x86_64-linux.nixosAzureBlobs}"
export PACKAGES_EXPLORER="${packages.x86_64-linux.packagesExplorer}/bundle.js"
export NIX_PILLS_MANUAL_IN="${packages.x86_64-linux.nixPills}/share/doc/nix-pills"
'';
@@ -96,7 +85,7 @@

defaultPackage.x86_64-linux = packages.x86_64-linux.homepage;

nixosConfigurations.container = nixpkgsStable.lib.nixosSystem {
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[ ({ lib, ... }:
@@ -107,7 +96,9 @@
services.httpd = {
enable = true;
adminAddr = "admin@example.org";
documentRoot = self.packages.x86_64-linux.homepage;
virtualHosts.default = {
documentRoot = self.packages.x86_64-linux.homepage;
};
};
})
];