-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
131 lines (114 loc) · 3.76 KB
/
flake.nix
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
raspi-firmware = {
url = "github:raspberrypi/firmware";
flake = false;
};
};
outputs = {
self,
nixpkgs,
raspi-firmware,
}: let
inherit (self) lib;
forSupportedSystems = lib.genAttrs ["x86_64-linux" "aarch64-linux" "armv7l-linux"];
in {
hydraJobs = self.packages;
packages = forSupportedSystems (system: {
rpi = lib.microsSystem {
modules = [
./micros/modules/profiles/hardware/rpi.nix
./micros/modules/profiles/hardware/arm32-cross.nix
{
not-os.rpi1 = true;
not-os.rpi2 = true;
system.build.rpi-firmware = raspi-firmware;
nixpkgs.hostPlatform = {inherit system;};
nixpkgs.overlays = [
(final: prev: {
openssh = prev.openssh.override {
withFIDO = false;
withKerberos = false;
};
util-linux = prev.util-linux.override {
pamSupport = false;
capabilitiesSupport = false;
ncursesSupport = false;
systemdSupport = false;
nlsSupport = false;
translateManpages = false;
};
utillinuxCurses = prev.util-linux;
utillinuxMinimal = prev.util-linux;
})
];
}
];
};
iso = lib.microsSystem {
modules = [
./micros/modules/profiles/virtualization/iso-image.nix
{
nixpkgs.hostPlatform = {inherit system;};
}
];
};
zynq = lib.microsSystem {
modules = [
./micros/modules/profiles/hardware/zynq.nix
./micros/modules/profiles/hardware/arm32-cross.nix
{
nixpkgs.hostPlatform = {inherit system;};
}
];
};
qemu = lib.microsSystem {
modules = [
./micros/modules/profiles/virtualization/qemu-guest.nix
{
nixpkgs.hostPlatform = {inherit system;};
}
];
};
});
legacyPackages = forSupportedSystems (system: {
linux-rpi2 = nixpkgs.legacyPackages.${system}.callPackage ./pkgs/linux-rpi.nix {};
});
# Custom library to provide additional utilities for 3rd party consumption.
# Primarily designed to expose `microsSystem` as, e.g., inputs.micros.lib.microsSystem
# for when you are building non-supported platforms on your own accord.
# TODO: extend nixpkgs.lib here
lib = nixpkgs.lib.extend (_: _: {
microsSystem = args:
import ./micros/lib/eval-config.nix (
{
inherit nixpkgs;
# Allow system to be set modularly in nixpkgs.system.
# We set it to null, to remove the "legacy" entrypoint's
# non-hermetic default.
system = null;
modules =
args.modules
++ [
# This module is injected here since it exposes the nixpkgs self-path in as
# constrained of contexts as possible to avoid more things depending on it and
# introducing unnecessary potential fragility to changes in flakes itself.
#
# See: failed attempt to make pkgs.path not copy when using flakes:
# https://github.com/NixOS/nixpkgs/pull/153594#issuecomment-1023287913
({
config,
pkgs,
lib,
...
}: {
config.nixpkgs.flake.source = nixpkgs.outPath;
})
];
}
// builtins.removeAttrs args ["modules"]
);
});
};
}