-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
90 lines (83 loc) · 2.31 KB
/
Copy pathflake.nix
File metadata and controls
90 lines (83 loc) · 2.31 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
crane.url = "github:ipetkov/crane";
};
outputs =
{
nixpkgs,
rust-overlay,
crane,
self,
...
}:
let
inherit (nixpkgs) lib;
# The overlay adds pkgs.bread (host-native EFI binary) and applies the
# rust-overlay so that the Rust toolchain is available for the build.
# Users can add this to their nixpkgs overlays and then reference
# pkgs.bread directly in boot.loader.bread.package.
overlay = lib.composeManyExtensions [
(import rust-overlay)
(final: _: {
bread = final.callPackage ./packages/bread.nix { inherit crane; };
})
];
eachSystem = lib.genAttrs lib.systems.flakeExposed;
in
{
overlays.default = overlay;
nixosModules.default = import ./nixos/modules/system/boot/loader/bread/bread.nix;
packages = eachSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
in
{
bread-x86_64 = pkgs.callPackage ./packages/bread.nix {
inherit crane;
cargoTarget = "x86_64-unknown-uefi";
};
bread-aarch64 = pkgs.callPackage ./packages/bread.nix {
inherit crane;
cargoTarget = "aarch64-unknown-uefi";
};
default = pkgs.bread;
}
);
devShells = eachSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
cargo-nextest
cargo-expand
cargo-bloat
cargo-edit
just
];
};
}
);
nixosConfigurations.bread-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./vm/configuration.nix
{ nixpkgs.overlays = [ overlay ]; }
self.nixosModules.default
];
};
};
}