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: 29ec9dd6383e
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: f07a2f8a4783
Choose a head ref
  • 4 commits
  • 20 files changed
  • 2 contributors

Commits on Jan 18, 2021

  1. Update flake.lock and blogs.xml [ci skip]

    GitHub Actions committed Jan 18, 2021
    Copy the full SHA
    fb9c056 View commit details
  2. Update flake.lock and blogs.xml [ci skip]

    GitHub Actions committed Jan 18, 2021
    Copy the full SHA
    d80fc7e View commit details

Commits on Jan 20, 2021

  1. Update flake.lock and blogs.xml [ci skip]

    GitHub Actions committed Jan 20, 2021
    Copy the full SHA
    1be22d3 View commit details
  2. Switching to Roboto / Overpass / Fira Mono font variant

    Building process of site-styles is now handled with Makefile, this
    offers more incremental build support (aka faster developing cycles)
    garbas committed Jan 20, 2021
    Copy the full SHA
    f07a2f8 View commit details
3 changes: 1 addition & 2 deletions .github/workflows/pulls.yml
Original file line number Diff line number Diff line change
@@ -25,8 +25,7 @@ jobs:
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
nix --version
cat /etc/nix/nix.conf
PATH="$HOME/.nix-profile/bin:$PATH"
echo "PATH=${PATH}" >> $GITHUB_ENV
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH
- uses: cachix/cachix-action@v8
with:
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -17,8 +17,10 @@
/blogs.xml
/demos/*.cast
/demos/*.svg
/tmp.*
/favicon.png
/favicon.ico
/site-styles/common-styles
/news-rss.xml
/nixos-release.tt
/robots.txt
122 changes: 91 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@ DEMOS = \
demos/example_5.svg \
demos/example_6.svg


NIX_DEV_MANUAL_IN ?= /no-such-path
NIX_DEV_MANUAL_OUT = guides

@@ -64,67 +63,99 @@ all: $(NIX_PILLS_MANUAL_OUT)
$(NIX_PILLS_MANUAL_OUT): $(NIX_PILLS_MANUAL_IN) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIX_PILLS_MANUAL_IN) $(NIX_PILLS_MANUAL_OUT) 'Nix Pills' nixos https://github.com/NixOS/nix-pills


### Prettify the Nix manual.

NIX_MANUAL_STABLE_IN ?= /no-such-path
NIX_MANUAL_STABLE_OUT = manual/nix/stable

all: $(NIX_MANUAL_STABLE_OUT)

$(NIX_MANUAL_STABLE_OUT): $(call rwildcard, $(NIX_MANUAL_STABLE_IN), *) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIX_MANUAL_STABLE_IN) $(NIX_MANUAL_STABLE_OUT) 'Nix $(NIX_STABLE_VERSION) manual' nix https://github.com/NixOS/nix/tree/master/doc/manual

NIX_MANUAL_UNSTABLE_IN ?= /no-such-path
NIX_MANUAL_UNSTABLE_OUT = manual/nix/unstable

all: $(NIX_MANUAL_UNSTABLE_OUT)

$(NIX_MANUAL_UNSTABLE_OUT): $(call rwildcard, $(NIX_MANUAL_UNSTABLE_IN), *) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
mkdir -p $(NIX_MANUAL_UNSTABLE_OUT)
cp --no-preserve=mode,ownership -RL $(NIX_MANUAL_UNSTABLE_IN)/* $(NIX_MANUAL_UNSTABLE_OUT)

manual/nix/index.html: $(NIX_MANUAL_STABLE_OUT) $(NIX_MANUAL_UNSTABLE_OUT)
bash ./scripts/fix-manual-headers.sh manual/nix stable
@echo "<!DOCTYPE html>" > $@
@echo "<html>" >> $@
@echo " <head>" >> $@
@echo " <meta http-equiv=\"refresh\" content=\"7; url='stable/index.html'\" />" >> $@
@echo " </head>" >> $@
@echo " <body>" >> $@
@echo " <h1>Redirecting...</h1>" >> $@
@echo " <p>Please follow <a href=\"stable/index.html\">this link</a>.</p>" >> $@
@echo " </body>" >> $@
@echo "</html>" >> $@

all: manual/nix/index.html

### Prettify the Nixpkgs manual.

NIXPKGS_MANUAL_STABLE_IN ?= /no-such-path
NIXPKGS_MANUAL_STABLE_OUT = manual/nixpkgs/stable

all: $(NIXPKGS_MANUAL_STABLE_OUT)

$(NIXPKGS_MANUAL_STABLE_OUT): $(NIXPKGS_MANUAL_STABLE_IN) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIXPKGS_MANUAL_STABLE_IN)/share/doc/nixpkgs $(NIXPKGS_MANUAL_STABLE_OUT) 'Nixpkgs $(NIXOS_STABLE_SERIES) manual' nixpkgs https://github.com/NixOS/nixpkgs/tree/master/doc

NIXPKGS_MANUAL_UNSTABLE_IN ?= /no-such-path
NIXPKGS_MANUAL_UNSTABLE_OUT = manual/nixpkgs/unstable

all: $(NIXPKGS_MANUAL_UNSTABLE_OUT)

$(NIXPKGS_MANUAL_UNSTABLE_OUT): $(NIXPKGS_MANUAL_UNSTABLE_IN) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIXPKGS_MANUAL_UNSTABLE_IN)/share/doc/nixpkgs $(NIXPKGS_MANUAL_UNSTABLE_OUT) 'Nixpkgs $(NIXOS_UNSTABLE_SERIES) manual' nixpkgs https://github.com/NixOS/nixpkgs/tree/master/doc

manual/nixpkgs/index.html: $(NIXPKGS_MANUAL_STABLE_OUT) $(NIXPKGS_MANUAL_UNSTABLE_OUT)
bash ./scripts/fix-manual-headers.sh manual/nixpkgs stable
@echo "<!DOCTYPE html>" > $@
@echo "<html>" >> $@
@echo " <head>" >> $@
@echo " <meta http-equiv=\"refresh\" content=\"7; url='stable/index.html'\" />" >> $@
@echo " </head>" >> $@
@echo " <body>" >> $@
@echo " <h1>Redirecting...</h1>" >> $@
@echo " <p>Please follow <a href=\"stable/index.html\">this link</a>.</p>" >> $@
@echo " </body>" >> $@
@echo "</html>" >> $@

all: manual/nixpkgs/index.html


### Prettify the NixOS manual.

NIXOS_MANUAL_STABLE_IN ?= /no-such-path
NIXOS_MANUAL_STABLE_OUT = manual/nixos/stable

all: $(NIXOS_MANUAL_STABLE_OUT)

$(NIXOS_MANUAL_STABLE_OUT): $(NIXOS_MANUAL_STABLE_IN) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIXOS_MANUAL_STABLE_IN)/share/doc/nixos $(NIXOS_MANUAL_STABLE_OUT) 'NixOS $(NIXOS_STABLE_SERIES) manual' nixos https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual

NIXOS_MANUAL_UNSTABLE_IN ?= /no-such-path
NIXOS_MANUAL_UNSTABLE_OUT = manual/nixos/unstable

all: $(NIXOS_MANUAL_UNSTABLE_OUT)

$(NIXOS_MANUAL_UNSTABLE_OUT): $(NIXOS_MANUAL_UNSTABLE_IN) scripts/bootstrapify-docbook.sh scripts/bootstrapify-docbook.xsl layout.tt common.tt
bash ./scripts/bootstrapify-docbook.sh $(NIXOS_MANUAL_UNSTABLE_IN)/share/doc/nixos $(NIXOS_MANUAL_UNSTABLE_OUT) 'NixOS $(NIXOS_UNSTABLE_SERIES) manual' nixos https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual

manual/nixos/index.html: $(NIXOS_MANUAL_STABLE_OUT) $(NIXOS_MANUAL_UNSTABLE_OUT)
bash ./scripts/fix-manual-headers.sh manual/nixos stable
@echo "<!DOCTYPE html>" > $@
@echo "<html>" >> $@
@echo " <head>" >> $@
@echo " <meta http-equiv=\"refresh\" content=\"7; url='stable/index.html'\" />" >> $@
@echo " </head>" >> $@
@echo " <body>" >> $@
@echo " <h1>Redirecting...</h1>" >> $@
@echo " <p>Please follow <a href=\"stable/index.html\">this link</a>.</p>" >> $@
@echo " </body>" >> $@
@echo "</html>" >> $@

all: manual/nixos/index.html


### Non HTML files (images/icons/etc...)

all: $(HTML) favicon.png favicon.ico robots.txt \
styles \
$(subst .png,-small.png,$(filter-out %-small.png,$(wildcard images/screenshots/*)))


@@ -142,7 +173,7 @@ favicon.ico: favicon.png
%-small.png: %.png
convert -resize 200 $< $@

%.html: %.tt layout.tt common.tt $(DEMOS) $(NIX_DEV_MANUAL_OUT) learn_guides.html.in
%.html: %.tt layout.tt common.tt
tpage \
--pre_chomp --post_chomp \
--eval_perl \
@@ -157,7 +188,7 @@ favicon.ico: favicon.png
xmllint --nonet --noout $@.tmp
mv $@.tmp $@

%: %.in common.tt $(NIX_DEV_MANUAL_OUT) learn_guides.html.in
%: %.in common.tt
echo $$PATH
tpage \
--define latestNixVersion=$(NIX_STABLE_VERSION) \
@@ -195,22 +226,51 @@ update: blogs.xml
@true
endif

# The nix-built site will use the provided SITE_STYLES
ifeq ($(strip $(SITE_STYLES)),)
# But development `make` builds will nix-build.
styles: $(wildcard site-styles/*)
nix-build -A packages.x86_64-linux.siteStyles --fallback --out-link $@
else
styles:
@ln -sfn $(SITE_STYLES) $@
endif

all: manuals

manuals:
bash ./scripts/fix-manual-headers.sh manual/nix stable
bash ./scripts/fix-manual-headers.sh manual/nixpkgs stable
bash ./scripts/fix-manual-headers.sh manual/nixos stable
### Styles (css/svg/...)


SITE_STYLES_LESS := $(wildcard site-styles/*.less) $(wildcard site-styles/**/*.less)

