-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (56 loc) · 2.12 KB
/
flake.nix
File metadata and controls
62 lines (56 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Copyright 2025, UNSW
# SPDX-License-Identifier: BSD-2-Clause
#
{
description = "A flake for the seL4 Microkit tutorial";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
};
outputs = { nixpkgs, ... }:
let
microkit-version = "2.2.0";
microkit-platforms = {
aarch64-darwin = "macos-aarch64";
x86_64-darwin = "macos-x86-64";
x86_64-linux = "linux-x86-64";
aarch64-linux = "linux-aarch64";
};
forAllSystems = with nixpkgs.lib; genAttrs (builtins.attrNames microkit-platforms);
in
{
devShells = forAllSystems
(system: {
default =
let
pkgs = import nixpkgs {
inherit system;
};
in
# mkShellNoCC, because we do not want the cc from stdenv to leak into this shell
pkgs.mkShellNoCC rec {
name = "microkit_tutorial";
microkit-platform = microkit-platforms.${system} or (throw "Unsupported system: ${system}");
env.MICROKIT_SDK = pkgs.fetchzip {
url = "https://github.com/seL4/microkit/releases/download/${microkit-version}/microkit-sdk-${microkit-version}-${microkit-platform}.tar.gz";
hash = {
aarch64-darwin = "sha256-UZBEwS3vAQqJe6Xj+13smJRS0RYfoc0uCK7hB8ujbvA=";
x86_64-darwin = "sha256-aE2mYToK2ne9vzw6d3YQDzJvhpnI8IHOR9+VqZxwlfY=";
aarch64-linux = "sha256-U1hA7Vk/TlSWgV7KiEeG7AkA7t5IR/x89mSE0YHBRNA=";
x86_64-linux = "sha256-dxPu2Q01qjKhME6Z6kgG4ASDUe12ytZmh5tCtFva/L0=";
}.${system} or (throw "Unsupported system: ${system}");
};
nativeBuildInputs = with pkgs; [
pkgsCross.aarch64-embedded.stdenv.cc.bintools
pkgsCross.aarch64-embedded.stdenv.cc
qemu
gnumake
curl
];
# To avoid Nix adding compiler flags that are not available on a freestanding
# environment.
hardeningDisable = [ "all" ];
};
});
};
}