-
-
Notifications
You must be signed in to change notification settings - Fork 655
Expand file tree
/
Copy pathflake.nix
More file actions
96 lines (91 loc) · 2.33 KB
/
flake.nix
File metadata and controls
96 lines (91 loc) · 2.33 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
91
92
93
94
95
96
{
description = "Quickemu flake";
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{
self,
flake-schemas,
nixpkgs,
}:
let
# Define supported systems and a helper function for generating system-specific outputs
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"aarch64-linux"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
system = system;
pkgs = import nixpkgs { inherit system; };
}
);
in
{
# Define schemas for the flake's outputs
schemas = flake-schemas.schemas;
# Define overlays for each supported system
overlays = {
default =
final: prev:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if final.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
quickemu = final.callPackage ./package.nix ovmfArgs;
};
};
# Define packages for each supported system
packages = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
rec {
quickemu = pkgs.callPackage ./package.nix ovmfArgs;
default = quickemu;
}
);
# Define devShells for each supported system
devShells = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
default = pkgs.callPackage ./devshell.nix ovmfArgs;
}
);
};
}