Toolchain: Add nix flake

Add a nix flake to `Toolchain/` that wraps the existing nix derivation
`Toolchain/serenity.nix`. This also comes with a lockfile making the nix
developer enviornment setup more reproducible.

We also update the documentation for "other builds" to mention the
flake.
This commit is contained in:
Ali Caglayan 2023-08-31 14:39:47 +01:00 committed by Andrew Kaster
parent 4641af7873
commit 47e0ea8e42
Notes: sideshowbarker 2024-07-17 04:32:07 +09:00
3 changed files with 86 additions and 0 deletions

View file

@ -33,6 +33,12 @@ You can use the `nix-shell` script [`Toolchain/serenity.nix`](../Toolchain/seren
nix-shell Toolchain/serenity.nix
```
or you can use the nix flake [`Toolchain/flake.nix`](../Toolchain/serenity.nix) instead:
```console
nix develop Toolchain
```
## Alpine Linux
First, make sure you have enabled the `community` repository in `/etc/apk/repositories` and run `apk update`. It has been tested on `edge`, YMMV on `stable`.

60
Toolchain/flake.lock Normal file
View file

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1693485768,
"narHash": "sha256-PxqYECiPBBbavaPjnf/v2rlzp2Xoe/JPA7rl1WxGe0A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c106712dc7a447db0c8a654162c3a0557909dfd6",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

20
Toolchain/flake.nix Normal file
View file

@ -0,0 +1,20 @@
{
description = "Serenity OS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = import ./serenity.nix { inherit pkgs; };
}
);
}