STYLES = \
styles/fonts/*.ttf \
styles/community.css \
styles/index.css

tmp.svg.less: $(wildcard site-styles/assets/*)
embed-svg site-styles/assets tmp.svg.less

tmp.styles: tmp.svg.less $(SITE_STYLES_LESS)
rm -rf tmp.styles

mkdir -p tmp.styles
cp -fR site-styles/* tmp.styles/

rm -rf tmp.styles/assets/*
cp tmp.svg.less tmp.styles/assets/svg.less

styles/fonts/%.ttf: $(wildcard site-styles/common-styles/fonts/*)
rm -rf styles/fonts
mkdir -p styles/fonts
cp site-styles/common-styles/fonts/*.ttf styles/fonts

styles/community.css: tmp.styles $(SITE_STYLES_LESS)
mkdir -vp styles
lessc --verbose \
--source-map=styles/community.css.map \
tmp.styles/pages/community.private.less \
styles/community.css;

styles/index.css: tmp.styles $(SITE_STYLES_LESS)
mkdir -vp styles
lessc --verbose --source-map=styles/index.css.map tmp.styles/index.less styles/index.css

all: $(STYLES)



### Asciinema demos

all: $(DEMOS)

2 changes: 1 addition & 1 deletion community.tt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[% WRAPPER atHead %]
<link rel="stylesheet" href="[% root %]styles/pages/community.css" type="text/css" />
<link rel="stylesheet" href="[% root %]styles/community.css" type="text/css" />
[% END %]
[% WRAPPER layout.tt title="Community" handlesLayout=1 %]

2 changes: 1 addition & 1 deletion donate.tt
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ BIC: KNABNL2H</pre>
</ul>
</div>
<div>
<h2>Acknowledgements</h2>
<h1>Acknowledgements</h1>
<p>The Nix package manager was developed by <a href="https://edolstra.github.io/">Eelco Dolstra</a> as
part of his PhD research in the <a href="http://www.cs.uu.nl/wiki/Trace/WebHome">TraCE project</a>,
funded by the <a href="http://www.jacquard.nl/">Jacquard programme</a>
6 changes: 3 additions & 3 deletions flake.lock

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

46 changes: 18 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
rec {
description = "The nixos.org homepage";

# This is used to build the site.
@@ -62,21 +62,26 @@
(builtins.toJSON (
import (released-nixpkgs-stable + "/nixos/modules/virtualisation/ec2-amis.nix")));

serve = pkgs.writeShellScriptBin "serve" ''python ${toString ./.}/scripts/run.py'';
serve =
let
pythonEnv = pkgs.python3.buildEnv.override {
extraLibs = with pkgs.python3Packages; [ click livereload ];
};
in
pkgs.writeShellScriptBin "serve" ''exec "${pythonEnv}/bin/python" "${toString ./.}/scripts/run.py" "$@"'';

in rec {
defaultPackage."${system}" = packages."${system}".homepage;

checks."${system}".build = defaultPackage."${system}";

packages."${system}" = rec {
siteStyles = pkgs.callPackage ./site-styles { inherit nixos-common-styles system; };

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

src = self;

preferLocalBuild = true;
enableParallelBuilding = true;

buildInputs = with pkgs; [
@@ -87,15 +92,16 @@
libxml2
libxslt
linkchecker
nix
nixFlakes
nixos-common-styles.packages."${system}".embedSVG
nodePackages.less
perl
perlPackages.AppConfig
perlPackages.JSON
perlPackages.TemplatePluginIOAll
perlPackages.TemplatePluginJSONEscape
perlPackages.TemplateToolkit
perlPackages.XMLSimple
python3Packages.livereload
serve
xhtml1
xidel
@@ -104,6 +110,9 @@
preBuild = ''
export NIX_DB_DIR=$TMPDIR
export NIX_STATE_DIR=$TMPDIR
rm -f site-styles/common-styles
ln -s ${nixos-common-styles.packages."${system}".commonStyles} site-styles/common-styles
'';

makeFlags =
@@ -120,7 +129,6 @@
"NIXOS_UNSTABLE_SERIES=${pkgs-unstable.lib.trivial.release}"

"NIXOS_AMIS=${nixosAmis}"
"SITE_STYLES=${siteStyles}"
"NIX_PILLS_MANUAL_IN=${nixPills}/share/doc/nix-pills"
"NIX_DEV_MANUAL_IN=${nix-dev.defaultPackage.x86_64-linux}/html"

@@ -148,10 +156,12 @@
export NIXOS_UNSTABLE_SERIES="${pkgs-unstable.lib.trivial.release}"
export NIXOS_AMIS="${nixosAmis}"
# SITE_STYLES skipped by design.
export NIX_PILLS_MANUAL_IN="${nixPills}/share/doc/nix-pills"
export NIX_DEV_MANUAL_IN="${nix-dev.defaultPackage.x86_64-linux}/html"
rm -f site-styles/common-styles
ln -s ${nixos-common-styles.packages."${system}".commonStyles} site-styles/common-styles
echo ""
echo " To start developing run:"
echo " serve"
@@ -164,25 +174,5 @@
'';
};
};

nixosConfigurations.container = nixpkgs.lib.nixosSystem {
inherit system;
modules =
[ ({ lib, ... }:
{ system.configurationRevision = lib.mkIf (self ? rev) self.rev;
boot.isContainer = true;
networking.useDHCP = false;
networking.firewall.allowedTCPPorts = [ 80 ];
services.httpd = {
enable = true;
adminAddr = "admin@example.org";
virtualHosts.default = {
documentRoot = packages."${system}".homepage;
};
};
})
];
};

};
}
2 changes: 1 addition & 1 deletion layout.tt
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ BLOCK navigationLink %]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0" />
<link rel="stylesheet" href="[% root %]styles/styles.css" type="text/css" />
<link rel="stylesheet" href="[% root %]styles/index.css" type="text/css" />

<link rel="shortcut icon" type="image/png" href="/favicon.png" />
<meta name="google-site-verification" content="ir-07nYvo3u3x_VmkTO1wCfYJ8uC-SrVBGR7hZgqPSE" />
Loading