This repository has no description
1{
2 description = "Packages for Linux on WebAssembly";
3
4 inputs = {
5 nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
6 flake-parts = {
7 url = "github:hercules-ci/flake-parts";
8 inputs.nixpkgs-lib.follows = "nixpkgs";
9 };
10
11 # repo meta:
12 # keep-sorted start block=yes
13 git-hooks = {
14 url = "github:cachix/git-hooks.nix";
15 inputs.nixpkgs.follows = "nixpkgs";
16 };
17 make-shell = {
18 url = "github:nicknovitski/make-shell";
19 };
20 treefmt-nix = {
21 url = "github:numtide/treefmt-nix";
22 inputs.nixpkgs.follows = "nixpkgs";
23 };
24 # keep-sorted end
25
26 # package sources:
27 # keep-sorted start block=yes
28 busybox = {
29 url = "github:tombl/busybox";
30 flake = false;
31 };
32 libclang_rt = {
33 url = "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/libclang_rt.builtins-wasm32-wasi-25.0.tar.gz";
34 flake = false;
35 };
36 linux = {
37 url = "github:tombl/linux/args";
38 flake = false;
39 };
40 llvm = {
41 url = "github:llvm/llvm-project/release/19.x";
42 flake = false;
43 };
44 musl = {
45 url = "github:tombl/musl/args";
46 flake = false;
47 };
48 # keep-sorted end
49 };
50
51 nixConfig = {
52 extra-substituters = [ "https://nix.tombl.net/linuxwasm" ];
53 extra-trusted-keys = [ "linuxwasm:VY2O9prGSkyVY+xn1RNQV4voLVTnc2FOxAtzf8VbZaw=" ];
54 };
55
56 outputs =
57 inputs:
58 inputs.flake-parts.lib.mkFlake { inherit inputs; } {
59 imports = [
60 # keep-sorted start
61 ./flake/format.nix
62 ./flake/git-hooks.nix
63 ./flake/shell.nix
64 # keep-sorted end
65 ];
66
67 systems = [
68 "x86_64-linux"
69 "aarch64-linux"
70 "x86_64-darwin"
71 "aarch64-darwin"
72 ];
73
74 perSystem =
75 {
76 pkgs,
77 system,
78 config,
79 lib,
80 ...
81 }:
82 {
83 # For better or for worse, nixpkgs has established the pattern of
84 # a legacyPackages attribute that does not contain legacy packages at all,
85 # but rather an attribute set that's just not the shape of the typical packages attribute.
86 # In our case, we have a handful of non-package attributes that we still want to expose under the pkgs object.
87 legacyPackages = import ./all-packages.nix {
88 inherit (inputs.nixpkgs) lib;
89 inherit inputs;
90 currentSystem = system;
91 hostpkgs = import ./host-packages.nix { inherit pkgs; };
92 };
93
94 # and then expose a filtered version of that attribute set with just the actual packages.
95 packages = lib.filterAttrs (_name: value: value ? drvPath) config.legacyPackages;
96 checks = config.packages;
97 };
98 };
99}