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: 984cb02f2aa5
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: c19f42ac0011
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Nov 27, 2020

  1. Copy the full SHA
    c19f42a View commit details
Showing with 27 additions and 11 deletions.
  1. +11 −8 README.md
  2. +11 −3 flake.nix
  3. +5 −0 run.py
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,19 +23,22 @@ To run local development instance follow this steps:
$ git clone git@github.com:NixOS/nixos-homepage.git
$ cd nixos-homepage
$ nix-shell
[nix-shell]$ make
[nix-shell]$ python -m http.server

Open your browser at: http://127.0.0.1:8000/index.html
To start developing run:
python run.py

and open browser on:
https://127.0.0.1:8000

To automatically rebuild on every change use:
It will rebuild the website on each change.

[nix-shell]$ fd | entr make
[nix-shell]$ python run.py

Open your browser at: http://127.0.0.1:8000/index.html

To test the complete result from a nix-build:
In order for browser to automatically refresh install [Livereload extension](http://livereload.com/extensions/) for you browser.

$ nix-build
$ nix-shell --run 'cd result/ && python -m http.server'
Before creating a pull request make sure that `nix-build` runs successfully.


## License
14 changes: 11 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -76,9 +76,6 @@

buildInputs = with pkgs; [
asciinema-scenario
caddy
entr
fd
gnused
imagemagick
jq
@@ -93,6 +90,7 @@
perlPackages.TemplatePluginJSONEscape
perlPackages.TemplateToolkit
perlPackages.XMLSimple
python3Packages.livereload
xhtml1
xidel
];
@@ -147,6 +145,16 @@
# 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"
echo ""
echo " To start developing run:"
echo " python run.py"
echo ""
echo " and open browser on:"
echo " https://127.0.0.1:8000"
echo ""
echo " It will rebuild the website on each change."
echo ""
'';
};
};
5 changes: 5 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from livereload import Server, shell

server = Server()
server.watch("./", shell("make"))
server.serve(root="./", port=8000)