Commit Graph

24 Commits

Author SHA1 Message Date
Valentin Gagarin
53dff2387f
make building the manuals optional (#1035) 2024-08-24 17:52:19 +02:00
Valentin Gagarin
c2be69105c
offer the Nix manual as a single page again (#997) 2024-06-13 11:39:13 +02:00
Valentin Gagarin
bfa0c7de86
migrate from niv to npins (#991) 2024-06-03 09:50:23 +02:00
Valentin Gagarin
a792a25bb0
update contributing instructions (#987)
* update contributing instructions

running devmode with `--run` doesn't actually work, it doesn't pick up
the changes
2024-05-26 17:09:24 +02:00
Valentin Gagarin
07a1507f25 update some comments 2024-04-05 17:17:53 +02:00
Silvan Mosberger
f4794639c6 Various improvements to the dynamically generated Nix versions
- Use separate JSON files to track sources for Nixpkgs and Nix releases
  This greatly simplifies the code, because we can directly encode
  versions as keys without ambiguity
- Avoid an instance of IFD for the redirect generation
- Use pkgs.substitute instead of builtins.replaceStrings
- Turn off the single-page feature for now. It was added by Valentin in
  a previous commit, but I think we should discuss this a bit more
- Simplify a lot of the code and add comments
- Fix the mutable redirects, they were broken by a parent commit
- Remove pieces of Nix code that weren't used, like the import of the
  Nixpkgs manual. This can be added in the future when necessary
- Make sure that Nix versions are cached by building from the store path
2024-04-04 02:04:56 +02:00
Valentin Gagarin
e837576351 refactor
this change also places all historical Nix manuals under a stable URL
2024-04-03 13:59:14 +02:00
Valentin Gagarin
a3b5aad725 add a script to update Nixpkgs releases
this will accumulate releases over time. it's not great, but this is the
price of persistent URLs. otherwise, when people link to supposedly stable
URLs, and we garbage-collect old manuals, those links will rot away.

it's also slightly simpler algorithmically, and therefore easier to
reason about.

this can be incrementally improved in the future, by automatically
adding redirects to e.g. the closest following release for which the
manual is still served. for example, if we currently serve

    23.11
    23.05
    22.11
    22.05

but in the future decide to cut that list to the first two, the script
would drop the excess pins and add redirects like these:

    /manual/nixpkgs/22.05/* /manual/nixpkgs/23.05/:splat 301
    /manual/nixpkgs/22.11/* /manual/nixpkgs/23.05/:splat 301

the condition for that would be that we are reasonably sure that the
manuals will manage their own internal redirects as pages and anchors
move around between releases.
2024-04-03 09:21:26 +02:00
Valentin Gagarin
0a70dbf90c deep clone, optimise checkouts 2024-04-03 09:21:26 +02:00
Valentin Gagarin
161bba2625 add script to update Nix release branches 2024-04-03 09:21:26 +02:00
Valentin Gagarin
f700397214 redirect the full mutable URL 2024-04-03 09:21:26 +02:00
Valentin Gagarin
3ffb8d8227 rework the way redirects are built 2024-04-03 09:21:26 +02:00
Valentin Gagarin
caaa855395 generate index page from structured data
- refactor `default.nix` for hopefully better readability
- de-noise the overview page text
2024-04-03 09:21:26 +02:00
Valentin Gagarin
1f6a1219ae
actually fix mutable shortlinks (#904)
now tested with:

    nix build && nix-shell -p netlify-cli --run "cd result; netlify dev"
2024-02-06 23:55:59 +00:00
Valentin Gagarin
2720a4121e
fix mutable shortlinks (#903)
they were missing a response status code.

use 302 since the target URL is decidedly not permanent:
https://datatracker.ietf.org/doc/html/rfc9110#name-302-found
2024-02-06 21:42:51 +01:00
Valentin Gagarin
d6b29c39d9 add mutable shortlinks
this allows mapping cleanly from the existing mutable links on nixos.org
2024-01-15 13:49:14 +01:00
Valentin Gagarin
0ff3ceca01
use upstream page redirects for Nix manual (#829) 2024-01-15 13:44:42 +01:00
Robert Hensing
9cc2ddd16a
Merge pull request #764 from fricklerhandwerk/add-manuals
host Nix reference manual on nix.dev
2023-12-04 17:10:45 +01:00
Valentin Gagarin
63d783a3bc fix and simplify devmode script
previously, stderr was garbled, which made it really annoying to deal
with build errors.

it turns out that the library wrapper around calling a process is not
just counterproductive, but also completely unnecessary.

the build now takes longer because it's not incremental any more.
but the problem with `sphinx-build` in a shell environment is that it
doesn't keep track of an entire class of files, that would have to be
considered manually. this is too much manual overhead that doesn't scale
at all. with the new setup the live preview will do exactly what the
final deployment does.

[1]: https://github.com/executablebooks/sphinx-autobuild#relevant-sphinx-bugs

Co-authored-by: Alex Groleau source@proof.construction
2023-11-30 16:53:33 +01:00
fricklerhandwerk
21bfef408a host Nix reference manual on nix.dev
this is the most cursed setup you will see any time soon.

we're dumping the Nix manual unchanged into the build tree *after*
building. the reason is that we'd want to link to it from our table of
contents, but because Sphinx does not allow adding arbitrary files to
the build output in arbitrary locations (only `_static` works). but we
want to place the manual behind a particular URL, and the alternative of
maintaining URL rewrites (e.g. in nginx) is not accessible here because the
infrastructure is managed somewhere else.

now that the files won't appear in their desired locations at Sphinx
build time, we can't use relative links to reference them, therefore we
have to resort to pointing to the web URL the manual will appear at.
this is terrible and I'm sorry. please fix this if you have a better
idea. once we use URLs though, we have to avoid linkchecking, since
those files may not be there before deploying them.

figuring all of this out took way longer than anyone would wish.

Co-authored-by: Alejandro Sanchez Medina <alejandrosanchzmedina@gmail.com>
2023-11-27 07:30:35 +01:00
Lorenzo Manacorda
ac17d691d8 vale: add to devShell 2023-11-13 13:28:42 +01:00
Silvan Mosberger
c5e1cd7bbb default.nix: Allow pure evaluation 2023-11-07 04:43:55 +01:00
fricklerhandwerk
1e2299cff6 remove flake.nix
use niv for dependency management.

this follows our own tutorials on writing packages and development
shells, and we generally find it is easier to read and work with.

Co-authored-by: Alejandro Sanchez Medina <alejandrosanchzmedina@gmail.com>
2023-11-07 03:04:28 +01:00
Rok Garbas
e5e28948c0
flake compat 2021-06-06 12:50:35 +02:00