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 outputs =
51 inputs:
52 inputs.flake-parts.lib.mkFlake { inherit inputs; } {
53 imports = [
54 # keep-sorted start
55 ./flake/format.nix
56 ./flake/git-hooks.nix
57 ./flake/shell.nix
58 # keep-sorted end
59 ];
60
61 systems = [
62 "x86_64-linux"
63 "aarch64-linux"
64 "x86_64-darwin"
65 "aarch64-darwin"
66 ];
67
68 perSystem =
69 {
70 pkgs,
71 system,
72 config,
73 lib,
74 ...
75 }:
76 {
77 # For better or for worse, nixpkgs has established the pattern of
78 # a legacyPackages attribute that does not contain legacy packages at all,
79 # but rather an attribute set that's just not the shape of the typical packages attribute.
80 # In our case, we have a handful of non-package attributes that we still want to expose under the pkgs object.
81 legacyPackages = import ./all-packages.nix {
82 inherit (inputs.nixpkgs) lib;
83 inherit inputs;
84 currentSystem = system;
85 hostpkgs = import ./host-packages.nix { inherit pkgs; };
86 };
87
88 # and then expose a filtered version of that attribute set with just the actual packages.
89 packages = lib.filterAttrs (_name: value: value ? drvPath) config.legacyPackages;
90 checks = config.packages;
91 };
92 };
93}