Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noteed/toplevels
NixOS toplevels
https://github.com/noteed/toplevels
Last synced: about 2 months ago
JSON representation
NixOS toplevels
- Host: GitHub
- URL: https://github.com/noteed/toplevels
- Owner: noteed
- Created: 2020-12-09T05:40:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-06T22:53:28.000Z (2 months ago)
- Last Synced: 2024-11-06T23:31:46.320Z (2 months ago)
- Language: Nix
- Size: 26.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toplevels
In NixOS parlance, the `toplevel` is a complete system, and is really "just" a
path in the Nix store. In a NixOS machine, `/run/current-system` points to the
current toplevel, which is usually built by `nixos-rebuild`.In Nixpkgs, the `nixos/default.nix` file exposes the toplevel as the `system`
attribute.This repository contains a Nix expression to define a test toplevel, together
with a GitHub action to build it and cache it to Backblaze B2.In addition to the toplevel content, a file containing the latest toplevel (as
a path in the Nix store) is uploaded to
https://f003.backblazeb2.com/file/hypered-store/toplevels/test.txt.The test toplevel contains an `update-system` script which check the above
file, downloads the corresponding Nix paths, then activate the toplevel.# Notes
Building, including downloading from cache.nixos.org, takes about 100 seconds.
Uploading everything to B2 took about 14 minutes the first time. Next uploads
take about 50 seconds.Playing with a binary cache may reuse cached data in `/root/.cache/nix`,
resulting in `does not contain a valid signature`, even though `nix path-info
--sigs ... --store ...` seems fine. Deleting the cache solves the problem.Backblaze "Daily Class B Transactions Caps" seems to be impacted by simply
uploading the narinfos to it (I guess that some metadata are downloaded to
check if the uploads should actually happen).Downloading the toplevel on a different machine downloads about 500MB,
resulting in 2GB once unpacked. If it is a minor change, it can take around 5
seconds for about 5MB. If nothing has changed, it takes less than a second.# Hosts
In addition of the above experiment (in `default.nix`), I'm starting to keep my
NixOS configurations in the `hosts/` directory.